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
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"
195 lib/Smarty/plugins/block.t.php \
196 lib/Smarty/plugins/function.{bankaccount,gentime,handle,memory,number,size,sum,tip}.php \
197 lib/Smarty/plugins/modifier.{money_format,striphtml,to_words}.php \
199 %{__rm} -r lib/Smarty
201 # cleanup backups after patching
202 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 %{__rm}
208 ./configure --with-mysql %{?with_lmsd_debug:--enable-debug0 --enable-debug1}
211 CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
214 ./configure --with-pgsql %{?with_lmsd_debug:--enable-debug0 --enable-debug1}
217 CFLAGS='%{rpmcflags} -fPIC -DUSE_PGSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
220 CFLAGS="%{rpmcflags}" %{__make} -j1 -C modules/parser \
227 rm -rf $RPM_BUILD_ROOT
228 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/%{name},%{_webapps}/%{_webapp}} \
229 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,lms/modules} \
230 $RPM_BUILD_ROOT%{_smartyplugindir} \
231 $RPM_BUILD_ROOT%{_lmsdir}/{lms,userpanel,www/{doc,user,userpanel/modules}} \
232 $RPM_BUILD_ROOT%{_lmsvar}/{backups,documents,templates_c,userpanel/templates_c}
234 cp -a *.php img $RPM_BUILD_ROOT%{_lmsdir}/www
235 cp -a doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc
236 cp -a contrib lib modules sample templates $RPM_BUILD_ROOT%{_lmsdir}
237 cp -a smarty-plugins/* $RPM_BUILD_ROOT%{_smartyplugindir}
238 cp -a bin/* $RPM_BUILD_ROOT%{_sbindir}
240 %{__mv} $RPM_BUILD_ROOT{%{_lmsdir}/sample/%{name}.ini,%{_sysconfdir}}
242 install %{SOURCE3} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
243 install %{SOURCE4} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
246 %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/sql*.php,modules}
247 %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/*.html,templates}
250 %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/customer/*,www/user}
254 install daemon/lmsd-*sql $RPM_BUILD_ROOT%{_sbindir}
255 install daemon/modules/*/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}
256 for module in dns ggnotify notify; do
257 cp -a daemon/modules/$module/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/$module
259 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/lmsd
260 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
264 cp -a userpanel/{lib,modules,templates} $RPM_BUILD_ROOT%{_lmsdir}/userpanel
265 cp -a userpanel/{index.php,style} $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel
266 ln -s %{_lmsdir}/www/userpanel/style $RPM_BUILD_ROOT%{_lmsdir}/userpanel
267 ln -s %{_lmsvar}/userpanel/templates_c $RPM_BUILD_ROOT%{_lmsdir}/userpanel
269 for MODULE in $RPM_BUILD_ROOT%{_lmsdir}/userpanel/modules/*; do
270 MODULE=$(basename $MODULE)
271 mkdir $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE
272 ln -s %{_lmsdir}/userpanel/modules/$MODULE/style \
273 $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE
277 rm -rf $RPM_BUILD_ROOT
280 /sbin/chkconfig --add lmsd
281 %service lmsd restart "lmsd daemon"
284 if [ "$1" = "0" ]; then
286 /sbin/chkconfig --del lmsd
289 %triggerin -- apache1 < 1.3.37-3, apache1-base
290 %webapp_register apache %{_webapp}
292 %triggerun -- apache1 < 1.3.37-3, apache1-base
293 %webapp_unregister apache %{_webapp}
295 %triggerin -- apache-base
296 %webapp_register httpd %{_webapp}
298 %triggerun -- apache-base
299 %webapp_unregister httpd %{_webapp}
302 %defattr(644,root,root,755)
303 %doc doc/{AUTHORS,ChangeLog,INSTALL,README*,lms*}
305 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.ini
306 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
307 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
308 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
309 %{_smartyplugindir}/*.php
312 %attr(770,root,http) %{_lmsvar}/backups
313 %attr(770,root,http) %{_lmsvar}/documents
314 %attr(770,root,http) %{_lmsvar}/templates_c
319 %exclude %{_lmsdir}/modules/sql.php
320 %exclude %{_lmsdir}/modules/sqllang.php
322 %exclude %{_lmsdir}/templates/sql.html
323 %exclude %{_lmsdir}/templates/sqlprint.html
325 %exclude %{_lmsdir}/www/user
326 %exclude %{_lmsdir}/www/userpanel
328 %dir %{_lmsdir}/sample
329 %{_lmsdir}/sample/crontab-entry
330 %{_lmsdir}/sample/lms-mgc*.ini
331 %{_lmsdir}/sample/*.conf
332 %{_lmsdir}/sample/*.txt
333 %{_lmsdir}/sample/rc.lmsd
334 %{_lmsdir}/sample/rc.reminder_1st
335 %attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.pl
338 %defattr(644,root,root,755)
339 %attr(755,root,root) %{_sbindir}/lms-*
342 %defattr(644,root,root,755)
343 %{_lmsdir}/modules/sql.php
344 %{_lmsdir}/modules/sqllang.php
345 %{_lmsdir}/templates/sql.html
346 %{_lmsdir}/templates/sqlprint.html
349 %defattr(644,root,root,755)
354 %defattr(644,root,root,755)
355 %attr(755,root,root) %{_sbindir}/lmsd-*sql
357 %attr(755,root,root) %{_libdir}/lms/*.so
358 %attr(754,root,root) /etc/rc.d/init.d/lmsd
359 # XXX: dir shared with base
361 %dir %{_sysconfdir}/modules
362 %{_sysconfdir}/modules/*
363 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
367 %defattr(644,root,root,755)
368 %dir %{_lmsdir}/userpanel
369 %{_lmsdir}/userpanel/lib
370 %{_lmsdir}/userpanel/modules
371 %{_lmsdir}/userpanel/templates
372 %{_lmsdir}/userpanel/templates_c
373 %{_lmsdir}/userpanel/style
374 %dir %{_lmsdir}/www/userpanel
375 %{_lmsdir}/www/userpanel/style
376 %{_lmsdir}/www/userpanel/index.php
377 %dir %{_lmsvar}/userpanel
378 %attr(770,root,http) %{_lmsvar}/userpanel/templates_c