]> git.pld-linux.org Git - packages/amavis-stats.git/commitdiff
- webapps framework, rel .5 auto/ac/amavis-stats-0_1_13-0_rc6_5
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 24 Mar 2006 12:10:27 +0000 (12:10 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    amavis-stats.spec -> 1.25

amavis-stats.spec

index 17e67c361ba0ce602886933e181ab790de17a5f9..9d652a367fa4a1f1e1f11e413c7985a73c985e28 100644 (file)
@@ -4,7 +4,7 @@ Summary:        Simple amavisd-new statistics generator
 Summary(pl):   Prosty generator statystyk dla amavisd-new
 Name:          amavis-stats
 Version:       0.1.13
-Release:       0.%{_rc}.4
+Release:       0.%{_rc}.5
 License:       GPL
 Group:         Applications/System
 Source0:       http://rekudos.net/download/%{name}-%{version}-%{_rc}.tar.gz
@@ -14,12 +14,16 @@ Patch0:             %{name}-gzip.patch
 Patch1:                %{name}-more_ac.patch
 Patch2:                %{name}-Makefile.patch
 URL:           http://rekudos.net/amavis-stats/
-BuildArch:     noarch
+BuildRequires: rpmbuild(macros) >= 1.268
 Provides:      %{name}-%{version}-%{release}
+BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _pkglibdir              /var/lib/%{name}
-%define                _phpdir                 /usr/share/%{name}
+%define                _pkglibdir      /var/lib/%{name}
+%define                _webapps        /etc/webapps
+%define                _webapp         %{name}
+%define                _webappdir      %{_webapps}/%{_webapp}
+%define                _appdir         %{_datadir}/%{_webapp}
 
 %description
 amavis-stats is a simple amavis statistics generator based on rrdtool.
@@ -36,7 +40,9 @@ Summary:      PHP interface for amavis-stats
 Summary(pl):   Interfejs PHP dla amavis-stats
 Group:         Applications/System
 Requires:      %{name}-%{version}-%{release}
+Requires:      php
 Requires:      php-pcre
+Requires:      webapps
 
 %description php
 PHP interface for amavis-stats.
@@ -68,40 +74,40 @@ group=`id -g`
        web_group=$group
 
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/amavis-stats
-
-cd $RPM_BUILD_ROOT%{_datadir}/%{name}/
-ln -s amavis-stats.php index.php
-
+ln -s amavis-stats.php $RPM_BUILD_ROOT%{_datadir}/%{name}/index.php
+install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
+mv $RPM_BUILD_ROOT{/etc/amavis-stats/apache.conf,%{_webapps}/%{_webapp}/httpd.conf}
+cp $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{httpd,apache}.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post php
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*/etc/%{name}/apache.conf" /etc/httpd/httpd.conf; then
-       echo "Include /etc/%{name}/apache.conf" >> /etc/httpd/httpd.conf
-elif [ -d /etc/httpd/httpd.conf ]; then
-       ln -sf /etc/%{name}/apache.conf /etc/httpd/httpd.conf/99_%{name}.conf
-fi
-if [ -f /var/lock/subsys/httpd ]; then
-       /usr/sbin/apachectl restart 1>&2
+%triggerin php -- apache1
+%webapp_register apache %{_webapp}
+
+%triggerun php -- apache1
+%webapp_unregister apache %{_webapp}
+
+%triggerin php -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun php -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
+%triggerpostun php -- %{name}-php < 0.1.13-0.rc6.4.1
+if [ -f /etc/httpd/httpd.conf ]; then
+       sed -i -e "/^Include.*%{name}\/apache.conf/d" /etc/httpd/httpd.conf
 fi
 
-%preun php
-if [ "$1" = "0" ]; then
-       umask 027
-       if [ -d /etc/httpd/httpd.conf ]; then
-               rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-       else
-               grep -v "^Include.*/etc/%{name}/apache.conf" /etc/httpd/httpd.conf > \
-                       /etc/httpd/httpd.conf.tmp
-               mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
-       fi
-
-       if [ -f /var/lock/subsys/httpd ]; then
-               /usr/sbin/apachectl restart 1>&2
-       fi
+if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
+       cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
+       mv -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
 fi
 
+rm -f /etc/httpd/httpd.conf/99_%{name}.conf
+/usr/sbin/webapp register httpd %{_webapp}
+%service -q httpd reload
+
 %files
 %defattr(644,root,root,755)
 %doc README debian/changelog
@@ -112,10 +118,12 @@ fi
 
 %files php
 %defattr(644,root,root,755)
-%dir %{_sysconfdir}/%{name}
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/apache.conf
-%dir %{_phpdir}
-%dir %attr(755,http,root) %{_phpdir}/img
-%{_phpdir}/%{name}.php
-%{_phpdir}/index.php
-%attr(755,http,http) %dir %{_pkglibdir}/img
+%dir %attr(750,root,http) %{_webapps}/%{_webapp}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
+%dir %{_appdir}
+# symlink
+%{_appdir}/img
+%{_appdir}/%{name}.php
+%{_appdir}/index.php
+%attr(775,root,http) %dir %{_pkglibdir}/img
This page took 0.068897 seconds and 4 git commands to generate.