]> git.pld-linux.org Git - packages/lms.git/blobdiff - lms.spec
- don't package traffic_ipt.pl twice
[packages/lms.git] / lms.spec
index ccd03149b0faaccd0a77236e88d59355a022d339..f0346724d002b9e0729b7a1c6e6ae7a8c499215a 100644 (file)
--- a/lms.spec
+++ b/lms.spec
@@ -6,27 +6,31 @@
 # Conditional build:
 %bcond_without lmsd            # without lmsd daemon
 #
-%define                lmsver          1.8
-%define                lmssubver       0
+%define                lmsver          1.9
+%define                lmssubver       3
 Summary:       LAN Managment System
 Summary(pl):   System Zarz±dzania Sieci± Lokaln±
 Name:          lms
 Version:       %{lmsver}.%{lmssubver}
 Release:       1
 License:       GPL v2
-Vendor:                LMS Developers
 Group:         Networking/Utilities
 Source0:       http://lms.rulez.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
-# Source0-md5: afa0680e112dc14c4fbb41d9ec2eedee
+# Source0-md5: c9560bf98462498a3bf4923e27560caf
 Source1:       %{name}.conf
 Source2:       %{name}.init
 Source3:       %{name}.sysconfig
 Patch0:                %{name}-PLD.patch
 Patch1:                %{name}-amd64.patch
+Patch2:                %{name}-smarty.patch
 URL:           http://lms.rulez.pl/
+BuildRequires: bison
+BuildRequires: flex
 %{?with_lmsd:BuildRequires:    libgadu-devel}
 %{?with_lmsd:BuildRequires:    mysql-devel}
 %{?with_lmsd:BuildRequires:    postgresql-devel}
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.268
 %{?with_lmsd:Requires(post,preun):     /sbin/chkconfig}
 Requires:      Smarty >= 2.6.10-4
 Requires:      php
@@ -34,13 +38,13 @@ Requires:   php-gd
 Requires:      php-iconv
 Requires:      php-pcre
 Requires:      php-posix
-%{?with_lmsd:Requires: rc-scripts}
 Requires:      webapps
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _sysconfdir     /etc/%{name}
 %define                _lmsdir         %{_datadir}/%{name}
 %define                _lmsvar         /var/lib/%{name}
+%define                _smartyplugindir        /usr/share/php/Smarty/plugins
 %define                _webapps        /etc/webapps
 %define                _webapp         %{name}
 
@@ -132,6 +136,8 @@ Prosty interfejs u
 Summary:       LAN Managment System - LMS system backend
 Summary(pl):   LAN Managment System - backend systemu LMS
 Group:         Networking/Utilities
+Requires(post,preun):  /sbin/chkconfig
+Requires:      rc-scripts
 Obsoletes:     lms-almsd
 
 %description lmsd
@@ -140,7 +146,7 @@ upon LMS database and restarting selected services.
 
 %description lmsd -l pl
 Program zarz±dzaj±cy serwerem poprzez tworzenie plików
-konfiguracyjnych na podstawie bazy danych LMS'a i restartowanie
+konfiguracyjnych na podstawie bazy danych LMS-a i restartowanie
 wybranych us³ug.
 
 %prep
@@ -150,6 +156,14 @@ wybranych us
 %patch1 -p1
 %endif
 
+mkdir smarty-plugins
+mv \
+lib/Smarty/plugins/block.t.php \
+lib/Smarty/plugins/function.{bankaccount,handle,number,size,sum,tip}.php \
+lib/Smarty/plugins/modifier.{money_format,striphtml,to_words}.php \
+       smarty-plugins
+rm -rf lib/Smarty
+
 %build
 %if %{with lmsd}
 
@@ -176,13 +190,22 @@ install -d $RPM_BUILD_ROOT%{_sbindir} \
           $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,documents},%{_libdir}/lms} \
-          $RPM_BUILD_ROOT%{_lmsdir}/www/{img,doc,user}
+          $RPM_BUILD_ROOT%{_lmsdir}/www/{img,doc,user} \
+          $RPM_BUILD_ROOT%{_lmsdir}/www/img/core \
+          $RPM_BUILD_ROOT%{_smartyplugindir}
 
 install *.php $RPM_BUILD_ROOT%{_lmsdir}/www
