]> git.pld-linux.org Git - packages/lms.git/commitdiff
- fixed Smarty paths
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 29 Jan 2006 23:57:54 +0000 (23:57 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- use webaps
- rel 2

Changed files:
    lms.spec -> 1.72

lms.spec

index be7ac99b3ad348a6f4faa761eb0934d4d5b06bfc..29e7796c63b14566e93dbdc8c9ae3d5eb679f80e 100644 (file)
--- a/lms.spec
+++ b/lms.spec
@@ -1,5 +1,5 @@
 # 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
 #
@@ -12,7 +12,7 @@ Summary:      LAN Managment System
 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
@@ -28,19 +28,21 @@ URL:                http://lms.rulez.pl/
 %{?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.
@@ -171,7 +173,7 @@ cd ..
 %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}
@@ -183,7 +185,10 @@ cp -r lib contrib modules templates sample $RPM_BUILD_ROOT%{_lmsdir}
 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
@@ -206,19 +211,6 @@ install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
 %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
@@ -227,21 +219,6 @@ else
        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
@@ -250,6 +227,18 @@ if [ "$1" = "0" ]; then
        /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:"
@@ -262,12 +251,30 @@ echo "Automatic upgrade from LMS<= 1.2.0 is NO LONGER SUPPORTED by lms team"
 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
This page took 0.058318 seconds and 4 git commands to generate.