Author: glen                         Date: Sun Mar  6 17:25:46 2005 GMT
Module: SPECS                         Tag: DEVEL
---- Log message:
- update apache config placement

---- Files affected:
SPECS:
   nagios.spec (1.36.2.7 -> 1.36.2.8) 

---- Diffs:

================================================================
Index: SPECS/nagios.spec
diff -u SPECS/nagios.spec:1.36.2.7 SPECS/nagios.spec:1.36.2.8
--- SPECS/nagios.spec:1.36.2.7  Sun Mar  6 17:25:38 2005
+++ SPECS/nagios.spec   Sun Mar  6 18:25:39 2005
@@ -66,6 +66,9 @@
 %define                _datadir        %{_prefix}/share/%{name}
 %define                _localstatedir  /var/lib/%{name}
 
+%define                _apache1dir     /etc/apache
+%define                _apache2dir     /etc/httpd
+
 %description
 Nagios is a program that will monitor hosts and services on your
 network. It has the ability to email or page you when a problem arises
@@ -170,7 +173,7 @@
        INIT_OPTS="" \
        COMMAND_OPTS=""
 
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-apache.conf
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 
 # install templated configuration files
@@ -247,30 +250,36 @@
 fi
 
 %post cgi
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" 
/etc/httpd/httpd.conf; then
-       echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
-       if [ -f /var/lock/subsys/httpd ]; then
-               /usr/sbin/apachectl restart 1>&2
+# 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
-elif [ -d /etc/httpd/httpd.conf ]; then
-       ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
+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
-               /usr/sbin/apachectl restart 1>&2
+               /etc/rc.d/init.d/httpd restart 1>&2
        fi
 fi
 
 %preun cgi
 if [ "$1" = "0" ]; then
-       umask 027
-       if [ -d /etc/httpd/httpd.conf ]; then
-               rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-       else
-               grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
-                       /etc/httpd/httpd.conf.tmp
-               mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
+       # 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
-       if [ -f /var/lock/subsys/httpd ]; then
-               /usr/sbin/apachectl restart 1>&2
+       # 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
 
@@ -295,7 +304,7 @@
 
 %files cgi
 %defattr(644,root,root,755)
-%attr(640,root,http) %config(noreplace) %verify(not size mtime md5) 
/etc/httpd/%{name}.conf
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) 
%{_sysconfdir}/%{name}-apache.conf
 %attr(644,root,http) %config(noreplace) %verify(not size mtime md5) 
%{_sysconfdir}/cgi.cfg
 %dir %{_libdir}/%{name}/cgi
 %attr(755,root,root) %{_libdir}/%{name}/cgi/*.cgi
@@ -312,6 +321,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.36.2.8  2005/03/06 17:25:39  glen
+- update apache config placement
+
 Revision 1.36.2.7  2005/03/06 16:25:38  glen
 - remove nagios-data group
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/nagios.spec?r1=1.36.2.7&r2=1.36.2.8&f=u


_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to