-install img/* $RPM_BUILD_ROOT%{_lmsdir}/www/img
-cp -r doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc
-cp -r lib contrib modules templates sample $RPM_BUILD_ROOT%{_lmsdir}
+install img/core/* $RPM_BUILD_ROOT%{_lmsdir}/www/img/core/*
+install img/*.gif $RPM_BUILD_ROOT%{_lmsdir}/www/img
+install img/*.jpg $RPM_BUILD_ROOT%{_lmsdir}/www/img
+install img/*.png $RPM_BUILD_ROOT%{_lmsdir}/www/img
+install img/*.css $RPM_BUILD_ROOT%{_lmsdir}/www/img
+install img/*.js $RPM_BUILD_ROOT%{_lmsdir}/www/img
+install img/*.fdb $RPM_BUILD_ROOT%{_lmsdir}/www/img
+cp -a doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc
+cp -a lib contrib modules templates sample $RPM_BUILD_ROOT%{_lmsdir}
 install bin/* $RPM_BUILD_ROOT%{_sbindir}
+cp -a smarty-plugins/* $RPM_BUILD_ROOT%{_smartyplugindir}
 
 install sample/%{name}.ini $RPM_BUILD_ROOT%{_sysconfdir}
 
@@ -213,24 +236,18 @@ rm -rf $RPM_BUILD_ROOT
 
 %post lmsd
 /sbin/chkconfig --add lmsd
-if [ -f /var/lock/subsys/lmsd ]; then
-       /etc/rc.d/init.d/lmsd restart >&2
-else
-       echo "Run \"/etc/rc.d/init.d/lmsd start\" to start lmsd daemon."
-fi
+%service lmsd restart "lmsd daemon"
 
 %preun lmsd
 if [ "$1" = "0" ]; then
-       if [ -f /var/lock/subsys/lmsd ]; then
-               /etc/rc.d/init.d/lmsd stop >&2
-       fi
+       %service lmsd stop
        /sbin/chkconfig --del lmsd
 fi
 
-%triggerin -- apache1
+%triggerin -- apache1 < 1.3.37-3, apache1-base
 %webapp_register apache %{_webapp}
 
-%triggerun -- apache1
+%triggerun -- apache1 < 1.3.37-3, apache1-base
 %webapp_unregister apache %{_webapp}
 
 %triggerin -- apache < 2.2.0, apache-base
@@ -275,6 +292,7 @@ rm -f /etc/httpd/httpd.conf/99_%{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
+%{_smartyplugindir}/*
 #
 %dir %{_lmsvar}
 %attr(770,root,http) %{_lmsvar}/backups
@@ -288,15 +306,27 @@ rm -f /etc/httpd/httpd.conf/99_%{name}.conf
 %{_lmsdir}/modules
 %exclude %{_lmsdir}/modules/sql.php
 %{_lmsdir}/contrib
-%{_lmsdir}/sample
+%dir %{_lmsdir}/sample
+%{_lmsdir}/sample/crontab-entry
+%{_lmsdir}/sample/lms-mgc-netx-sample.ini
+%{_lmsdir}/sample/lms-mgc.ini
+%{_lmsdir}/sample/lms.apache.conf
+%{_lmsdir}/sample/lms.ini
+%{_lmsdir}/sample/mailtemplate.txt
+%{_lmsdir}/sample/mailtemplate_en.txt
+%{_lmsdir}/sample/rc.lmsd
+%{_lmsdir}/sample/rc.reminder_1st
+%{_lmsdir}/sample/smstemplate.txt
+%{_lmsdir}/sample/tekst_1.txt
+%{_lmsdir}/sample/test.txt
 %attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.pl
+
 %{_lmsdir}/templates
 %exclude %{_lmsdir}/templates/sql.html
 %exclude %{_lmsdir}/templates/sqlprint.html
 
 %files scripts
 %defattr(644,root,root,755)
-%dir %{_sbindir}
 %attr(755,root,root) %{_sbindir}/*
 
 %files sqlpanel
@@ -313,8 +343,12 @@ rm -f /etc/httpd/httpd.conf/99_%{name}.conf
 %files lmsd
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_sbindir}/lmsd-*
+%dir %{_libdir}/lms
 %attr(755,root,root) %{_libdir}/lms/*.so
 %attr(754,root,root) /etc/rc.d/init.d/lmsd
-/etc/lms/modules/*
+# XXX: dir shared with base
+%dir %{_sysconfdir}
+%dir %{_sysconfdir}/modules
+%{_sysconfdir}/modules/*
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 %endif
This page took 0.111157 seconds and 4 git commands to generate.