]> git.pld-linux.org Git - packages/apache1.git/commitdiff
- minimize apache restarts using %posttrans
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 16 Aug 2005 09:34:36 +0000 (09:34 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- cleanups

Changed files:
    apache1.spec -> 1.106

apache1.spec

index e38c035891ee7767bc6eac6aef06e7c3078abb24..ed44baae51c5f010c10c714c57e1b489b1c09522 100644 (file)
@@ -1,5 +1,5 @@
 # TODO
-# - documentroot and cgi-dir out of /home/services
+# - move DocumentRoot and cgi-dir out of /home/services
 #
 # Conditional build:
 %bcond_with    rewrite_ldap    # enable ldap map support for mod_rewrite (alpha)
@@ -30,7 +30,7 @@ Summary(uk):  
 Summary(zh_CN):        Internet ÉÏÓ¦ÓÃ×î¹ã·ºµÄ Web ·þÎñ³ÌÐò¡£
 Name:          apache1
 Version:       1.3.33
-Release:       7
+Release:       7.9
 License:       Apache Group
 Group:         Networking/Daemons
 Source0:       http://www.apache.org/dist/httpd/apache_%{version}.tar.gz
@@ -88,6 +88,7 @@ BuildRequires:        db-devel >= 4.1
 BuildRequires: mm-devel >= 1.3.0
 %{?with_rewrite_ldap:BuildRequires:    openldap-devel}
 BuildRequires: rpmbuild(macros) >= 1.228
+BuildRequires: rpm-build >= 4.4.0
 BuildRequires: rpm-perlprov
 PreReq:                mm
 PreReq:                perl-base
@@ -125,6 +126,8 @@ Provides:   apache = %{version}-%{release}
 Obsoletes:     apache < 2.0.0
 Obsoletes:     apache-extra
 Obsoletes:     apache6
+# for the posttrans scriptlet, conflicts because in vserver environment rpm package is not installed.
+Conflicts:     rpm < 4.4.2-0.2
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _sysconfdir     /etc/apache
@@ -1402,7 +1405,6 @@ rm -rf $RPM_BUILD_ROOT
 %groupadd -g 51 -r -f http
 %useradd -u 51 -r -d %{httpdir} -s /bin/false -c "HTTP User" -g http http
 
-# this should be in trigger instead...
 if [ "`getent passwd http | cut -d: -f6`" = "/home/httpd" ]; then
        /usr/sbin/usermod -d %{httpdir} http
 fi
@@ -1411,7 +1413,6 @@ fi
 /sbin/chkconfig --add apache
 umask 137
 touch /var/log/apache/{access,error,agent,referer}_log
-%service apache restart
 
 %preun
 if [ "$1" = "0" ]; then
@@ -1483,336 +1484,289 @@ if [ -f /etc/sysconfig/apache1.rpmsave ]; then
        mv -f /etc/sysconfig/apache{1.rpmsave,}
 fi
 
+%triggerpostun mod_auth_db -- apache-mod_auth_db <= 1.3.20-2
+%{apxs} -e -A -n auth_dbm %{_libexecdir}/mod_auth_dbm.so 1>&2
+
+%triggerpostun mod_autoindex -- apache1-mod_autoindex < 1.3.33-1.85
+%{apxs} -e -A -n autoindex %{_libexecdir}/mod_autoindex.so 1>&2
+sed -i -e '
+       s,^Include.*mod_autoindex.conf,Include %{_sysconfdir}/conf.d/*_mod_autoindex.conf,
+' /etc/apache/apache.conf
+
+%triggerpostun mod_proxy -- apache1-mod_proxy < 1.3.33-1.85
+%{apxs} -e -A -n proxy %{_libexecdir}/libproxy.so 1>&2
+sed -i -e '
+       s,^Include.*mod_proxy.conf,Include %{_sysconfdir}/conf.d/*_mod_proxy.conf,
+' /etc/apache/apache.conf
+
+%triggerpostun mod_status -- apache1-mod_status < 1.3.33-1.85
+%{apxs} -e -A -n status %{_libexecdir}/mod_status.so 1>&2
+sed -i -e '
+       s,^Include.*mod_status.conf,Include %{_sysconfdir}/conf.d/*_mod_status.conf,
+' /etc/apache/apache.conf
+
+%triggerpostun mod_vhost_alias -- apache1-mod_vhost_alias < 1.3.33-1.85
+%{apxs} -e -A -n vhost_alias %{_libexecdir}/mod_vhost_alias.so 1>&2
+sed -i -e '
+       s,^Include.*mod_vhost_alias.conf,Include %{_sysconfdir}/conf.d/*_mod_vhost_alias.conf,
+' /etc/apache/apache.conf
+
+%posttrans
+# minimizing apache restarts logics. we restart webserver:
+#
+# 1. at the end of transaction. (posttrans, feature from rpm 4.4.2)
+# 2. first install of module (post: $1 = 1)
+# 2. uninstall of module (postun: $1 == 0)
+#
+# the strict internal deps between apache modules and
+# main package are very important for all this to work.
+
+# restart webserver at the end of transaction
+%service -q apache restart
+
+# macro called at module post scriptlet
+%define        module_post \
+if [ "$1" = "1" ]; then \
+       %service -q apache restart \
+fi
+
+# macro called at module postun scriptlet
+%define        module_postun \
+if [ "$1" = "0" ]; then \
+       %service -q apache restart \
+fi
+
 %post errordocs
-%service apache restart
+if [ "$1" = "1" ]; then
+       %service -q apache reload
+fi
 
 %postun errordocs
 if [ "$1" = "0" ]; then
-       %service -q apache restart
+       %service -q apache reload
 fi
 
 %post mod_access
-%service apache restart
+%module_post
 
 %postun mod_access
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_actions
-%service apache restart
+%module_post
 
 %postun mod_actions
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_alias
-%service apache restart
+%module_post
 
 %postun mod_alias
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_asis
-%service apache restart
+%module_post
 
 %postun mod_asis
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_auth
-%service apache restart
+%module_post
 
 %postun mod_auth
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_auth_anon
-%service apache restart
+%module_post
 
 %postun mod_auth_anon
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_auth_db
-%service apache restart
+%module_post
 
 %postun mod_auth_db
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
-
-%triggerpostun mod_auth_db -- apache-mod_auth_db <= 1.3.20-2
-%{apxs} -e -A -n auth_dbm %{_libexecdir}/mod_auth_dbm.so 1>&2
+%module_postun
 
 %post mod_auth_digest
-%service apache restart
+%module_post
 
 %postun mod_auth_digest
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_autoindex
-%service apache restart
+%module_post
 
 %postun mod_autoindex
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
-
-%triggerpostun mod_autoindex -- apache1-mod_autoindex < 1.3.33-1.85
-%{apxs} -e -A -n autoindex %{_libexecdir}/mod_autoindex.so 1>&2
-sed -i -e '
-       s,^Include.*mod_autoindex.conf,Include %{_sysconfdir}/conf.d/*_mod_autoindex.conf,
-' /etc/apache/apache.conf
+%module_postun
 
 %post mod_cern_meta
-%service apache restart
+%module_post
 
 %postun mod_cern_meta
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_cgi
-%service apache restart
+%module_post
 
 %postun mod_cgi
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_define
-%service apache restart
+%module_post
 
 %postun mod_define
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_digest
-%service apache restart
+%module_post
 
 %postun mod_digest
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_dir
-%service apache restart
+%module_post
 
 %postun mod_dir
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_env
-%service apache restart
+%module_post
 
 %postun mod_env
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_expires
-%service apache restart
+%module_post
 
 %postun mod_expires
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_headers
-%service apache restart
+%module_post
 
 %postun mod_headers
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_imap
-%service apache restart
+%module_post
 
 %postun mod_imap
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_include
-%service apache restart
+%module_post
 
 %postun mod_include
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_info
-%service apache restart
+%module_post
 
 %postun mod_info
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_log_agent
-%service apache restart
+%module_post
 
 %postun mod_log_agent
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_log_config
-%service apache restart
+%module_post
 
 %postun mod_log_config
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_log_forensic
-%service apache restart
+%module_post
 
 %postun mod_log_forensic
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_log_referer
-%service apache restart
+%module_post
 
 %postun mod_log_referer
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_mime
-%service apache restart
+%module_post
 
 %postun mod_mime
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_mime_magic
-%service apache restart
+%module_post
 
 %postun mod_mime_magic
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_mmap_static
-%service apache restart
+%module_post
 
 %postun mod_mmap_static
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_negotiation
-%service apache restart
+%module_post
 
 %postun mod_negotiation
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_proxy
-%service apache restart
+%module_post
 
 %postun mod_proxy
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
-
-%triggerpostun mod_proxy -- apache1-mod_proxy < 1.3.33-1.85
-%{apxs} -e -A -n proxy %{_libexecdir}/libproxy.so 1>&2
-sed -i -e '
-       s,^Include.*mod_proxy.conf,Include %{_sysconfdir}/conf.d/*_mod_proxy.conf,
-' /etc/apache/apache.conf
+%module_postun
 
 %post mod_rewrite
-%service apache restart
+%module_post
 
 %postun mod_rewrite
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_setenvif
-%service apache restart
+%module_post
 
 %postun mod_setenvif
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_speling
-%service apache restart
+%module_post
 
 %postun mod_speling
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_status
-%service apache restart
+%module_post
 
 %postun mod_status
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
-
-%triggerpostun mod_status -- apache1-mod_status < 1.3.33-1.85
-%{apxs} -e -A -n status %{_libexecdir}/mod_status.so 1>&2
-sed -i -e '
-       s,^Include.*mod_status.conf,Include %{_sysconfdir}/conf.d/*_mod_status.conf,
-' /etc/apache/apache.conf
+%module_postun
 
 %post mod_unique_id
-%service apache restart
+%module_post
 
 %postun mod_unique_id
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_userdir
-%service apache restart
+%module_post
 
 %postun mod_userdir
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_usertrack
-%service apache restart
+%module_post
 
 %postun mod_usertrack
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
+%module_postun
 
 %post mod_vhost_alias
-%service apache restart
+%module_post
 
 %postun mod_vhost_alias
-if [ "$1" = "0" ]; then
-       %service -q apache restart
-fi
-
-%triggerpostun mod_vhost_alias -- apache1-mod_vhost_alias < 1.3.33-1.85
-%{apxs} -e -A -n vhost_alias %{_libexecdir}/mod_vhost_alias.so 1>&2
-sed -i -e '
-       s,^Include.*mod_vhost_alias.conf,Include %{_sysconfdir}/conf.d/*_mod_vhost_alias.conf,
-' /etc/apache/apache.conf
+%module_postun
 
 %files
 %defattr(644,root,root,755)
This page took 0.06411 seconds and 4 git commands to generate.