]> git.pld-linux.org Git - packages/apache1-mod_accounting.git/blobdiff - apache1-mod_accounting.spec
- sed -e "s/%{_sbindir}\/apxs -e/\%{apxs} -e/"
[packages/apache1-mod_accounting.git] / apache1-mod_accounting.spec
index 9d1ef0c2de04afb8e12f49c6c4708b0125367f3c..a21fdf5c2e213dcd4b10444622ecf9146ec0ac81 100644 (file)
@@ -1,75 +1,74 @@
 %define                mod_name        accounting
-%define        apxs            /usr/sbin/apxs
-Summary:       Apache module: records traffic statistics into a database 
-Summary(pl):   Modu³ do apache: zapisuje statystyki ruchu do relacyjnej bazy danych
+%define        apxs            %{_sbindir}/apxs
+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
-License:       GPL
+Release:       3
+License:       BSD
 Group:         Networking/Daemons
-Group(cs):     Sí»ové/Démoni
-Group(da):     Netværks/Dæmoner
-Group(de):     Netzwerkwesen/Server
-Group(es):     Red/Servidores
-Group(fr):     Réseau/Serveurs
-Group(is):     Net/Púkar
-Group(it):     Rete/Demoni
-Group(no):     Nettverks/Daemoner
-Group(pl):     Sieciowe/Serwery
-Group(pt):     Rede/Servidores
-Group(ru):     óÅÔØ/äÅÍÏÎÙ
-Group(sl):     Omre¾ni/Stre¾niki
-Group(sv):     Nätverk/Demoner
-Group(uk):     íÅÒÅÖÁ/äÅÍÏÎÉ
-Source0:       http://prdownloads.sourceforge.net/mod-acct/mod_%{mod_name}-%{version}.tar.gz
+Source0:       http://prdownloads.sourceforge.net/mod-acct/mod_accounting-%{version}.tar.gz
+Source1:       %{name}.conf
 URL:           http://sourceforge.net/projects/mod-acct/
-BuildRequires: %{apxs}
-BuildRequires: apache-devel
-BuildRequires: zlib-devel
+BuildRequires: apache(EAPI)-devel
+BuildRequires: mysql-devel
+BuildRequires: postgresql-devel
 Prereq:                %{_sbindir}/apxs
-Requires:      apache
+Requires:      apache(EAPI)
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _pkglibdir      %(%{apxs} -q LIBEXECDIR)
+%define         _sysconfdir     /etc/httpd
 
 %description
-mod_accounting is a simple Apache module that can record traffic statistics
-into a database (bytes in/out per http request).
+mod_accounting is a simple Apache module that can record traffic
+statistics into a database (bytes in/out per http request)
 
 %description -l pl
-mod_accounting jest prostym modu³em Apacza, s³u¿±cym do zapisywania statystyk
-ruchu do relacyjnej bazy danych (ilo¶æ bajtów wchodz±cych/wychodz±cych na
-¿adanie http)
+mod_accounting to prosty modu³ Apache pozwalaj±cy na zapisywanie
+informacji o ruchu http do bazy danych (bajty
+przychodz±ce/wychodz±ce).
 
-%prep 
+%prep
 %setup -q -n mod_%{mod_name}-%{version}
 
 %build
-%{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so -lz
+PATH=$PATH:%{_sbindir}
+%{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_pkglibdir}
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
 
 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_accounting.conf
 
-%clean
-rm -rf $RPM_BUILD_ROOT
+gzip -9nf README ChangeLog
 
 %post
-%{_sbindir}/apxs -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
+%{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
 
 %preun
 if [ "$1" = "0" ]; then
-       %{_sbindir}/apxs -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
+       %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
+        grep -v "^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
 fi
 
+%clean
+rm -rf $RPM_BUILD_ROOT
+
 %files
 %defattr(644,root,root,755)
+%doc *.gz
 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.058669 seconds and 4 git commands to generate.