From d6258be963ac4c2ab69fca207b8eda9691964942 Mon Sep 17 00:00:00 2001 From: radzio Date: Sat, 6 Dec 2003 18:18:46 +0000 Subject: [PATCH] - Requires: apache - %%bcond_with apache1 - add %%post %%postun scripts - rel 0.1.1 Changed files: dgee.spec -> 1.4 --- dgee.spec | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/dgee.spec b/dgee.spec index 2e22afa..b66da51 100644 --- a/dgee.spec +++ b/dgee.spec @@ -1,8 +1,10 @@ +%bcond_with apache1 + %define _rel 2 Summary: The DotGNU Execution Environment Core Name: dgee Version: 0.1.6 -Release: %{_rel}.0.0.1 +Release: %{_rel}.0.1.1 Source0: http://www.nfluid.com/download/src/%{name}-%{version}-%{_rel}.tgz # Source0-md5: a2573a076832c4c7212479cabda15eff Patch0: %{name}-DESTDIR.patch @@ -10,6 +12,8 @@ Patch1: %{name}-apache.patch License: GPL Vendor: DotGNU Group: Networking/Daemons +Requires: apache +Requires(post,preun): %{apxs} BuildRequires: apache-devel BuildRequires: expat-devel BuildRequires: goldwater-devel => 0.3.4 @@ -33,17 +37,59 @@ of accepting, validating and satisfying web service requests. %configure \ --with-goldwater=%{_prefix} \ --with-pnet=%{_prefix} \ +%if %{with apache1} + --with-apache=%{_prefix} +%else --without-apache \ --with-apache2=%{_prefix} +%endif +%if %{with apache1} +%{__make} +%else %{__make} \ APACHE= +%endif %install rm -rf $RPM_BUILD_ROOT +%if %{with apache1} +%{__make} install \ + DESTDIR=$RPM_BUILD_ROOT +%else %{__make} install \ DESTDIR=$RPM_BUILD_ROOT \ APACHE= +%endif + +%post +%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 + +%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 +fi + + %clean rm -rf $RPM_BUILD_ROOT @@ -55,8 +101,13 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/%{name} %{_libdir}/libdgee.* %{_libdir}/libdgxml.* +%if %{with apache1} +%config %{_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} # Local variables: -- 2.44.0