Author: andree                       Date: Sat Mar  5 11:38:23 2005 GMT
Module: SPECS                         Tag: DEVEL
---- Log message:
- fixed apache1,2 support

---- Files affected:
SPECS:
   courier.spec (1.102.2.7 -> 1.102.2.8) 

---- Diffs:

================================================================
Index: SPECS/courier.spec
diff -u SPECS/courier.spec:1.102.2.7 SPECS/courier.spec:1.102.2.8
--- SPECS/courier.spec:1.102.2.7        Sat Mar  5 01:01:42 2005
+++ SPECS/courier.spec  Sat Mar  5 12:38:17 2005
@@ -62,7 +62,6 @@
 Obsoletes:     zmailer
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                apachedir       /home/services/httpd
 %define                _datadir        %{_prefix}/share/courier
 %define                _mandir         /usr/share/man
 %define                _libdir         %{_prefix}/%{_lib}/courier
@@ -72,12 +71,12 @@
 %define                _certsdir       %{_sysconfdir}/certs
 %define                initdir         /etc/rc.d/init.d
 
-# Change the following if your DocumentRoot and cgibindir differ.  This is
-# the default redhat build:
-
-%define                _cgibindir              %{apachedir}/cgi-bin
-%define                _imagedir               %{_datadir}/sqwebmail/images
-%define                _imageurl               /webmail
+%define                _httpdir        /home/services/httpd
+%define                _cgibindir      %{_httpdir}/cgi-bin
+%define                _imagedir       %{_datadir}/sqwebmail/images
+%define                _imageurl       /webmail
+%define                _apache1dir     /etc/apache
+%define                _apache2dir     /etc/httpd
 
 %description
 Courier is a fully functional mail server, that can completely take
@@ -377,9 +376,6 @@
 mv -f $RPM_BUILD_ROOT%{_libexecdir}/courier/webmail/webadmin \
        $RPM_BUILD_ROOT%{_cgibindir}/webadmin
 
-# And here's why we delete all images from filelist.webmail:
-#mv -f $RPM_BUILD_ROOT%{_datadir}/sqwebmail/images 
$RPM_BUILD_ROOT%{_documentrootdir}/webmail
-
 # install a cron job to clean out webmail's cache
 install webmail/cron.cmd 
$RPM_BUILD_ROOT/etc/cron.hourly/courier-webmail-cleancache
 
@@ -473,8 +469,8 @@
 ln -sf %{_datadir}/esmtpd-ssl $RPM_BUILD_ROOT%{_sbindir}/esmtpd-ssl
 
 # for apache
-echo "Alias /webmail %{_imagedir}" >%{name}.conf
-install %{name}.conf $RPM_BUILD_ROOT/etc/httpd
+echo "Alias /webmail %{_imagedir}" >apache-%{name}.conf
+install apache-%{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache-%{name}.conf
 
 # remove unpackaged files
 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
@@ -605,16 +601,20 @@
        echo Type "%{_sbindir}/webmaild start" to start webmail server
        echo
 fi
-if [ -f /etc/apache/apache.conf ] && ! grep -q "^Include.*%{name}.conf" 
/etc/apache/apache.conf; then
-    echo "Include /etc/httpd/%{name}.conf" >> /etc/apache/apache.conf
-    if [ -f /var/lock/subsys/apache ]; then
-        /etc/rc.d/init.d/apache restart 1>&2
-    fi
-elif [ -d /etc/httpd/httpd.conf ]; then
-    ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
-    if [ -f /var/lock/subsys/httpd ]; then
-        /usr/sbin/apachectl restart 1>&2
-    fi
+
+# apache1
+if [ -d %{_apache1dir}/conf.d ]; then
+       ln -sf %{_sysconfdir}/apache-%{name}.conf 
%{_apache1dir}/conf.d/99_%{name}.conf
+       if [ -f /var/lock/subsys/apache ]; then
+               /etc/rc.d/init.d/apache restart 1>&2
+       fi
+fi
+# apache2
+if [ -d %{_apache2dir}/httpd.conf ]; then
+       ln -sf %{_sysconfdir}/apache-%{name}.conf 
%{_apache2dir}/httpd.conf/99_%{name}.conf
+       if [ -f /var/lock/subsys/httpd ]; then
+               /etc/rc.d/init.d/httpd restart 1>&2
+       fi
 fi
 
 %preun webmail
@@ -622,18 +622,20 @@
        if [ -e %{_localstatedir}/tmp/sqwebmaild.pid ]; then
                %{_sbindir}/webmaild stop
        fi
-fi
-if [ -d /etc/httpd/httpd.conf ]; then
-    rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-    if [ -f /var/lock/subsys/httpd ]; then
-       /usr/sbin/apachectl restart 1>&2
-    fi
-elif [ -f /etc/apache/apache.conf ]; then
-    grep -v "^Include.*%{name}.conf" /etc/apache/apache.conf > 
/etc/apache/apache.conf.tmp
-    mv -f /etc/apache/apache.conf.tmp /etc/apache/apache.conf
-    if [ -f /var/lock/subsys/apache ]; then
-        /etc/rc.d/init.d/apache restart 1>&2
-    fi
+       # apache1
+       if [ -d %{_apache1dir}/conf.d ]; then
+               rm -f %{_apache1dir}/conf.d/99_%{name}.conf
+               if [ -f /var/lock/subsys/apache ]; then
+                        /etc/rc.d/init.d/apache restart 1>&2
+                fi
+        fi
+        # apache2
+       if [ -d %{_apache2dir}/httpd.conf ]; then
+                rm -f %{_apache2dir}/httpd.conf/99_%{name}.conf
+                if [ -f /var/lock/subsys/httpd ]; then
+                        /etc/rc.d/init.d/httpd restart 1>&2
+               fi
+        fi
 fi
 
 %files
@@ -908,7 +910,7 @@
 %attr(700,bin,daemon) %dir %{_localstatedir}/calendar/localcache
 %attr(750,bin,daemon) %dir %{_localstatedir}/calendar/private
 %attr(755,bin,daemon) %dir %{_localstatedir}/calendar/public
-%config(noreplace) %verify(not size mtime md5) 
%{_sysconfdir}/httpd/%{name}.conf
+%config(noreplace) %verify(not size mtime md5) 
%{_sysconfdir}/apache-%{name}.conf
 
 %files maildrop
 %defattr(644,root,root,755)
@@ -946,6 +948,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.102.2.8  2005/03/05 11:38:17  andree
+- fixed apache1,2 support
+
 Revision 1.102.2.7  2005/03/05 00:01:42  andree
 - updated to 0.49.0, removed -build.patch (obsoleted)
 - added post, preun section for webmail (apache1,2 support)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/courier.spec?r1=1.102.2.7&r2=1.102.2.8&f=u


_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to