Author: glen                         Date: Sun Jan 29 23:57:59 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- fixed Smarty paths
- use webaps
- rel 2

---- Files affected:
SPECS:
   lms.spec (1.71 -> 1.72) 

---- Diffs:

================================================================
Index: SPECS/lms.spec
diff -u SPECS/lms.spec:1.71 SPECS/lms.spec:1.72
--- SPECS/lms.spec:1.71 Thu Jan 26 02:19:48 2006
+++ SPECS/lms.spec      Mon Jan 30 00:57:54 2006
@@ -1,6 +1,6 @@
 # $Revision$, $Date$
 # TODO
-# - test build on amd64 and sheck /usr/lib64 patch
+# - test build on amd64 and check /usr/lib64 patch
 # - cosmetics (sort in %%files and %%install)
 # - contrib split
 #
@@ -13,7 +13,7 @@
 Summary(pl):   System Zarządzania Siecią Lokalną
 Name:          lms
 Version:       %{lmsver}.%{lmssubver}
-Release:       1.1
+Release:       2
 License:       GPL
 Vendor:                LMS Developers
 Group:         Networking/Utilities
@@ -29,19 +29,21 @@
 %{?with_lmsd:BuildRequires:    mysql-devel}
 %{?with_lmsd:BuildRequires:    postgresql-devel}
 %{?with_lmsd:Requires(post,preun):     /sbin/chkconfig}
-Requires:      Smarty >= 2.5.0
+Requires:      Smarty >= 2.6.2
 Requires:      php
 Requires:      php-gd
 Requires:      php-iconv
 Requires:      php-pcre
 Requires:      php-posix
 %{?with_lmsd:Requires: rc-scripts}
-Requires:      webserver
+Requires:      webapps
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _sysconfdir     /etc/%{name}
 %define                _lmsdir         %{_datadir}/%{name}
 %define                _lmsvar         /var/lib/%{name}
+%define                _webapps        /etc/webapps
+%define                _webapp         %{name}
 
 %description
 This is a package of applications in PHP and Perl for managing LANs.
@@ -172,7 +174,7 @@
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_sbindir} \
-          $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,httpd} \
+          $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
           $RPM_BUILD_ROOT/etc/lms/modules/{dns,ggnofity,nofity} \
           $RPM_BUILD_ROOT{%{_lmsvar}/{backups,templates_c},%{_libdir}/lms} \
           $RPM_BUILD_ROOT%{_lmsdir}/www/{img,doc,user}
@@ -184,7 +186,10 @@
 install bin/* $RPM_BUILD_ROOT%{_sbindir}
 
 install sample/%{name}.ini $RPM_BUILD_ROOT%{_sysconfdir}
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
+
+install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
+install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
 
 # sqlpanel
 install contrib/sqlpanel/sql.php $RPM_BUILD_ROOT%{_lmsdir}/modules
@@ -207,19 +212,6 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-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
-       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
-fi
-
 %post lmsd
 /sbin/chkconfig --add lmsd
 if [ -f /var/lock/subsys/lmsd ]; then
@@ -228,21 +220,6 @@
        echo "Run \"/etc/rc.d/init.d/lmsd start\" to start lmsd daemon."
 fi
 
-%preun
-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
-       fi
-       if [ -f /var/lock/subsys/httpd ]; then
-               /usr/sbin/apachectl restart 1>&2
-       fi
-fi
-
 %preun lmsd
 if [ "$1" = "0" ]; then
        if [ -f /var/lock/subsys/lmsd ]; then
@@ -251,6 +228,18 @@
        /sbin/chkconfig --del lmsd
 fi
 
+%triggerin -- apache1
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache >= 2.0.0
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache >= 2.0.0
+%webapp_unregister httpd %{_webapp}
+
 %triggerpostun -- %{name} <= 1.0.4
 echo "WARNING!!!"
 echo "_READ_ and upgrade LMS database:"
@@ -263,12 +252,30 @@
 echo "You are advised to upgrade it manually"
 echo
 
+%triggerpostun -- %{name} < 1.6.6-1.4
+# nuke very-old config location (this mostly for Ra)
+if [ -f /etc/httpd/httpd.conf ]; then
+       sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
+fi
+
+# migrate from httpd (apache2) config dir
+if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
+       cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
+       mv -f /etc/httpd/%{name}.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
+fi
+
+rm -f /etc/httpd/httpd.conf/99_%{name}.conf
+/usr/sbin/webapp register httpd %{_webapp}
+%service -q httpd reload
+
 %files
 %defattr(644,root,root,755)
 %doc doc/{AUTHORS,ChangeLog*,INSTALL,README,UPGRADE*,lms*}
 %dir %{_sysconfdir}
 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) 
%{_sysconfdir}/*.ini
-%config(noreplace) %verify(not md5 mtime size) /etc/httpd/%{name}.conf
+%dir %attr(750,root,http) %{_webapps}/%{_webapp}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) 
%{_webapps}/%{_webapp}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) 
%{_webapps}/%{_webapp}/httpd.conf
 #
 %dir %{_lmsvar}
 %attr(770,root,http) %{_lmsvar}/backups
@@ -318,6 +325,11 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.72  2006/01/29 23:57:54  glen
+- fixed Smarty paths
+- use webaps
+- rel 2
+
 Revision 1.71  2006/01/26 01:19:48  glen
 - en corrections
 - add INSTALL to %doc (contains important information where to start)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/lms.spec?r1=1.71&r2=1.72&f=u

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

Reply via email to