SPECS: dgee.spec - separated apache1/apache modules - use %service...

glen glen at pld-linux.org
Sun Mar 5 12:01:59 CET 2006


Author: glen                         Date: Sun Mar  5 11:01:59 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- separated apache1/apache modules
- use %service, new apache packaging
- pnet related patch (compiles but not tested)

---- Files affected:
SPECS:
   dgee.spec (1.21 -> 1.22) 

---- Diffs:

================================================================
Index: SPECS/dgee.spec
diff -u SPECS/dgee.spec:1.21 SPECS/dgee.spec:1.22
--- SPECS/dgee.spec:1.21	Fri Feb  3 18:16:09 2006
+++ SPECS/dgee.spec	Sun Mar  5 12:01:53 2006
@@ -1,34 +1,39 @@
 # $Revision$, $Date$
-#
 # TODO:
-#  --without apache1 (default) should build mod_dgee.so for apache2 - it doesn't
+# - pnet incompatability, see -pnet.patch
 #
 # Conditional build:
-%bcond_with	apache1
+%bcond_without	apache1		# disable building apache 1.3.x module
+%bcond_without	apache2		# disable building apache 2.x module
 #
-%define		apxs		/usr/sbin/apxs
+%define		apxs1		/usr/sbin/apxs1
+%define		apxs2		/usr/sbin/apxs
 %define		subver		2
 %define		base_version	0.1.6
 Summary:	The DotGNU Execution Environment Core
 Summary(pl):	Podstawa środowiska wykonawczego DotGNU
 Name:		dgee
 Version:	%{base_version}_%{subver}
-Release:	2
+Release:	2.2
 License:	GPL
 Group:		Networking/Daemons
 Source0:	http://www.nfluid.com/download/src/%{name}-%{base_version}-%{subver}.tgz
 # Source0-md5:	a2573a076832c4c7212479cabda15eff
 Source1:	%{name}.init
 Source2:	%{name}.logrotate
+Source3:	%{name}-apache.conf
 Patch0:		%{name}-DESTDIR.patch
 Patch1:		%{name}-apache.patch
 Patch2:		%{name}-dglib_fix_so.patch
 Patch3:		%{name}-pythonvm.patch
 Patch4:		%{name}-pic.patch
 Patch5:		%{name}-nolibnsl.patch
+Patch6:		%{name}-pnet.patch
 URL:		http://www.dotgnu.org/dgee.html
-BuildRequires:	%{apxs}
-BuildRequires:	apache-devel
+%{?with_apache1:BuildRequires:	%{apxs1}}
+%{?with_apache2:BuildRequires:	%{apxs2}}
+%{?with_apache2:BuildRequires:	apache-devel}
+%{?with_apache1:BuildRequires:	apache1-devel}
 BuildRequires:	autoconf >= 2.13
 BuildRequires:	automake
 BuildRequires:	expat-devel
@@ -39,11 +44,11 @@
 BuildRequires:	pnet-compiler-csharp
 BuildRequires:	pnet-devel >= 0.6.0-2
 BuildRequires:	pnetlib-base
+BuildRequires:	rpmbuild(macros) >= 1.268
 Requires(post):	/sbin/ldconfig
-Requires(post,preun):	%{apxs}
 Requires(post,preun):	/sbin/chkconfig
+Requires(post,preun):	rc-scripts
 Requires:	goldwater
-Requires:	webserver = apache
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -55,6 +60,26 @@
 Execution Environment) dostarczającą funkcjonalność przyjmowania,
 sprawdzania poprawności i wykonywania żądań usług WWW.
 
+%package -n apache1-mod_dgee
+Summary:	DGEE DSO module for Apache 1.3.x
+Group:		Networking/Daemons
+Requires:	%{name} = %{version}-%{release}
+Requires:	apache1(EAPI) >= 1.3.33-2
+Requires:	apache1-mod_mime
+
+%description -n apache1-mod_dgee
+The DotGNU Execution Environment Core DSO module for Apache 1.3.x.
+
+%package -n apache-mod_dgee
+Summary:	DGEE DSO module for Apache 2.x
+Group:		Networking/Daemons
+Requires:	%{name} = %{version}-%{release}
+Requires:	apache(modules-api) = %{apache_modules_api}
+Requires:	apache-mod_mime
+
+%description -n apache-mod_dgee
+The DotGNU Execution Environment Core DSO module for Apache 2.x.
+
 %prep
 %setup -q -n %{name}-%{base_version}
 %patch0 -p1
@@ -63,6 +88,7 @@
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%{?with_i_have_checked_this_patch_works_not_just_compiles:%patch6 -p1}
 
 %build
 %{__aclocal}
@@ -79,31 +105,16 @@
 	--with-username=http \
 	--with-usergroup=http \
 	--with-python \
