packages: apache/apache.logrotate, apache/apache.spec, apache/apache.syscon...

wiget wiget at pld-linux.org
Wed Feb 1 17:04:44 CET 2012


Author: wiget                        Date: Wed Feb  1 16:04:44 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- systemd support
- rel. 2

---- Files affected:
packages/apache:
   apache.logrotate (1.15 -> 1.16) , apache.spec (1.639 -> 1.640) , apache.sysconfig (1.17 -> 1.18) , apache.service (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/apache/apache.logrotate
diff -u packages/apache/apache.logrotate:1.15 packages/apache/apache.logrotate:1.16
--- packages/apache/apache.logrotate:1.15	Mon Apr  2 18:41:07 2007
+++ packages/apache/apache.logrotate	Wed Feb  1 17:04:39 2012
@@ -9,6 +9,10 @@
     olddir /var/log/archive/httpd
     sharedscripts
     postrotate
+	if /bin/systemd_booted; then
+		/bin/systemctl reload httpd.service
+	else
 		/sbin/service httpd flush-logs > /dev/null
+	fi
     endscript
 }

================================================================
Index: packages/apache/apache.spec
diff -u packages/apache/apache.spec:1.639 packages/apache/apache.spec:1.640
--- packages/apache/apache.spec:1.639	Tue Jan 31 22:24:43 2012
+++ packages/apache/apache.spec	Wed Feb  1 17:04:39 2012
@@ -45,7 +45,7 @@
 Summary(tr.UTF-8):	Lider WWW tarayıcı
 Name:		apache
 Version:	2.2.22
-Release:	1
+Release:	2
 License:	Apache v2.0
 Group:		Networking/Daemons/HTTP
 Source0:	http://www.apache.org/dist/httpd/httpd-%{version}.tar.gz
@@ -80,6 +80,7 @@
 Source28:	%{name}-mod_cache.conf
 Source29:	%{name}-example.net.conf
 Source30:	%{name}.tmpfiles
+Source31:	%{name}.service
 Patch0:		%{name}-configdir_skip_backups.patch
 Patch1:		%{name}-layout.patch
 Patch2:		%{name}-suexec.patch
@@ -120,7 +121,7 @@
 BuildRequires:	rpm >= 4.4.9-56
 BuildRequires:	rpm-build >= 4.4.0
 BuildRequires:	rpm-perlprov >= 4.1-13
-BuildRequires:	rpmbuild(macros) >= 1.268
+BuildRequires:	rpmbuild(macros) >= 1.639
 BuildRequires:	sed >= 4.0
 BuildRequires:	zlib-devel
 Requires:	%{name}-errordocs = %{version}-%{release}
@@ -144,6 +145,19 @@
 %define		_libexecdir	%{_libdir}/apache
 %define		_cgibindir	%{_prefix}/lib/cgi-bin/%{name}
 
+%define		httpd_restart \
+	if /bin/systemd_booted; then \
+		/bin/systemctl restart httpd.service \
+	else \
+		%service -q httpd restart \
+	fi
+%define		httpd_reload \
+	if /bin/systemd_booted; then \
+		/bin/systemctl reload httpd.service \
+	else \
+		%service -q httpd reload \
+	fi
+
 %description
 Apache is a powerful, full-featured, efficient and freely-available
 Web server. Apache is also the most popular Web server on the
@@ -201,6 +215,8 @@
 Requires:	apr >= %{apr_ver}
 Requires:	psmisc >= 20.1
 Requires:	rc-scripts >= 0.4.1.23
+Requires:	sed >= 4.0
+Requires:	systemd-units
 Provides:	apache(modules-api) = %{_apache_modules_api}
 Provides:	group(http)
 Provides:	user(http)
@@ -1920,22 +1936,29 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig} \
+install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,systemd/system} \
 	$RPM_BUILD_ROOT%{_var}/{log/{httpd,archive/httpd},{run,cache}/httpd,lock/mod_dav} \
 	$RPM_BUILD_ROOT%{_sysconfdir}/{webapps.d,conf.d,vhosts.d} \
 	$RPM_BUILD_ROOT%{_datadir}/{cgi-bin,vhosts} \
-	$RPM_BUILD_ROOT/usr/lib/tmpfiles.d
+	$RPM_BUILD_ROOT/usr/lib/tmpfiles.d \
+	$RPM_BUILD_ROOT%{systemdunitdir}
 
 # prefork is default one
 %{__make} -C buildmpm-prefork install \
 	DESTDIR=$RPM_BUILD_ROOT
+mpm=prefork
+sed -e "s|@EXEC@|%{_sbindir}/httpd.${mpm}|g;s|@NAME@|${mpm}|g" < %{SOURCE31} \
+	> $RPM_BUILD_ROOT%{systemdunitdir}/httpd-${mpm}.service
 
 # install other mpm-s
 for mpm in worker %{?with_event:event} %{?with_itk:itk}; do
 	install buildmpm-${mpm}/httpd.${mpm} $RPM_BUILD_ROOT%{_sbindir}/httpd.${mpm}
+	sed -e "s|@EXEC@|%{_sbindir}/httpd.${mpm}|g;s|@NAME@|${mpm}|g" < %{SOURCE31} \
+		> $RPM_BUILD_ROOT%{systemdunitdir}/httpd-${mpm}.service
 done
 
 ln -s httpd.prefork $RPM_BUILD_ROOT%{_sbindir}/httpd
+ln -s %{systemdunitdir}/httpd-prefork.service $RPM_BUILD_ROOT/etc/systemd/system/httpd.service
 ln -s %{_libexecdir} $RPM_BUILD_ROOT%{_sysconfdir}/modules
 ln -s %{_localstatedir}/run/httpd $RPM_BUILD_ROOT%{_sysconfdir}/run
 ln -s %{_var}/log/httpd $RPM_BUILD_ROOT%{_sysconfdir}/logs
