X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=apache1-mod_accounting.spec;h=35d45353d334009ead0345fb14a46df518b50f22;hb=fbe7f0a2c217fca6f38c8b224c2fb737d30484cf;hp=812c1e927dc15db441eb8d2305ccd78c2599a517;hpb=034d994fb2a72a5ce462d58eb6536151e1f01889;p=packages%2Fapache1-mod_accounting.git diff --git a/apache1-mod_accounting.spec b/apache1-mod_accounting.spec index 812c1e9..35d4535 100644 --- a/apache1-mod_accounting.spec +++ b/apache1-mod_accounting.spec @@ -1,74 +1,71 @@ +# TODO +# - ipv6 patch not implemented +%bcond_without ipv6 # disable IPv6 support + %define mod_name accounting -%define apxs /usr/sbin/apxs +%define apxs %{_sbindir}/apxs1 Summary: Apache module: record traffic statistics into a database Summary(pl): Modu³ do apache: zapisuje statystyki ruchu do bazy danych -Name: apache-mod_%{mod_name} -Version: 0.4 -Release: 1 +Name: apache1-mod_%{mod_name} +Version: 0.5 +Release: 0.5 License: BSD Group: Networking/Daemons -Source0: http://prdownloads.sourceforge.net/mod-acct/mod_accounting-%{version}.tar.gz +Source0: http://dl.sourceforge.net/mod-acct/mod_accounting-%{version}.tar.gz +# Source0-md5: fc045bbdc5ae32241765fea2967a63fb Source1: %{name}.conf URL: http://sourceforge.net/projects/mod-acct/ -BuildRequires: %{apxs} -BuildRequires: apache(EAPI)-devel -Prereq: %{_sbindir}/apxs -Requires: apache(EAPI) -BuildRequires: postgresql-devel +%{?with_ipv6:BuildRequires: apache1(ipv6)-devel} +BuildRequires: apache1-devel >= 1.3.33-2 BuildRequires: mysql-devel +BuildRequires: postgresql-devel +BuildRequires: rpmbuild(macros) >= 1.268 +%{!?with_ipv6:BuildConflicts: apache1(ipv6)-devel} +Requires: apache1 >= 1.3.33-2 +Obsoletes: apache-mod_accounting <= 0.5 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) -%define _pkglibdir %(%{apxs} -q LIBEXECDIR) -%define _sysconfdir /etc/httpd +%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) +%define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) %description mod_accounting is a simple Apache module that can record traffic -statistics into a database (bytes in/out per http request) +statistics into a database (bytes in/out per HTTP request) %description -l pl mod_accounting to prosty modu³ Apache pozwalaj±cy na zapisywanie -informacji o ruchu http do bazy danych (bajty +informacji o ruchu HTTP do bazy danych (bajty przychodz±ce/wychodz±ce). %prep %setup -q -n mod_%{mod_name}-%{version} %build -%{__make} +PATH=$PATH:%{_sbindir} +%{__make} \ + APXS=%{apxs} \ + LIB="-L%{_includedir}/postgresql -L%{_includedir}/mysql -lpq -lmysqlclient" %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} +install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d} install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} -install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_accounting.conf +install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf -gzip -9nf README ChangeLog +%clean +rm -rf $RPM_BUILD_ROOT %post -%{_sbindir}/apxs -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 -if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_accounting.conf" /etc/httpd/httpd.conf; then - echo "Include /etc/httpd/mod_accounting.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 apache restart -%preun +%postun if [ "$1" = "0" ]; then - %{_sbindir}/apxs -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 - grep -v -q "^Include.*mod_accounting.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 apache restart fi -%clean -rm -rf $RPM_BUILD_ROOT - %files %defattr(644,root,root,755) -%doc *.gz +%doc README ChangeLog +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf %attr(755,root,root) %{_pkglibdir}/*