-%if %{with apache1}
-	--with-apache=%{_prefix}
-%else
-	--without-apache \
-	--with-apache2=%{_prefix}
-%endif
+	%{?with_apache1:--with-apache=%{apxs1}} \
+	%{?with_apache2:--with-apache2=%{apxs2}}
 
-%if %{with apache1}
-%{__make}
-%else
-%{__make} \
-	APACHE=
-%endif
+%{__make} -j1
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with apache1}
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
-%else
-%{__make} install \
-	DESTDIR=$RPM_BUILD_ROOT \
-	APACHE=
-%endif
 
 # Thise files should be installed by Makefile (I can't fix it):
 install cslib/DotGNU/DGEE/DotGNU.DGEE.dll \
@@ -122,50 +133,45 @@
 install -d $RPM_BUILD_ROOT/etc/logrotate.d
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
 
+%if %{with apache1}
+install -Dp %{SOURCE3} $RPM_BUILD_ROOT/etc/apache/conf.d/40_mod_dgee.conf
+%endif
+%if %{with apache2}
+install -Dp %{SOURCE3} $RPM_BUILD_ROOT/etc/httpd/httpd.conf/40_mod_dgee.conf
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
 /sbin/ldconfig
-%if %{with apache1}
-if [ -f /etc/httpd/httpd.conf ] && \
-	! grep -q "^Include.*/mod_dgee.conf" /etc/httpd/httpd.conf; then
-		echo "Include /etc/httpd/mod_dgee.conf" >> /etc/httpd/httpd.conf
-fi
-%endif
-
-%{apxs} -e -a -n dgee %{_pkglibdir}/mod_dgee.so 1>&2
-if [ -f /var/lock/subsys/httpd ]; then
-	/etc/rc.d/init.d/httpd restart 1>&2
-fi
-
-if [ -f /var/lock/subsys/dgee ]; then
-	/etc/rc.d/init.d/dgee restart 1>&2
-else
-	echo "Run \"/etc/rc.d/init.d/dgee start\" to start goltwater and dgee services."
-fi
 /sbin/chkconfig --add dgee
+%service dgee restart "goltwater and dgee services"
 
 %preun
 if [ "$1" = "0" ]; then
-%if %{with apache1}
-	umask 027
-	grep -E -v "^Include.*/mod_dgee.conf" /etc/httpd/httpd.conf > \
-		/etc/httpd/httpd.conf.tmp
-	mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
-%endif
-	%{apxs} -e -A -n dgee %{_pkglibdir}/mod_dgee.so 1>&2
-	if [ -f /var/lock/subsys/httpd ]; then
-		/etc/rc.d/init.d/httpd restart 1>&2
-	fi
-	if [ -f /var/lock/subsys/dgee ]; then
-		/etc/rc.d/init.d/dgee stop 1>&2
-	fi
+	%service dgee stop
 	/sbin/chkconfig --del dgee
 fi
 
 %postun	-p /sbin/ldconfig
 
+%post -n apache1-mod_dgee
+%service -q apache restart
+
+%postun -n apache1-mod_dgee
+if [ "$1" = 0 ]; then
+	%service -q apache restart
+fi
+
+%post -n apache-mod_dgee
+%service -q httpd restart
+
+%postun -n apache-mod_dgee
+if [ "$1" = 0 ]; then
+	%service -q httpd restart
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc BINARYINSTALL INSTALL QUICKSTART README
@@ -175,13 +181,6 @@
 %dir %{_libdir}/%{name}
 %attr(755,root,root) %{_libdir}/%{name}/*
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}*
-%if %{with apache1}
-%config %verify(not md5 mtime size) %{_sysconfdir}/httpd/mod_%{name}.conf
-%{_libdir}/apache/mod_%{name}.so
-%else
-#%config %{_sysconfdir}/httpd/mod_%{name}.conf
-#%{_libdir}/apache/mod_%{name}.so
-%endif
 %{_datadir}/%{name}
 /var/lib/%{name}
 %attr(754,root,root) /etc/rc.d/init.d/%{name}
@@ -190,12 +189,31 @@
 %attr(750,root,root) %dir /var/log/archiv/%{name}
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
 
+%if %{with apache1}
+%files -n apache1-mod_dgee
+%defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/apache/conf.d/*_mod_%{name}.conf
+%attr(755,root,root) %{_libdir}/apache1/mod_%{name}.so
+%endif
+
+%if %{with apache2}
+%files -n apache-mod_dgee
+%defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/httpd/httpd.conf/*_mod_%{name}.conf
+%attr(755,root,root) %{_libdir}/apache/mod_%{name}.so
+%endif
+
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <feedback at pld-linux.org>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.22  2006/03/05 11:01:53  glen
+- separated apache1/apache modules
+- use %service, new apache packaging
+- pnet related patch (compiles but not tested)
+
 Revision 1.21  2006/02/03 17:16:09  glen
 - sane form of greater-equal operator
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/dgee.spec?r1=1.21&r2=1.22&f=u



More information about the pld-cvs-commit mailing list