2 # Replace MODNAME with real module name
3 # Replace OLDVERSION with version prior apache1 confdir support
5 %define mod_name MODNAME
6 %define apxs %{_sbindir}/apxs1
7 Summary: Apache module: ...
8 Summary(pl): Modu³ Apache'a: ...
9 Name: apache1-mod_%{mod_name}
12 License: - (enter Apache/GPL/LGPL/BSD/BSD-like/other license name here)
13 Group: Networking/Daemons
18 BuildRequires: apache1-devel >= 1.3.33-2
19 Requires(triggerpostun): %{apxs}
20 Requires(triggerpostun): grep
22 Conflicts: apache1 < 1.3.33-2
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
26 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
29 MODNAME is Apache module...
34 %setup -q -n mod_%{mod_name}-%{version}
37 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
40 rm -rf $RPM_BUILD_ROOT
41 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
43 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
44 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/99_mod_%{mod_name}.conf
47 rm -rf $RPM_BUILD_ROOT
50 if [ -f /var/lock/subsys/apache ]; then
51 /etc/rc.d/init.d/apache restart 1>&2
55 if [ "$1" = "0" ]; then
56 if [ -f /var/lock/subsys/apache ]; then
57 /etc/rc.d/init.d/apache restart 1>&2
61 %triggerpostun -- %{name} < OLDVERSION
62 if grep -q '^Include conf.d' /etc/apache/apache.conf; then
63 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
65 /^Include.*mod_%{mod_name}.conf/d
66 ' /etc/apache/apache.conf
68 # they're still using old apache.conf
70 s,^Include.*mod_%{mod_name}.conf,Include %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf,
71 ' /etc/apache/apache.conf
73 if [ -f /var/lock/subsys/apache ]; then
74 /etc/rc.d/init.d/apache restart 1>&2
78 %defattr(644,root,root,755)
80 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
81 %attr(755,root,root) %{_pkglibdir}/*