X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=lms.spec;h=5365712a6b3acbfbee6cfed4d4b8fed48715bbd1;hb=b0f05b97f6df26bf7ffcaf83c02c7a889574d5a2;hp=d2d65559200080e70e06be39a6633082583b999d;hpb=7d64281e18622ad13f23a509a1be0331e3e52b41;p=packages%2Flms.git diff --git a/lms.spec b/lms.spec index d2d6555..5365712 100644 --- a/lms.spec +++ b/lms.spec @@ -1,36 +1,36 @@ -# TODO +# TODO: +# - package documents/templates/default # - cosmetics (sort in %%files and %%install) -# - contrib split +# - consider contrib and samples (re)packaging # # Conditional build: %bcond_without lmsd # without lmsd daemon %bcond_with lmsd_debug # with lmsd debugging %define lmsver 1.11 -%define lmssubver 12 +%define lmssubver 13 Summary: LAN Managment System Summary(pl.UTF-8): System Zarządzania Siecią Lokalną Name: lms Version: %{lmsver}.%{lmssubver} -Release: 1 +Release: 5 License: GPL v2 Group: Networking/Utilities Source0: http://www.lms.org.pl/download/%{lmsver}/%{name}-%{version}.tar.gz -# Source0-md5: 484a02ea6e8d493b7906ea8246492b64 +# Source0-md5: 294899358ae2585a4030580d79a06ee8 Source1: %{name}.conf Source2: %{name}.init Source3: %{name}.sysconfig Patch0: %{name}-PLD.patch Patch1: %{name}-amd64.patch Patch2: %{name}-smarty.patch -Patch3: %{name}-quicksearch.php.patch URL: http://www.lms.org.pl/ BuildRequires: bison BuildRequires: flex %{?with_lmsd:BuildRequires: libgadu-devel} %{?with_lmsd:BuildRequires: mysql-devel} BuildRequires: net-snmp-devel -%{?with_lmsd:BuildRequires: postgresql-devel} +%{?with_lmsd:BuildRequires: postgresql-devel >= 8.2} BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.461 BuildRequires: yacc @@ -49,25 +49,25 @@ Requires: webserver(php) BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _sysconfdir /etc/%{name} -%define _lmsdir %{_datadir}/%{name} -%define _lmsvar /var/lib/%{name} -%define _smartyplugindir %{php_data_dir}/Smarty/plugins %define _webapps /etc/webapps %define _webapp %{name} +%define _smartyplugindir %{php_data_dir}/Smarty/plugins +%define _lmsdir %{_datadir}/%{name} +%define _lmsvar /var/lib/%{name} %description This is a package of applications in PHP and Perl for managing LANs. It's using MySQL or PostgreSQL. The main goal is to get the best service of users at provider's level. The main features in LMS are: - database of users (name, surname, address, telephone number, - commentary); -- database of computers (IP, MAC); -- easy-ridden financial system and funds of network; -- different subscriptions; -- sending warnings to users; -- many levels of access for LMS administrators; + commentary), +- database of computers (IP, MAC), +- easy-ridden financial system and funds of network, +- different subscriptions, +- sending warnings to users, +- many levels of access for LMS administrators, - autogenerating ipchains, iptables, dhcpd, ethers file, oidentd, - openbsd packet filter configuration files/scripts; + openbsd packet filter configuration files/scripts, - autogenerating almost any kind of config file using templates. %description -l pl.UTF-8 @@ -79,16 +79,16 @@ uzyskanie jakości usług oraz obsługi użytkowników na poziomie providera z prawdziwego zdarzenia. Najbardziej podstawowe cechy LMS to: - baza danych użytkowników (imię, nazwisko, adres, numer telefonu, - uwagi); -- baza danych komputerów (adres IP, adres MAC); + uwagi), +- baza danych komputerów (adres IP, adres MAC), - prowadzenie prostego rachunku operacji finansowych oraz stanu - funduszów sieci; -- różne taryfy abonamentowe; -- wysyłanie pocztą elektroniczną upomnień do użytkowników; -- automatyczne naliczanie opłat miesięcznych; -- różne poziomy dostępu do funkcji LMS dla administratorów; + funduszów sieci, +- różne taryfy abonamentowe, +- wysyłanie pocztą elektroniczną upomnień do użytkowników, +- automatyczne naliczanie opłat miesięcznych, +- różne poziomy dostępu do funkcji LMS dla administratorów, - generowanie reguł i plików konfiguracyjnych dla ipchains, iptables, - dhcpd, oidentd, packet filtra openbsd, wpisów /etc/ethers + dhcpd, oidentd, packet filtra openbsd, wpisów /etc/ethers, - generowanie praktycznie każdego pliku konfiguracyjnego na podstawie danych w bazie przy użyciu prostych szablonów. @@ -157,10 +157,10 @@ konfiguracyjnych na podstawie bazy danych LMS-a i restartowanie wybranych usług. %package userpanel -Summary: LAN Managment System - Userpanel -Summary(pl.UTF-8): System Zarządzania Siecią Lokalną - Panel Użytkownika -Group: Networking/Utilities -Requires: %{name} = %{version}-%{release} +Summary: LAN Managment System - Userpanel +Summary(pl.UTF-8): System Zarządzania Siecią Lokalną - Panel Użytkownika +Group: Networking/Utilities +Requires: %{name} = %{version}-%{release} %description userpanel Userpanel is automated virtual customer service, based on LMS and @@ -185,22 +185,20 @@ formularza przelewu. %patch1 -p1 %endif %patch2 -p1 -%patch3 -p1 mkdir smarty-plugins -mv \ -lib/Smarty/plugins/block.t.php \ -lib/Smarty/plugins/function.{bankaccount,gentime,handle,memory,number,size,sum,tip}.php \ -lib/Smarty/plugins/modifier.{money_format,striphtml,to_words}.php \ +%{__mv} \ + lib/Smarty/plugins/block.t.php \ + lib/Smarty/plugins/function.{bankaccount,gentime,handle,memory,number,size,sum,tip}.php \ + lib/Smarty/plugins/modifier.{money_format,striphtml,to_words}.php \ smarty-plugins -rm -rf lib/Smarty +%{__rm} -r lib/Smarty # cleanup backups after patching -find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f +find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 %{__rm} %build %if %{with lmsd} - cd daemon ./configure --with-mysql %{?with_lmsd_debug:--enable-debug0 --enable-debug1} @@ -215,71 +213,60 @@ mv lmsd lmsd-mysql CFLAGS='%{rpmcflags} -fPIC -DUSE_PGSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..' mv lmsd lmsd-pgsql +CFLAGS="%{rpmcflags}" %{__make} -j1 -C modules/parser \ + CC='%{__cc}' + cd .. %endif %install rm -rf $RPM_BUILD_ROOT -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/core \ - $RPM_BUILD_ROOT%{_smartyplugindir} - -install *.php $RPM_BUILD_ROOT%{_lmsdir}/www -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 +install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/%{name},%{_webapps}/%{_webapp}} \ + $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,lms/modules} \ + $RPM_BUILD_ROOT%{_smartyplugindir} \ + $RPM_BUILD_ROOT%{_lmsdir}/{lms,userpanel,www/{doc,user,userpanel/modules}} \ + $RPM_BUILD_ROOT%{_lmsvar}/{backups,documents,templates_c,userpanel/templates_c} + +cp -a *.php img $RPM_BUILD_ROOT%{_lmsdir}/www 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 contrib lib modules sample templates $RPM_BUILD_ROOT%{_lmsdir} cp -a smarty-plugins/* $RPM_BUILD_ROOT%{_smartyplugindir} +cp -a bin/* $RPM_BUILD_ROOT%{_sbindir} -install sample/%{name}.ini $RPM_BUILD_ROOT%{_sysconfdir} +%{__mv} $RPM_BUILD_ROOT{%{_lmsdir}/sample/%{name}.ini,%{_sysconfdir}} -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 -install contrib/sqlpanel/*.html $RPM_BUILD_ROOT%{_lmsdir}/templates +%{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/sql*.php,modules} +%{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/*.html,templates} # user -cp -r contrib/customer/* $RPM_BUILD_ROOT%{_lmsdir}/www/user +%{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/customer/*,www/user} # daemon %if %{with lmsd} -install daemon/lmsd-* $RPM_BUILD_ROOT%{_sbindir} -install daemon/modules/*/*.so $RPM_BUILD_ROOT%{_libdir}/lms -cp -r daemon/modules/dns/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/dns -cp -r daemon/modules/ggnotify/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/ggnotify -cp -r daemon/modules/dns/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/nofity +install daemon/lmsd-*sql $RPM_BUILD_ROOT%{_sbindir} +install daemon/modules/*/*.so $RPM_BUILD_ROOT%{_libdir}/%{name} +for module in dns ggnotify notify; do + cp -a daemon/modules/$module/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/$module +done install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/lmsd install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name} %endif #userpanel -install -d $RPM_BUILD_ROOT%{_lmsdir}/userpanel -install -d $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules -install -d $RPM_BUILD_ROOT%{_lmsvar}/userpanel/templates_c - -cp -R {userpanel/lib,userpanel/modules,userpanel/templates} $RPM_BUILD_ROOT%{_lmsdir}/userpanel -cp -R {userpanel/index.php,userpanel/style} $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel -ln -s %{_lmsdir}/www/userpanel/style $RPM_BUILD_ROOT%{_lmsdir}/userpanel -ln -s %{_lmsvar}/userpanel/templates_c $RPM_BUILD_ROOT%{_lmsdir}/userpanel +cp -a userpanel/{lib,modules,templates} $RPM_BUILD_ROOT%{_lmsdir}/userpanel +cp -a userpanel/{index.php,style} $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel +ln -s %{_lmsdir}/www/userpanel/style $RPM_BUILD_ROOT%{_lmsdir}/userpanel +ln -s %{_lmsvar}/userpanel/templates_c $RPM_BUILD_ROOT%{_lmsdir}/userpanel for MODULE in $RPM_BUILD_ROOT%{_lmsdir}/userpanel/modules/*; do - MODULE=$(basename $MODULE) - mkdir $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE - ln -s %{_lmsdir}/userpanel/modules/$MODULE/style \ - $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE + MODULE=$(basename $MODULE) + mkdir $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE + ln -s %{_lmsdir}/userpanel/modules/$MODULE/style \ + $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE done %clean @@ -315,48 +302,42 @@ fi %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}/* +%{_smartyplugindir}/*.php # %dir %{_lmsvar} %attr(770,root,http) %{_lmsvar}/backups -%attr(770,root,http) %{_lmsvar}/templates_c %attr(770,root,http) %{_lmsvar}/documents +%attr(770,root,http) %{_lmsvar}/templates_c # %dir %{_lmsdir} -%{_lmsdir}/www -%exclude %{_lmsdir}/www/user -%exclude %{_lmsdir}/www/userpanel %{_lmsdir}/lib %{_lmsdir}/modules %exclude %{_lmsdir}/modules/sql.php +%exclude %{_lmsdir}/modules/sqllang.php +%{_lmsdir}/templates +%exclude %{_lmsdir}/templates/sql.html +%exclude %{_lmsdir}/templates/sqlprint.html +%{_lmsdir}/www +%exclude %{_lmsdir}/www/user +%exclude %{_lmsdir}/www/userpanel %{_lmsdir}/contrib %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/radius-sql.conf +%{_lmsdir}/sample/lms-mgc*.ini +%{_lmsdir}/sample/*.conf +%{_lmsdir}/sample/*.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) -%attr(755,root,root) %{_sbindir}/* +%attr(755,root,root) %{_sbindir}/lms-* %files sqlpanel %defattr(644,root,root,755) %{_lmsdir}/modules/sql.php +%{_lmsdir}/modules/sqllang.php %{_lmsdir}/templates/sql.html %{_lmsdir}/templates/sqlprint.html @@ -367,7 +348,7 @@ fi %if %{with lmsd} %files lmsd %defattr(644,root,root,755) -%attr(755,root,root) %{_sbindir}/lmsd-* +%attr(755,root,root) %{_sbindir}/lmsd-*sql %dir %{_libdir}/lms %attr(755,root,root) %{_libdir}/lms/*.so %attr(754,root,root) /etc/rc.d/init.d/lmsd