efc417f691581fd135f2fc104ea6fd4135e458ad
[packages/apache1-mod_jk.git] / apache1-mod_jk.spec
1 %define         apxs            /usr/sbin/apxs1
2 Summary:        Apache module that handles communication between Tomcat and Apache 1.3.x
3 Summary(pl):    Modu³ Apache'a obs³uguj±cy komunikacjê miêdzy Tomcatem a Apachem 1.3.x
4 %define         mod_name        jk
5 Name:           apache1-mod_%{mod_name}
6 Version:        1.2.6
7 Release:        1
8 License:        Apache
9 Group:          Networking/Daemons
10 Source0:        http://www.apache.org/dist/jakarta/tomcat-connectors/jk/source/jakarta-tomcat-connectors-jk-%{version}-src.tar.gz
11 # Source0-md5:  018b91a0ce874cbc3dae7700f452838b
12 Source1:        %{name}.conf
13 Patch0:         jakarta-tomcat-connectors-jk-jkpass.patch
14 URL:            http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk/doc/
15 BuildRequires:  %{apxs}
16 BuildRequires:  libtool
17 BuildRequires:  automake
18 BuildRequires:  autoconf
19 BuildRequires:  perl-base
20 PreReq:         apache1(EAPI) >= 1.3.31
21 Requires(post,preun):   %{apxs}
22 Requires(post,preun):   %{__perl}
23 Requires(post,preun):   grep
24 Requires(preun):        fileutils
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 Obsoletes:      jakarta-tomcat-connectors-jk
27
28 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
29 %define         _apacheconfdir  %(%{apxs} -q SYSCONFDIR)
30 %define         _apacheconf     %{_apacheconfdir}/apache.conf
31
32 %description
33 JK is a replacement to the elderly mod_jserv. It was a completely new
34 Tomcat-Apache plug-in that handles the communication between Tomcat
35 and Apache.
36
37 %description -l pl
38 JK jest zamiennikiem starego mod_jserv. Jest ca³kowicie now± wtyczk±
39 Tomcat-Apache obs³uguj±c± komunikacjê miêdzy Tomcatem a Apachem.
40
41 %prep
42 %setup -q -n jakarta-tomcat-connectors-jk-%{version}-src
43 %patch0 -p1
44
45 %build
46 cd jk/native
47
48 ./buildconf.sh
49
50 %configure \
51         --enable-EAPI \
52         --with-apxs=%{apxs}
53
54 %{__make}
55
56 %install
57 rm -rf $RPM_BUILD_ROOT
58 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_apacheconf},/var/lock/mod_jk}
59
60 cd jk/native
61
62 %{__make} install \
63         DESTDIR=$RPM_BUILD_ROOT \
64         APXS="%{apxs} -S LIBEXECDIR=$RPM_BUILD_ROOT$(%{apxs} -q LIBEXECDIR)" \
65         libexecdir=$RPM_BUILD_ROOT%{_pkglibdir}
66
67 install %{SOURCE1} $RPM_BUILD_ROOT%{_apacheconfdir}/mod_jk.conf
68
69 %clean
70 rm -rf $RPM_BUILD_ROOT
71
72 %post
73 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
74 if [ -f %{_apacheconf} ] && ! grep -q "^Include.*mod_jk.conf" %{_apacheconf}; then
75         echo "Include /etc/apache/mod_jk.conf" >> %{_apacheconf}
76 fi
77 if [ -f /var/lock/subsys/apache ]; then
78         /etc/rc.d/init.d/apache restart 1>&2
79 fi
80
81 %preun
82 if [ "$1" = "0" ]; then
83         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
84         umask 027
85         grep -v "^Include.*mod_jk.conf" %{_apacheconf} > \
86                 %{_apacheconf}.tmp
87         mv -f %{_apacheconf}.tmp %{_apacheconf}
88         if [ -f /var/lock/subsys/apache ]; then
89                 /etc/rc.d/init.d/apache restart 1>&2
90         fi
91 fi
92
93 %files
94 %defattr(644,root,root,755)
95 %doc jk/native/{README,CHANGES.txt} jk/doc/*
96 %config(noreplace) %{_apacheconfdir}/mod_jk.conf
97 %attr(755,root,root) %{_pkglibdir}/*
98 %attr(750,http,http) /var/lock/mod_jk
This page took 0.032789 seconds and 2 git commands to generate.