]> git.pld-linux.org Git - packages/apache.git/commitdiff
- use macros in %{pre,post}{,un}
authorsaq <saq@pld-linux.org>
Wed, 25 Jul 2001 16:30:40 +0000 (16:30 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- need rebuilt rpm (with new macros.pld) to build these

Changed files:
    apache.spec -> 1.166

apache.spec

index 5a7963aa0190265edc5d88a437173cb9beff87ce..1a5a6f0f4261fb1624aac6d77b875ee0fed68cfb 100644 (file)
@@ -580,25 +580,10 @@ ln -sf index.html.en $RPM_BUILD_ROOT%{_datadir}/html/index.html
 gzip -9nf ABOUT_APACHE src/CHANGES KEYS README
 
 %pre
-if [ -n "`getgid http`" ]; then
-       if [ "`getgid http`" != "51" ]; then
-               echo "Warning: group http haven't gid=51. Correct this before installing apache" 1>&2
-               exit 1
-       fi
-else
-       /usr/sbin/groupadd -g 51 -r -f http
-fi
-if [ -n "`id -u http 2>/dev/null`" ]; then
-       if [ "`id -u http`" != "51" ]; then
-               echo "Warning: user http haven't uid=51. Correct this before installing apache" 1>&2
-               exit 1
-       fi
-else
-       /usr/sbin/useradd -u 51 -r -d /home/httpd -s /bin/false -c "HTTP User" -g http http 1>&2
-fi
+GROUP=http; GID=51; %groupadd
+USER=http; UID=51; HOMEDIR=/home/httpd; COMMENT="HTTP User"; %useradd
 
 %post
-/sbin/chkconfig --add httpd
 %{_sbindir}/apxs -e -a -n access %{_libexecdir}/mod_access.so 1>&2
 %{_sbindir}/apxs -e -a -n alias %{_libexecdir}/mod_alias.so 1>&2
 %{_sbindir}/apxs -e -a -n asis %{_libexecdir}/mod_asis.so 1>&2
@@ -618,11 +603,7 @@ fi
 %{_sbindir}/apxs -e -a -n userdir %{_libexecdir}/mod_userdir.so 1>&2
 umask 137
 touch /var/log/httpd/{access,error,agent,referer}_log
-if [ -f /var/lock/subsys/httpd ]; then
-       /etc/rc.d/init.d/httpd restart 1>&2
-else
-       echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon."
-fi
+NAME=httpd; DESC="apache http daemon"; %chkconfig_post
 
 %preun
 if [ "$1" = "0" ]; then
@@ -643,17 +624,12 @@ if [ "$1" = "0" ]; then
        %{_sbindir}/apxs -e -A -n setenvif %{_libexecdir}/mod_setenvif.so 1>&2
        %{_sbindir}/apxs -e -A -n speling %{_libexecdir}/mod_speling.so 1>&2
        %{_sbindir}/apxs -e -A -n userdir %{_libexecdir}/mod_userdir.so 1>&2
-       if [ -f /var/lock/subsys/httpd ]; then
-               /etc/rc.d/init.d/httpd stop 1>&2
-       fi
-       /sbin/chkconfig --del httpd
 fi
+NAME=httpd; %chkconfig_preun
 
 %postun
-if [ "$1" = "0" ]; then
-       /usr/sbin/userdel http
-       /usr/sbin/groupdel http
-fi
+USER=http; %userdel
+GROUP=http; %groupdel
 
 %post mod_actions
 %{_sbindir}/apxs -e -a -n actions %{_libexecdir}/mod_actions.so 1>&2
This page took 0.028817 seconds and 4 git commands to generate.