2 # - package documents/templates/default
3 # - cosmetics (sort in %%files and %%install)
4 # - consider contrib and samples (re)packaging
7 %bcond_without lmsd # without lmsd daemon
8 %bcond_with lmsd_debug # with lmsd debugging
12 Summary: LAN Managment System
13 Summary(pl.UTF-8): System Zarządzania Siecią Lokalną
15 Version: %{lmsver}.%{lmssubver}
18 Group: Networking/Utilities
19 Source0: http://www.lms.org.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
20 # Source0-md5: 294899358ae2585a4030580d79a06ee8
22 Source2: %{name}.sysconfig
23 Source3: %{name}-apache.conf
24 Source4: %{name}-httpd.conf
25 Patch0: %{name}-PLD.patch
26 Patch1: %{name}-amd64.patch
27 Patch2: %{name}-smarty.patch
29 URL: http://www.lms.org.pl/
32 %{?with_lmsd:BuildRequires: libgadu-devel}
33 %{?with_lmsd:BuildRequires: mysql-devel}
34 BuildRequires: net-snmp-devel
35 %{?with_lmsd:BuildRequires: postgresql-devel >= 8.2}
36 BuildRequires: rpm-pythonprov
37 BuildRequires: rpmbuild(macros) >= 1.461
38 BuildRequires: sed >= 4.0
39 %{?with_lmsd:Requires(post,preun): /sbin/chkconfig}
40 Requires: Smarty >= 2.6.18-2
43 Requires: php(mbstring)
48 Requires: webserver(access)
49 Requires: webserver(alias)
50 Requires: webserver(php)
51 Conflicts: apache-base < 2.4.0-1
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 %define _sysconfdir /etc/%{name}
55 %define _webapps /etc/webapps
56 %define _webapp %{name}
57 %define _smartyplugindir %{php_data_dir}/Smarty/plugins
58 %define _lmsdir %{_datadir}/%{name}
59 %define _lmsvar /var/lib/%{name}
62 This is a package of applications in PHP and Perl for managing LANs.
63 It's using MySQL or PostgreSQL. The main goal is to get the best
64 service of users at provider's level. The main features in LMS are:
65 - database of users (name, surname, address, telephone number,
67 - database of computers (IP, MAC),
68 - easy-ridden financial system and funds of network,
69 - different subscriptions,
70 - sending warnings to users,
71 - many levels of access for LMS administrators,
72 - autogenerating ipchains, iptables, dhcpd, ethers file, oidentd,
73 openbsd packet filter configuration files/scripts,
74 - autogenerating almost any kind of config file using templates.
76 %description -l pl.UTF-8
77 "LMS" jest skrótem od "LAN Management System". Jest to zestaw
78 aplikacji w PHP i Perlu, ułatwiających zarządzanie sieciami
79 osiedlowymi (popularnie zwanymi Amatorskimi Sieciami Komputerowymi),
80 opartych o bazę danych MySQL lub PostgreSQL. Główne założenia to
81 uzyskanie jakości usług oraz obsługi użytkowników na poziomie
82 providera z prawdziwego zdarzenia. Najbardziej podstawowe cechy LMS
84 - baza danych użytkowników (imię, nazwisko, adres, numer telefonu,
86 - baza danych komputerów (adres IP, adres MAC),
87 - prowadzenie prostego rachunku operacji finansowych oraz stanu
89 - różne taryfy abonamentowe,
90 - wysyłanie pocztą elektroniczną upomnień do użytkowników,
91 - automatyczne naliczanie opłat miesięcznych,
92 - różne poziomy dostępu do funkcji LMS dla administratorów,
93 - generowanie reguł i plików konfiguracyjnych dla ipchains, iptables,
94 dhcpd, oidentd, packet filtra openbsd, wpisów /etc/ethers,
95 - generowanie praktycznie każdego pliku konfiguracyjnego na podstawie
96 danych w bazie przy użyciu prostych szablonów.
99 Summary: LAN Managment System - scripts
100 Summary(pl.UTF-8): LAN Managment System - skrypty
101 Group: Networking/Utilities
102 Requires: perl-Config-IniFiles
104 Requires: perl-Net-SMTP-Server
107 This package contains scripts to integrate LMS with your system,
108 monthly billing, notify users about their debts and cutting off
109 customers. Also you can build probably any kind of config file using
112 %description scripts -l pl.UTF-8
113 Ten pakiet zawiera skrypty do zintegrowania LMS z systemem, naliczania
114 comiesięcznych opłat, powiadamiania użytkowników o ich zadłużeniu oraz
115 ich automagicznego odłączania. Możesz także zbudować prawdopodobnie
116 każdy typ pliku konfiguracyjnego przy użyciu lms-mgc.
119 Summary: LAN Managment System - sqlpanel module
120 Summary(pl.UTF-8): LAN Managment System - moduł sqlpanel
121 Group: Networking/Utilities
122 Requires: %{name} = %{version}-%{release}
124 %description sqlpanel
125 SQL-panel module allows you to execute SQL queries and directly modify
128 %description sqlpanel -l pl.UTF-8
129 Moduł 'SQL - panel' daje możliwość bezpośredniego dostępu do bazy
130 danych poprzez zadawanie zapytań SQL. Wyniki wyświetlane są w formie
131 tabeli. Ponadto podawany jest czas wykonania zapytania.
134 Summary: LAN Managment System - simple user interface
135 Summary(pl.UTF-8): LAN Managment System - prosty interfejs użytkownika
136 Group: Networking/Utilities
137 Requires: %{name} = %{version}-%{release}
140 Simple user interface.
142 %description user -l pl.UTF-8
143 Prosty interfejs użytkownika.
146 Summary: LAN Managment System - LMS system backend
147 Summary(pl.UTF-8): LAN Managment System - backend systemu LMS
148 Group: Networking/Utilities
149 Requires(post,preun): /sbin/chkconfig
154 A program to manage the server by creating configuration files based
155 upon LMS database and restarting selected services.
157 %description lmsd -l pl.UTF-8
158 Program zarządzający serwerem poprzez tworzenie plików
159 konfiguracyjnych na podstawie bazy danych LMS-a i restartowanie
163 Summary: LAN Managment System - Userpanel
164 Summary(pl.UTF-8): System Zarządzania Siecią Lokalną - Panel Użytkownika
165 Group: Networking/Utilities
166 Requires: %{name} = %{version}-%{release}
168 %description userpanel
169 Userpanel is automated virtual customer service, based on LMS and
170 using its core features. It enables customers (or it's intended to) to
171 do review their payments, change their personal details or computer
172 properties, modify subscriptions, submit problems, track their
173 requests on Helpdesk and print invoices. It means, it makes a closer
174 contact with their ISP.
176 %description userpanel -l pl.UTF-8
177 Userpanel jest opartą na szkielecie LMS (i ściśle z LMS
178 współpracującą) implementacją tzw. e-boku. Umożliwia (albo będzie
179 umożliwiał) klientom przeglądanie stanu swoich wpłat, zmianę swoich
180 danych osobowych, edycję właściwości swoich komputerów, zmianę taryf,
181 zgłaszanie błędów oraz awarii do Helpdesku, wydruk faktur oraz
187 %if "%{_lib}" == "lib64"
193 %{__sed} -i -e '1s,/usr/bin/python$,%{__python},' contrib/LMS2Nagios/nagios-v6-{check,gen}.py
197 lib/Smarty/plugins/block.t.php \
198 lib/Smarty/plugins/function.{bankaccount,gentime,handle,memory,number,size,sum,tip}.php \
199 lib/Smarty/plugins/modifier.{money_format,striphtml,to_words}.php \
201 %{__rm} -r lib/Smarty
203 # cleanup backups after patching
204 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 %{__rm}
210 ./configure --with-mysql %{?with_lmsd_debug:--enable-debug0 --enable-debug1}
213 CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
214 %{__mv} lmsd lmsd-mysql
216 ./configure --with-pgsql %{?with_lmsd_debug:--enable-debug0 --enable-debug1}
219 CFLAGS='%{rpmcflags} -fPIC -DUSE_PGSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
220 %{__mv} lmsd lmsd-pgsql
222 CFLAGS="%{rpmcflags}" %{__make} -j1 -C modules/parser \
229 rm -rf $RPM_BUILD_ROOT
230 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/%{name},%{_webapps}/%{_webapp}} \
231 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,lms/modules} \
232 $RPM_BUILD_ROOT%{_smartyplugindir} \
233 $RPM_BUILD_ROOT%{_lmsdir}/{lms,userpanel,www/{doc,user,userpanel/modules}} \
234 $RPM_BUILD_ROOT%{_lmsvar}/{backups,documents,templates_c,userpanel/templates_c}
236 cp -a *.php img $RPM_BUILD_ROOT%{_lmsdir}/www
237 cp -a doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc
238 cp -a contrib lib modules sample templates $RPM_BUILD_ROOT%{_lmsdir}
239 cp -a smarty-plugins/* $RPM_BUILD_ROOT%{_smartyplugindir}
240 cp -a bin/* $RPM_BUILD_ROOT%{_sbindir}
242 %{__mv} $RPM_BUILD_ROOT{%{_lmsdir}/sample/%{name}.ini,%{_sysconfdir}}
244 install %{SOURCE3} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
245 install %{SOURCE4} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
248 %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/sql*.php,modules}
249 %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/*.html,templates}
252 %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/customer/*,www/user}
256 install daemon/lmsd-*sql $RPM_BUILD_ROOT%{_sbindir}
257 install daemon/modules/*/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}
258 for module in dns ggnotify notify; do
259 cp -a daemon/modules/$module/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/$module
261 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/lmsd
262 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
266 cp -a userpanel/{lib,modules,templates} $RPM_BUILD_ROOT%{_lmsdir}/userpanel
267 cp -a userpanel/{index.php,style} $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel
268 ln -s %{_lmsdir}/www/userpanel/style $RPM_BUILD_ROOT%{_lmsdir}/userpanel
269 ln -s %{_lmsvar}/userpanel/templates_c $RPM_BUILD_ROOT%{_lmsdir}/userpanel
271 for MODULE in $RPM_BUILD_ROOT%{_lmsdir}/userpanel/modules/*; do
272 MODULE=$(basename $MODULE)
273 mkdir $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE
274 ln -s %{_lmsdir}/userpanel/modules/$MODULE/style \
275 $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE
279 rm -rf $RPM_BUILD_ROOT
282 /sbin/chkconfig --add lmsd
283 %service lmsd restart "lmsd daemon"
286 if [ "$1" = "0" ]; then
288 /sbin/chkconfig --del lmsd
291 %triggerin -- apache1 < 1.3.37-3, apache1-base
292 %webapp_register apache %{_webapp}
294 %triggerun -- apache1 < 1.3.37-3, apache1-base
295 %webapp_unregister apache %{_webapp}
297 %triggerin -- apache-base
298 %webapp_register httpd %{_webapp}
300 %triggerun -- apache-base
301 %webapp_unregister httpd %{_webapp}
304 %defattr(644,root,root,755)
305 %doc doc/{AUTHORS,ChangeLog,INSTALL,README*,lms*}
307 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.ini
308 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
309 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
310 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
311 %{_smartyplugindir}/*.php
314 %attr(770,root,http) %{_lmsvar}/backups
315 %attr(770,root,http) %{_lmsvar}/documents
316 %attr(770,root,http) %{_lmsvar}/templates_c
321 %exclude %{_lmsdir}/modules/sql.php
322 %exclude %{_lmsdir}/modules/sqllang.php
324 %exclude %{_lmsdir}/templates/sql.html
325 %exclude %{_lmsdir}/templates/sqlprint.html
327 %exclude %{_lmsdir}/www/user
328 %exclude %{_lmsdir}/www/userpanel
330 %dir %{_lmsdir}/sample
331 %{_lmsdir}/sample/crontab-entry
332 %{_lmsdir}/sample/lms-mgc*.ini
333 %{_lmsdir}/sample/*.conf
334 %{_lmsdir}/sample/*.txt
335 %{_lmsdir}/sample/rc.lmsd
336 %{_lmsdir}/sample/rc.reminder_1st
337 %attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.pl
340 %defattr(644,root,root,755)
341 %attr(755,root,root) %{_sbindir}/lms-*
344 %defattr(644,root,root,755)
345 %{_lmsdir}/modules/sql.php
346 %{_lmsdir}/modules/sqllang.php
347 %{_lmsdir}/templates/sql.html
348 %{_lmsdir}/templates/sqlprint.html
351 %defattr(644,root,root,755)
356 %defattr(644,root,root,755)
357 %attr(755,root,root) %{_sbindir}/lmsd-*sql
359 %attr(755,root,root) %{_libdir}/lms/*.so
360 %attr(754,root,root) /etc/rc.d/init.d/lmsd
361 # XXX: dir shared with base
363 %dir %{_sysconfdir}/modules
364 %{_sysconfdir}/modules/*
365 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
369 %defattr(644,root,root,755)
370 %dir %{_lmsdir}/userpanel
371 %{_lmsdir}/userpanel/lib
372 %{_lmsdir}/userpanel/modules
373 %{_lmsdir}/userpanel/templates
374 %{_lmsdir}/userpanel/templates_c
375 %{_lmsdir}/userpanel/style
376 %dir %{_lmsdir}/www/userpanel
377 %{_lmsdir}/www/userpanel/style
378 %{_lmsdir}/www/userpanel/index.php
379 %dir %{_lmsvar}/userpanel
380 %attr(770,root,http) %{_lmsvar}/userpanel/templates_c