-%define apxs /usr/sbin/apxs
%define mod_name roaming
-
+%define apxs /usr/sbin/apxs
Summary: Enables Netscape Communicator roaming profiles with Apache
Summary(cs): Modul podpory roamingových profilù Netscape Communicatora pro Apache
Summary(da): Et apachemodul som lader webtjeneren håndtere profiler for Netscape Communicator
Summary(sk): WWW prehliadaè Netscape Navigator
Summary(sv): Möjliggör Netscape Communicator reseprofiler med Apache
Name: apache-mod_%{mod_name}
-Version: 1.0.2
-Release: 6
+Version: 2.0.0
+Release: 1
License: BSD-like
Group: Networking/Daemons
Source0: http://www.klomp.org/mod_roaming/mod_%{mod_name}-%{version}.tar.gz
-# Source0-md5: 226c0ce2daf276072079590b5560f022
+# Source0-md5: ad2d720d7ffd08c4e7f2e6979795237e
Source1: %{name}.conf
URL: http://www.klomp.org/mod_roaming/
BuildRequires: %{apxs}
-BuildRequires: apache(EAPI)-devel
-Requires(post,preun): %{apxs}
-Requires(post,preun): grep
-Requires(preun): fileutils
-Requires: apache(EAPI)
-Provides: mod_roaming
+BuildRequires: apache-devel >= 2.0.32
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires: apache(modules-api) = %apache_modules_api
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-Obsoletes: mod_roaming
+
+%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
+%define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
%description
With mod_roaming you can use your Apache web server as a Netscape
%setup -q -n mod_%{mod_name}-%{version}
%build
-%{apxs} -c -o mod_roaming.so -lc mod_roaming.c
+%{apxs} -c -o mod_roaming.la mod_roaming.c
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_libdir}/apache,%{_sysconfdir}/httpd,%{_var}/lib/mod_roaming}
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd.conf,%{_var}/lib/mod_roaming}
-install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_libdir}/apache
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/mod_roaming.conf
+install .libs/mod_roaming.so $RPM_BUILD_ROOT%{_pkglibdir}
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/90_mod_%{mod_name}.conf
%clean
rm -rf $RPM_BUILD_ROOT
%post
-%{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf; then
- echo "Include /etc/httpd/mod_%{mod_name}.conf" >> /etc/httpd/httpd.conf
-fi
-if [ -f /var/lock/subsys/httpd ]; then
- /etc/rc.d/init.d/httpd restart 1>&2
-fi
+%service -q httpd restart
-%preun
+%postun
if [ "$1" = "0" ]; then
- %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
- umask 027
- grep -v "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf > \
- /etc/httpd/httpd.conf.tmp
- mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
- if [ -f /var/lock/subsys/httpd ]; then
- /etc/rc.d/init.d/httpd restart 1>&2
- fi
+ %service -q httpd restart
fi
%files
%defattr(644,root,root,755)
%doc CHANGES INSTALL LICENSE README
-%attr(755,root,root) %{_libdir}/apache/mod_roaming.so
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*_mod_%{mod_name}.conf
+%attr(755,root,root) %{_pkglibdir}/*.so
%attr(660,root,http) %dir %{_var}/lib/mod_roaming
-%config(noreplace) %{_sysconfdir}/httpd/mod_roaming.conf