SPECS: cvsweb.spec - apache config moved to SOURCES - add patch to...

glen glen at pld-linux.org
Tue Jan 10 00:33:11 CET 2006


Author: glen                         Date: Mon Jan  9 23:33:11 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- apache config moved to SOURCES
- add patch to allow cvsweb.cgi being used as handler for whole vhost
- use webapps framework

---- Files affected:
SPECS:
   cvsweb.spec (1.32 -> 1.33) 

---- Diffs:

================================================================
Index: SPECS/cvsweb.spec
diff -u SPECS/cvsweb.spec:1.32 SPECS/cvsweb.spec:1.33
--- SPECS/cvsweb.spec:1.32	Mon Jan  9 23:00:54 2006
+++ SPECS/cvsweb.spec	Tue Jan 10 00:33:05 2006
@@ -4,27 +4,29 @@
 Summary(pl):	Wizualny (WWW) interfejs do przeglądania repozytorium CVS
 Name:		cvsweb
 Version:	3.0.6
-Release:	0.1
+Release:	0.4
 Epoch:		1
 License:	BSD
 Group:		Development/Tools
 Source0:	http://people.FreeBSD.org/~scop/cvsweb/%{name}-%{version}.tar.gz
 # Source0-md5:	0e1eec962b1db00e01b295fff84b6e89
+Source1:	%{name}-apache.conf
 URL:		http://www.freebsd.org/projects/cvsweb.html
 Patch0:		%{name}-config.patch
-BuildRequires:	rpmbuild(macros) >= 1.223
+Patch1:		%{name}-emptyscript.patch
+BuildRequires:	rpmbuild(macros) >= 1.268
 # for %{_libdir}/cgi-bin
 Requires:	FHS >= 2.3-8
 Requires:	rcs
 # for /etc/mime.types
 Requires:	mailcap
-Requires:	webserver
-# because of wrong module load order
-Conflicts:	apache1 < 1.3.33-6.3
+Requires:	webapps
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_sysconfdir	/etc/%{name}
+%define		_webapps	/etc/webapps
+%define		_webapp		%{name}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
 %define		_appdir		%{_datadir}/%{name}
 
 %description
@@ -51,6 +53,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 install cvsweb.conf* samples
 
@@ -69,33 +72,8 @@
 
 install %{name}.conf	$RPM_BUILD_ROOT%{_sysconfdir}
 echo '# vim:syn=perl' >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
-
-cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
-Alias /%{name}/css/ %{_appdir}/css/
-Alias /%{name}/enscript/ %{_appdir}/enscript/
-Alias /%{name}/icons/ %{_appdir}/icons/
-ScriptAlias /cgi-bin/%{name}.cgi %{_appdir}/%{name}.cgi
-
-<Location /cgi-bin/%{name}.cgi>
-	# See also $charset in cvsweb.conf.
-	#AddDefaultCharset UTF-8
-
-	# mod_perl >= 1.99:
-	<IfModule mod_perl.c>
-		SetHandler perl-script
-		PerlResponseHandler ModPerl::Registry
-		PerlOptions +ParseHeaders
-		Options ExecCGI
-	</IfModule>
-
-	Allow from all
-</Location>
-<Location /%{name}/>
-	Allow from all
-</Location>
-
-# vim: filetype=apache ts=4 sw=4
-EOF
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
 
 %post
 if [ "$1" = 1 ]; then
@@ -107,49 +85,54 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-# 79_ instead of 99_ because
-# - ScriptAlias /cgi-bin/ is in 80_mod_alias.conf
-# - SSL is in 40_mod_ssl.conf
-# - mod_auth 51_mod_ssl.conf
-# - mod_rewrite is 70
-# - TODO: fix apache.spec to have ScriptAlias in 80
-%triggerin -- apache1 >= 1.3.33-2
-%apache_config_install -v 1 -c %{_sysconfdir}/apache.conf -n 79
-
-%triggerun -- apache1 >= 1.3.33-2
-%apache_config_uninstall -v 1 -n 79
-
-%triggerin -- apache >= 2.0.0
-%apache_config_install -v 2 -c %{_sysconfdir}/apache.conf -n 09
-
-%triggerun -- apache >= 2.0.0
-%apache_config_uninstall -v 2 -n 09
+%triggerpostun -- %{name} < 1:3.0.6-0.2
+# rescue app config
+if [ -f /etc/%{name}/cvsweb.conf.rpmsave ]; then
+	mv -f %{_sysconfdir}/cvsweb.conf{,.rpmnew}
+	mv -f /etc/%{name}/cvsweb.conf.rpmsave %{_sysconfdir}/cvsweb.conf
+fi
 