@@ -2101,18 +2124,21 @@
 /sbin/chkconfig --add httpd
 umask 137
 touch /var/log/httpd/{access,error,agent,referer}_log
+%systemd_post httpd.service
 
 %preun base
 if [ "$1" = "0" ]; then
 	%service httpd stop
 	/sbin/chkconfig --del httpd
 fi
+%systemd_preun httpd.service
 
 %postun base
 if [ "$1" = "0" ]; then
 	%userremove http
 	%groupremove http
 fi
+%systemd_reload
 
 %triggerpostun base -- %{name} < 2.0.50-6.9
 %banner %{name}-2.0.50-6 << EOF
@@ -2200,6 +2226,13 @@
 
 EOF
 
+%triggerpostun base -- %{name} < 2.2.22-2
+. /etc/sysconfig/httpd
+if [ -z "$HTTPD_CONF" ]; then
+	echo 'HTTPD_CONF="/etc/httpd/apache.conf"' >> /etc/sysconfig/httpd
+fi
+%systemd_trigger httpd.service
+
 %triggerpostun mod_ssl -- %{name}-mod_ssl < 1:2.2.0-3.1
 cp -f /etc/httpd/conf.d/40_mod_ssl.conf{,.rpmsave}
 sed -i -e '
@@ -2221,18 +2254,18 @@
 # main package are very important for all this to work.
 
 # restart webserver at the end of transaction
-%service httpd restart
+%httpd_restart
 
 # macro called at module post scriptlet
 %define	module_post \
 if [ "$1" = "1" ]; then \
-	%service -q httpd restart \
+	%httpd_restart \
 fi
 
 # macro called at module postun scriptlet
 %define	module_postun \
 if [ "$1" = "0" ]; then \
-	%service -q httpd restart \
+	%httpd_restart \
 fi
 
 # it's sooo annoying to write them
@@ -2311,22 +2344,22 @@
 
 %post cgi_test
 if [ "$1" = "1" ]; then
-	%service -q httpd reload
+	%httpd_reload
 fi
 
 %postun cgi_test
 if [ "$1" = "0" ]; then
-	%service -q httpd reload
+	%httpd_reload
 fi
 
 %post errordocs
 if [ "$1" = "1" ]; then
-	%service -q httpd reload
+	%httpd_reload
 fi
 
 %postun errordocs
 if [ "$1" = "0" ]; then
-	%service -q httpd reload
+	%httpd_reload
 fi
 
 %files
@@ -2363,6 +2396,8 @@
 %dir %attr(770,root,http) /var/cache/httpd
 
 /usr/lib/tmpfiles.d/%{name}.conf
+%{systemdunitdir}/*.service
+%config(noreplace) %verify(not md5 mtime size) /etc/systemd/system/httpd.service
 
 %{_mandir}/man8/httpd.8*
 
@@ -2788,6 +2823,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.640  2012/02/01 16:04:39  wiget
+- systemd support
+- rel. 2
+
 Revision 1.639  2012/01/31 21:24:43  arekm
 - up to 2.2.22; fixes CVE-2011-3368, CVE-2011-3607, CVE-2011-4317, CVE-2012-0021, CVE-2012-0031, CVE-2012-0053
 

================================================================
Index: packages/apache/apache.sysconfig
diff -u packages/apache/apache.sysconfig:1.17 packages/apache/apache.sysconfig:1.18
--- packages/apache/apache.sysconfig:1.17	Thu Aug  4 00:08:10 2011
+++ packages/apache/apache.sysconfig	Wed Feb  1 17:04:39 2012
@@ -4,8 +4,8 @@
 # Nice level for apache
 SERVICE_RUN_NICE_LEVEL="+5"
 
-# config dir/file path. default is compiled in path
-#HTTPD_CONF="/etc/httpd/apache.conf"
+# config dir/file path.
+HTTPD_CONF="/etc/httpd/apache.conf"
 
 # other command-line options
 # -T avoid doing many unneded DocumentRoot checks

================================================================
Index: packages/apache/apache.service
diff -u /dev/null packages/apache/apache.service:1.1
--- /dev/null	Wed Feb  1 17:04:44 2012
+++ packages/apache/apache.service	Wed Feb  1 17:04:39 2012
@@ -0,0 +1,18 @@
+[Unit]
+Description=The Apache HTTP Server (@NAME@ MPM)
+After=syslog.target network.target remote-fs.target nss-lookup.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/httpd.pid
+EnvironmentFile=/etc/sysconfig/httpd
+ExecStartPre=/bin/sh -c '/usr/bin/test -f "${HTTPD_CONF}" -o -d "${HTTPD_CONF}" || (echo "${HTTPD_CONF} is not file or directory"; exit 1)'
+ExecStartPre=@EXEC@ -f ${HTTPD_CONF} $HTTPD_OPTS -t
+ExecStart=@EXEC@ -f ${HTTPD_CONF} $HTTPD_OPTS -k start
+ExecReload=@EXEC@ -f ${HTTPD_CONF} $HTTPD_OPTS -t
+ExecReload=@EXEC@ -f ${HTTPD_CONF} $HTTPD_OPTS -k graceful
+ExecStop=@EXEC@ -f ${HTTPD_CONF} $HTTPD_OPTS -k stop
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/apache/apache.logrotate?r1=1.15&r2=1.16&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/apache/apache.spec?r1=1.639&r2=1.640&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/apache/apache.sysconfig?r1=1.17&r2=1.18&f=u



More information about the pld-cvs-commit mailing list