- based on apache-mod_jk.spec only for apache1
[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.5
7 Release:        0.1
8 License:        Apache
9 Group:          Networking/Daemons
10 Source0:        http://sunsite.icm.edu.pl/pub/www/apache/dist/jakarta/tomcat-connectors/jk/source/jakarta-tomcat-connectors-jk-%{version}-src.tar.gz
11 # Source0-md5:  55727c871286e010222bb0fb91f21d08
12 Source1:        %{name}.conf
13 URL:            http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk/doc/
14 BuildRequires:  %{apxs}
15 BuildRequires:  libtool
16 BuildRequires:  automake
17 BuildRequires:  autoconf
18 BuildRequires:  perl-base
19 PreReq:         apache(EAPI) < 2.0.0
20 PreReq:         apache(EAPI) >= 1.3.9
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
44 %build
45 cd jk/native
46
47 ./buildconf.sh
48
49 %configure \
50         --enable-EAPI \
51         --with-apxs=%{apxs}
52
53 %{__make}
54
55 %install
56 rm -rf $RPM_BUILD_ROOT
57 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_apacheconf},/var/lock/mod_jk}
58
59 cd jk/native
60
61 %{__make} install \
62         DESTDIR=$RPM_BUILD_ROOT \
63         APXS="%{apxs} -S LIBEXECDIR=$RPM_BUILD_ROOT$(%{apxs} -q LIBEXECDIR)" \
64         libexecdir=$RPM_BUILD_ROOT%{_pkglibdir}
65
66 install %{SOURCE1} $RPM_BUILD_ROOT%{_apacheconfdir}/mod_jk.conf
67
68 %clean
69 rm -rf $RPM_BUILD_ROOT
70
71 %post
72 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
73 if [ -f %{_apacheconf} ] && ! grep -q "^Include.*mod_jk.conf" %{_apacheconf}; then
74         echo "Include /etc/apache/mod_jk.conf" >> %{_apacheconf}
75 fi
76 if [ -f /var/lock/subsys/apache ]; then
77         /etc/rc.d/init.d/apache restart 1>&2
78 fi
79
80 %preun
81 if [ "$1" = "0" ]; then
82         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
83         umask 027
84         grep -v "^Include.*mod_jk.conf" %{_apacheconf} > \
85                 %{_apacheconf}.tmp
86         mv -f %{_apacheconf}.tmp %{_apacheconf}
87         if [ -f /var/lock/subsys/apache ]; then
88                 /etc/rc.d/init.d/apache restart 1>&2
89         fi
90 fi
91
92 %files
93 %defattr(644,root,root,755)
94 %doc jk/native/{README,CHANGES.txt} jk/docs/*
95 %config(noreplace) %{_apacheconfdir}/mod_jk.conf
96 %attr(755,root,root) %{_pkglibdir}/*
97 %attr(750,http,http) /var/lock/mod_jk
This page took 0.125197 seconds and 3 git commands to generate.