-%triggerpostun -- %{name} < 1:3.0.5-0.20
 # migrate from old config location (only apache2, as there was no apache1 support)
 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
-	cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
-	mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/apache.conf
-	if [ -f /var/lock/subsys/httpd ]; then
-		/etc/rc.d/init.d/httpd restart 1>&2
-	fi
+	cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+	mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
+	httpd_reload=1
 fi
 
-# place new config location, as trigger puts config only on first install, do it here.
-# apache1
-if [ -d /etc/apache/conf.d ]; then
-	rm -f /etc/apache/conf.d/09_%{name}.conf # old slot
-	ln -sf %{_sysconfdir}/apache.conf /etc/apache/conf.d/79_%{name}.conf
-	if [ -f /var/lock/subsys/apache ]; then
-		/etc/rc.d/init.d/apache restart 1>&2
+# migrate from apache-config macros
+if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
+	if [ -d /etc/apache/webapps.d ]; then
+		cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
+		cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/apache.conf
 	fi
-fi
-# apache2
-if [ -d /etc/httpd/httpd.conf ]; then
-	ln -sf %{_sysconfdir}/apache.conf /etc/httpd/httpd.conf/09_%{name}.conf
-	if [ -f /var/lock/subsys/httpd ]; then
-		/etc/rc.d/init.d/httpd restart 1>&2
+
+	if [ -d /etc/httpd/webapps.d ]; then
+		cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+		cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
 	fi
+	rm -f /etc/%{name}/apache.conf.rpmsave
+fi
+
+if [ -L /etc/apache/conf.d/09_%{name}.conf ]; then
+	rm -f /etc/apache/conf.d/09_%{name}.conf
+	apache_reload=1
+fi
+if [ -L /etc/apache/conf.d/79_%{name}.conf ]; then
+	rm -f /etc/apache/conf.d/79_%{name}.conf
+	apache_reload=1
+fi
+if [ -L /etc/httpd/httpd.conf/09_%{name}.conf ]; then
+	rm -f /etc/httpd/httpd.conf/09_%{name}.conf
+	httpd_reload=1
+fi
+
+if [ "$apache_reload" ]; then
+	/usr/sbin/webapp register apache %{_webapp}
+	%service -q apache reload
+fi
+if [ "$httpd_reload" ]; then
+	/usr/sbin/webapp register httpd %{_webapp}
+	%service -q httpd reload
 fi
 
 %files
@@ -158,6 +141,7 @@
 %dir %attr(750,root,http) %{_sysconfdir}
 %config(noreplace) %verify(not md5 mtime size) %attr(640,root,http) %{_sysconfdir}/%{name}.conf
 %config(noreplace) %verify(not md5 mtime size) %attr(640,root,root) %{_sysconfdir}/apache.conf
+%config(noreplace) %verify(not md5 mtime size) %attr(640,root,root) %{_sysconfdir}/httpd.conf
 %dir %{_appdir}
 %{_appdir}/css
 %{_appdir}/enscript
@@ -170,6 +154,11 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.33  2006/01/09 23:33:05  glen
+- apache config moved to SOURCES
+- add patch to allow cvsweb.cgi being used as handler for whole vhost
+- use webapps framework
+
 Revision 1.32  2006/01/09 22:00:54  glen
 - 3.0.6
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/cvsweb.spec?r1=1.32&r2=1.33&f=u



More information about the pld-cvs-commit mailing list