SPECS: acid.spec - use webapps framework instead of obsoleted conf...

glen glen at pld-linux.org
Sat Dec 3 21:53:59 CET 2005


Author: glen                         Date: Sat Dec  3 20:53:59 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use webapps framework instead of obsoleted config inline edit
- fix php epoches

---- Files affected:
SPECS:
   acid.spec (1.16 -> 1.17) 

---- Diffs:

================================================================
Index: SPECS/acid.spec
diff -u SPECS/acid.spec:1.16 SPECS/acid.spec:1.17
--- SPECS/acid.spec:1.16	Sat Dec  3 19:59:36 2005
+++ SPECS/acid.spec	Sat Dec  3 21:53:53 2005
@@ -14,13 +14,16 @@
 # 1.2 is sufficient, but -config is for location used in 3.50+
 Requires:	adodb >= 3.50
 Requires:	jpgraph >= 1.8
-Requires:	php-gd >= 4.0.4
-Requires:	php < 5.0.0
-Requires:	webserver
+Requires:	php-gd >= 3:4.0.4
+Requires:	php < 4:5.0.0
+Requires:	webapps
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		aciddir		%{_datadir}/%{name}
+%define		_appdir		%{_datadir}/%{name}
+%define		_webapps	/etc/webapps
+%define		_webapp		%{name}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
 
 %description
 ACID is a PHP-based analysis engine to search and process a database
@@ -36,57 +39,43 @@
 %setup -q -n %{name}
 %patch0 -p1
 
+find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
+
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{aciddir},%{_sysconfdir}} \
-	$RPM_BUILD_ROOT%{_sysconfdir}/httpd
+install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
+
+install acid* index.html $RPM_BUILD_ROOT%{_appdir}
+# TODO: patch source instead
+mv -f $RPM_BUILD_ROOT%{_appdir}/acid_conf.php $RPM_BUILD_ROOT%{_sysconfdir}
+ln -sf %{_sysconfdir}/acid_conf.php $RPM_BUILD_ROOT%{_appdir}/acid_conf.php
 
-install acid* index.html $RPM_BUILD_ROOT%{aciddir}
-mv -f $RPM_BUILD_ROOT%{aciddir}/acid_conf.php $RPM_BUILD_ROOT%{_sysconfdir}
-ln -sf %{_sysconfdir}/acid_conf.php $RPM_BUILD_ROOT%{aciddir}/acid_conf.php
-
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/%{name}.conf
-%{__sed} -e 's@\$PATH\$@%{_datadir}@g' $RPM_BUILD_ROOT%{_sysconfdir}/httpd/%{name}.conf > \
-	$RPM_BUILD_ROOT%{_sysconfdir}/httpd/%{name}.conf.tmp
-mv $RPM_BUILD_ROOT%{_sysconfdir}/httpd/%{name}.conf.tmp $RPM_BUILD_ROOT%{_sysconfdir}/httpd/%{name}.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
-        echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
-        if [ -f /var/lock/subsys/httpd ]; then
-                /usr/sbin/apachectl restart 1>&2
-        fi
-elif [ -d /etc/httpd/httpd.conf ]; then
-        ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
-        if [ -f /var/lock/subsys/httpd ]; then
-                /usr/sbin/apachectl restart 1>&2
-        fi
-fi
-
-%preun
-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.*%{name}.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
-fi
+%triggerin -- apache1
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache >= 2.0.0
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache >= 2.0.0
+%webapp_unregister httpd %{_webapp}
 
 %files
 %defattr(644,root,root,755)
 %doc create* CHANGELOG CREDITS README TODO
-%{aciddir}
-%config(noreplace) %verify(not md5 mtime size) /etc/httpd/%{name}.conf
-%attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/acid_conf.php
+%dir %attr(750,root,http) %{_sysconfdir}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/acid_conf.php
+%{_appdir}
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -94,6 +83,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.17  2005/12/03 20:53:53  glen
+- use webapps framework instead of obsoleted config inline edit
+- fix php epoches
+
 Revision 1.16  2005/12/03 18:59:36  czarny
 - apache conf file
 - apache install scripts
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/acid.spec?r1=1.16&r2=1.17&f=u




More information about the pld-cvs-commit mailing list