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
28 URL: http://www.lms.org.pl/
31 %{?with_lmsd:BuildRequires: libgadu-devel}
32 %{?with_lmsd:BuildRequires: mysql-devel}
33 BuildRequires: net-snmp-devel
34 %{?with_lmsd:BuildRequires: postgresql-devel >= 8.2}
35 BuildRequires: rpm-pythonprov
36 BuildRequires: rpmbuild(macros) >= 1.461
38 %{?with_lmsd:Requires(post,preun): /sbin/chkconfig}
39 Requires: Smarty >= 2.6.18-2
42 Requires: php(mbstring)
47 Requires: webserver(access)
48 Requires: webserver(alias)
49 Requires: webserver(php)
50 Conflicts: apache-base < 2.4.0-1
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 %define _sysconfdir /etc/%{name}
54 %define _webapps /etc/webapps
55 %define _webapp %{name}
56 %define _smartyplugindir %{php_data_dir}/Smarty/plugins
57 %define _lmsdir %{_datadir}/%{name}
58 %define _lmsvar /var/lib/%{name}
61 This is a package of applications in PHP and Perl for managing LANs.
62 It's using MySQL or PostgreSQL. The main goal is to get the best
63 service of users at provider's level. The main features in LMS are:
64 - database of users (name, surname, address, telephone number,
66 - database of computers (IP, MAC),
67 - easy-ridden financial system and funds of network,
68 - different subscriptions,
69 - sending warnings to users,
70 - many levels of access for LMS administrators,
71 - autogenerating ipchains, iptables, dhcpd, ethers file, oidentd,
72 openbsd packet filter configuration files/scripts,
73 - autogenerating almost any kind of config file using templates.
75 %description -l pl.UTF-8
76 "LMS" jest skrótem od "LAN Management System". Jest to zestaw
77 aplikacji w PHP i Perlu, ułatwiających zarządzanie sieciami
78 osiedlowymi (popularnie zwanymi Amatorskimi Sieciami Komputerowymi),
79 opartych o bazę danych MySQL lub PostgreSQL. Główne założenia to
80 uzyskanie jakości usług oraz obsługi użytkowników na poziomie
81 providera z prawdziwego zdarzenia. Najbardziej podstawowe cechy LMS
83 - baza danych użytkowników (imię, nazwisko, adres, numer telefonu,
85 - baza danych komputerów (adres IP, adres MAC),
86 - prowadzenie prostego rachunku operacji finansowych oraz stanu
88 - różne taryfy abonamentowe,
89 - wysyłanie pocztą elektroniczną upomnień do użytkowników,
90 - automatyczne naliczanie opłat miesięcznych,
91 - różne poziomy dostępu do funkcji LMS dla administratorów,
92 - generowanie reguł i plików konfiguracyjnych dla ipchains, iptables,
93 dhcpd, oidentd, packet filtra openbsd, wpisów /etc/ethers,
94 - generowanie praktycznie każdego pliku konfiguracyjnego na podstawie
95 danych w bazie przy użyciu prostych szablonów.
98 Summary: LAN Managment System - scripts
99 Summary(pl.UTF-8): LAN Managment System - skrypty
100 Group: Networking/Utilities
101 Requires: perl-Config-IniFiles
103 Requires: perl-Net-SMTP-Server
106 This package contains scripts to integrate LMS with your system,
107 monthly billing, notify users about their debts and cutting off
108 customers. Also you can build probably any kind of config file using
111 %description scripts -l pl.UTF-8
112 Ten pakiet zawiera skrypty do zintegrowania LMS z systemem, naliczania
113 comiesięcznych opłat, powiadamiania użytkowników o ich zadłużeniu oraz
114 ich automagicznego odłączania. Możesz także zbudować prawdopodobnie
115 każdy typ pliku konfiguracyjnego przy użyciu lms-mgc.
118 Summary: LAN Managment System - sqlpanel module
119 Summary(pl.UTF-8): LAN Managment System - moduł sqlpanel
120 Group: Networking/Utilities
121 Requires: %{name} = %{version}-%{release}
123 %description sqlpanel
124 SQL-panel module allows you to execute SQL queries and directly modify
127 %description sqlpanel -l pl.UTF-8
128 Moduł 'SQL - panel' daje możliwość bezpośredniego dostępu do bazy
129 danych poprzez zadawanie zapytań SQL. Wyniki wyświetlane są w formie
130 tabeli. Ponadto podawany jest czas wykonania zapytania.
133 Summary: LAN Managment System - simple user interface
134 Summary(pl.UTF-8): LAN Managment System - prosty interfejs użytkownika
135 Group: Networking/Utilities
136 Requires: %{name} = %{version}-%{release}
139 Simple user interface.
141 %description user -l pl.UTF-8
142 Prosty interfejs użytkownika.
145 Summary: LAN Managment System - LMS system backend
146 Summary(pl.UTF-8): LAN Managment System - backend systemu LMS
147 Group: Networking/Utilities
148 Requires(post,preun): /sbin/chkconfig
153 A program to manage the server by creating configuration files based
154 upon LMS database and restarting selected services.
156 %description lmsd -l pl.UTF-8
157 Program zarządzający serwerem poprzez tworzenie plików
158 konfiguracyjnych na podstawie bazy danych LMS-a i restartowanie
162 Summary: LAN Managment System - Userpanel
163 Summary(pl.UTF-8): System Zarządzania Siecią Lokalną - Panel Użytkownika
164 Group: Networking/Utilities
165 Requires: %{name} = %{version}-%{release}
167 %description userpanel
168 Userpanel is automated virtual customer service, based on LMS and
169 using its core features. It enables customers (or it's intended to) to
170 do review their payments, change their personal details or computer
171 properties, modify subscriptions, submit problems, track their
172 requests on Helpdesk and print invoices. It means, it makes a closer
173 contact with their ISP.
175 %description userpanel -l pl.UTF-8
176 Userpanel jest opartą na szkielecie LMS (i ściśle z LMS
177 współpracującą) implementacją tzw. e-boku. Umożliwia (albo będzie
178 umożliwiał) klientom przeglądanie stanu swoich wpłat, zmianę swoich
179 danych osobowych, edycję właściwości swoich komputerów, zmianę taryf,
180 zgłaszanie błędów oraz awarii do Helpdesku, wydruk faktur oraz
186 %if "%{_lib}" == "lib64"
193 lib/Smarty/plugins/block.t.php \
194 lib/Smarty/plugins/function.{bankaccount,gentime,handle,memory,number,size,sum,tip}.php \
195 lib/Smarty/plugins/modifier.{money_format,striphtml,to_words}.php \
197 %{__rm} -r lib/Smarty
199 # cleanup backups after patching
200 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 %{__rm}
206 ./configure --with-mysql %{?with_lmsd_debug:--enable-debug0 --enable-debug1}
209 CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
212 ./configure --with-pgsql %{?with_lmsd_debug:--enable-debug0 --enable-debug1}
215 CFLAGS='%{rpmcflags} -fPIC -DUSE_PGSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
218 CFLAGS="%{rpmcflags}" %{__make} -j1 -C modules/parser \
225 rm -rf $RPM_BUILD_ROOT
226 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/%{name},%{_webapps}/%{_webapp}} \
227 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,lms/modules} \
228 $RPM_BUILD_ROOT%{_smartyplugindir} \
229 $RPM_BUILD_ROOT%{_lmsdir}/{lms,userpanel,www/{doc,user,userpanel/modules}} \
230 $RPM_BUILD_ROOT%{_lmsvar}/{backups,documents,templates_c,userpanel/templates_c}
232 cp -a *.php img $RPM_BUILD_ROOT%{_lmsdir}/www
233 cp -a doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc
234 cp -a contrib lib modules sample templates $RPM_BUILD_ROOT%{_lmsdir}
235 cp -a smarty-plugins/* $RPM_BUILD_ROOT%{_smartyplugindir}
236 cp -a bin/* $RPM_BUILD_ROOT%{_sbindir}
238 %{__mv} $RPM_BUILD_ROOT{%{_lmsdir}/sample/%{name}.ini,%{_sysconfdir}}
240 install %{SOURCE3} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
241 install %{SOURCE4} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
244 %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/sql*.php,modules}
245 %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/*.html,templates}
248 %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/customer/*,www/user}
252 install daemon/lmsd-*sql $RPM_BUILD_ROOT%{_sbindir}
253 install daemon/modules/*/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}
254 for module in dns ggnotify notify; do
255 cp -a daemon/modules/$module/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/$module
257 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/lmsd
258 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
262 cp -a userpanel/{lib,modules,templates} $RPM_BUILD_ROOT%{_lmsdir}/userpanel
263 cp -a userpanel/{index.php,style} $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel
264 ln -s %{_lmsdir}/www/userpanel/style $RPM_BUILD_ROOT%{_lmsdir}/userpanel
265 ln -s %{_lmsvar}/userpanel/templates_c $RPM_BUILD_ROOT%{_lmsdir}/userpanel
267 for MODULE in $RPM_BUILD_ROOT%{_lmsdir}/userpanel/modules/*; do
268 MODULE=$(basename $MODULE)
269 mkdir $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE
270 ln -s %{_lmsdir}/userpanel/modules/$MODULE/style \
271 $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE
275 rm -rf $RPM_BUILD_ROOT
278 /sbin/chkconfig --add lmsd
279 %service lmsd restart "lmsd daemon"
282 if [ "$1" = "0" ]; then
284 /sbin/chkconfig --del lmsd
287 %triggerin -- apache1 < 1.3.37-3, apache1-base
288 %webapp_register apache %{_webapp}
290 %triggerun -- apache1 < 1.3.37-3, apache1-base
291 %webapp_unregister apache %{_webapp}
293 %triggerin -- apache-base
294 %webapp_register httpd %{_webapp}
296 %triggerun -- apache-base
297 %webapp_unregister httpd %{_webapp}
300 %defattr(644,root,root,755)
301 %doc doc/{AUTHORS,ChangeLog,INSTALL,README*,lms*}
303 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.ini
304 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
305 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
306 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
307 %{_smartyplugindir}/*.php
310 %attr(770,root,http) %{_lmsvar}/backups
311 %attr(770,root,http) %{_lmsvar}/documents
312 %attr(770,root,http) %{_lmsvar}/templates_c
317 %exclude %{_lmsdir}/modules/sql.php
318 %exclude %{_lmsdir}/modules/sqllang.php
320 %exclude %{_lmsdir}/templates/sql.html
321 %exclude %{_lmsdir}/templates/sqlprint.html
323 %exclude %{_lmsdir}/www/user
324 %exclude %{_lmsdir}/www/userpanel
326 %dir %{_lmsdir}/sample
327 %{_lmsdir}/sample/crontab-entry
328 %{_lmsdir}/sample/lms-mgc*.ini
329 %{_lmsdir}/sample/*.conf
330 %{_lmsdir}/sample/*.txt
331 %{_lmsdir}/sample/rc.lmsd
332 %{_lmsdir}/sample/rc.reminder_1st
333 %attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.pl
336 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_sbindir}/lms-*
340 %defattr(644,root,root,755)
341 %{_lmsdir}/modules/sql.php
342 %{_lmsdir}/modules/sqllang.php
343 %{_lmsdir}/templates/sql.html
344 %{_lmsdir}/templates/sqlprint.html
347 %defattr(644,root,root,755)
352 %defattr(644,root,root,755)
353 %attr(755,root,root) %{_sbindir}/lmsd-*sql
355 %attr(755,root,root) %{_libdir}/lms/*.so
356 %attr(754,root,root) /etc/rc.d/init.d/lmsd
357 # XXX: dir shared with base
359 %dir %{_sysconfdir}/modules
360 %{_sysconfdir}/modules/*
361 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
365 %defattr(644,root,root,755)
366 %dir %{_lmsdir}/userpanel
367 %{_lmsdir}/userpanel/lib
368 %{_lmsdir}/userpanel/modules
369 %{_lmsdir}/userpanel/templates
370 %{_lmsdir}/userpanel/templates_c
371 %{_lmsdir}/userpanel/style
372 %dir %{_lmsdir}/www/userpanel
373 %{_lmsdir}/www/userpanel/style
374 %{_lmsdir}/www/userpanel/index.php
375 %dir %{_lmsvar}/userpanel
376 %attr(770,root,http) %{_lmsvar}/userpanel/templates_c