2 # - test build on amd64 and check /usr/lib64 patch
3 # - cosmetics (sort in %%files and %%install)
7 %bcond_without lmsd # without lmsd daemon
11 Summary: LAN Managment System
12 Summary(pl): System Zarz±dzania Sieci± Lokaln±
14 Version: %{lmsver}.%{lmssubver}
17 Vendor: LMS Developers
18 Group: Networking/Utilities
19 Source0: http://lms.rulez.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
20 # Source0-md5: afa0680e112dc14c4fbb41d9ec2eedee
23 Source3: %{name}.sysconfig
24 Patch0: %{name}-PLD.patch
25 Patch1: %{name}-amd64.patch
26 URL: http://lms.rulez.pl/
27 %{?with_lmsd:BuildRequires: libgadu-devel}
28 %{?with_lmsd:BuildRequires: mysql-devel}
29 %{?with_lmsd:BuildRequires: postgresql-devel}
30 %{?with_lmsd:Requires(post,preun): /sbin/chkconfig}
31 Requires: Smarty >= 2.6.10-4
37 %{?with_lmsd:Requires: rc-scripts}
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %define _sysconfdir /etc/%{name}
42 %define _lmsdir %{_datadir}/%{name}
43 %define _lmsvar /var/lib/%{name}
44 %define _webapps /etc/webapps
45 %define _webapp %{name}
48 This is a package of applications in PHP and Perl for managing LANs.
49 It's using MySQL or PostgreSQL. The main goal is to get the best
50 service of users at provider's level. The main features in LMS are:
51 - database of users (name, surname, address, telephone number,
53 - database of computers (IP, MAC);
54 - easy-ridden financial system and funds of network;
55 - different subscriptions;
56 - sending warnings to users;
57 - many levels of access for LMS administrators;
58 - autogenerating ipchains, iptables, dhcpd, ethers file, oidentd,
59 openbsd packet filter configuration files/scripts;
60 - autogenerating almost any kind of config file using templates.
63 "LMS" jest skrótem od "LAN Management System". Jest to zestaw
64 aplikacji w PHP i Perlu, u³atwiaj±cych zarz±dzanie sieciami
65 osiedlowymi (popularnie zwanymi Amatorskimi Sieciami Komputerowymi),
66 opartych o bazê danych MySQL lub PostgreSQL. G³ówne za³o¿enia to
67 uzyskanie jako¶ci us³ug oraz obs³ugi u¿ytkowników na poziomie
68 providera z prawdziwego zdarzenia. Najbardziej podstawowe cechy LMS
70 - baza danych u¿ytkowników (imiê, nazwisko, adres, numer telefonu,
72 - baza danych komputerów (adres IP, adres MAC);
73 - prowadzenie prostego rachunku operacji finansowych oraz stanu
75 - ró¿ne taryfy abonamentowe;
76 - wysy³anie poczt± elektroniczn± upomnieñ do u¿ytkowników;
77 - automatyczne naliczanie op³at miesiêcznych;
78 - ró¿ne poziomy dostêpu do funkcji LMS dla administratorów;
79 - generowanie regu³ i plików konfiguracyjnych dla ipchains, iptables,
80 dhcpd, oidentd, packet filtra openbsd, wpisów /etc/ethers
81 - generowanie praktycznie ka¿dego pliku konfiguracyjnego na podstawie
82 danych w bazie przy u¿yciu prostych szablonów.
85 Summary: LAN Managment System - scripts
86 Summary(pl): LAN Managment System - skrypty
87 Group: Networking/Utilities
88 Requires: perl-Config-IniFiles
90 Requires: perl-Net-SMTP-Server
93 This package contains scripts to integrate LMS with your system,
94 monthly billing, notify users about their debts and cutting off
95 customers. Also you can build probably any kind of config file using
98 %description scripts -l pl
99 Ten pakiet zawiera skrypty do zintegrowania LMS z systemem, naliczania
100 comiesiêcznych op³at, powiadamiania u¿ytkowników o ich zad³u¿eniu oraz
101 ich automagicznego od³±czania. Mo¿esz tak¿e zbudowaæ prawdopodobnie
102 ka¿dy typ pliku konfiguracyjnego przy u¿yciu lms-mgc.
105 Summary: LAN Managment System - sqlpanel module
106 Summary(pl): LAN Managment System - modu³ sqlpanel
107 Group: Networking/Utilities
108 Requires: %{name} = %{version}-%{release}
110 %description sqlpanel
111 SQL-panel module allows you to execute SQL queries and directly modify
114 %description sqlpanel -l pl
115 Modu³ 'SQL - panel' daje mo¿liwo¶æ bezpo¶redniego dostêpu do bazy
116 danych poprzez zadawanie zapytañ SQL. Wyniki wy¶wietlane s± w formie
117 tabeli. Ponadto podawany jest czas wykonania zapytania.
120 Summary: LAN Managment System - simple user interface
121 Summary(pl): LAN Managment System - prosty interfejs u¿ytkownika
122 Group: Networking/Utilities
123 Requires: %{name} = %{version}-%{release}
126 Simple user interface.
128 %description user -l pl
129 Prosty interfejs u¿ytkownika.
132 Summary: LAN Managment System - LMS system backend
133 Summary(pl): LAN Managment System - backend systemu LMS
134 Group: Networking/Utilities
138 A program to manage the server by creating configuration files based
139 upon LMS database and restarting selected services.
141 %description lmsd -l pl
142 Program zarz±dzaj±cy serwerem poprzez tworzenie plików
143 konfiguracyjnych na podstawie bazy danych LMS'a i restartowanie
149 %if "%{_lib}" == "lib64"
158 ./configure --with-mysql
161 CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
164 ./configure --with-pgsql
167 CFLAGS='%{rpmcflags} -fPIC -DUSE_PGSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
174 rm -rf $RPM_BUILD_ROOT
175 install -d $RPM_BUILD_ROOT%{_sbindir} \
176 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
177 $RPM_BUILD_ROOT/etc/lms/modules/{dns,ggnofity,nofity} \
178 $RPM_BUILD_ROOT{%{_lmsvar}/{backups,templates_c,documents},%{_libdir}/lms} \
179 $RPM_BUILD_ROOT%{_lmsdir}/www/{img,doc,user}
181 install *.php $RPM_BUILD_ROOT%{_lmsdir}/www
182 install img/* $RPM_BUILD_ROOT%{_lmsdir}/www/img
183 cp -r doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc
184 cp -r lib contrib modules templates sample $RPM_BUILD_ROOT%{_lmsdir}
185 install bin/* $RPM_BUILD_ROOT%{_sbindir}
187 install sample/%{name}.ini $RPM_BUILD_ROOT%{_sysconfdir}
189 install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
190 install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
191 install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
194 install contrib/sqlpanel/sql.php $RPM_BUILD_ROOT%{_lmsdir}/modules
195 install contrib/sqlpanel/*.html $RPM_BUILD_ROOT%{_lmsdir}/templates
198 cp -r contrib/customer/* $RPM_BUILD_ROOT%{_lmsdir}/www/user
202 install daemon/lmsd-* $RPM_BUILD_ROOT%{_sbindir}
203 install daemon/modules/*/*.so $RPM_BUILD_ROOT%{_libdir}/lms
204 cp -r daemon/modules/dns/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/dns
205 cp -r daemon/modules/ggnotify/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/ggnotify
206 cp -r daemon/modules/dns/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/nofity
207 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/lmsd
208 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
212 rm -rf $RPM_BUILD_ROOT
215 /sbin/chkconfig --add lmsd
216 if [ -f /var/lock/subsys/lmsd ]; then
217 /etc/rc.d/init.d/lmsd restart >&2
219 echo "Run \"/etc/rc.d/init.d/lmsd start\" to start lmsd daemon."
223 if [ "$1" = "0" ]; then
224 if [ -f /var/lock/subsys/lmsd ]; then
225 /etc/rc.d/init.d/lmsd stop >&2
227 /sbin/chkconfig --del lmsd
230 %triggerin -- apache1
231 %webapp_register apache %{_webapp}
233 %triggerun -- apache1
234 %webapp_unregister apache %{_webapp}
236 %triggerin -- apache < 2.2.0, apache-base
237 %webapp_register httpd %{_webapp}
239 %triggerun -- apache < 2.2.0, apache-base
240 %webapp_unregister httpd %{_webapp}
242 %triggerpostun -- %{name} <= 1.0.4
244 echo "_READ_ and upgrade LMS database:"
245 echo "MySQL: /usr/share/doc/%{name}-%{version}/UPGRADE-1.0-1.5.mysql.gz"
246 echo "PostgreSQL: /usr/share/doc/%{name}-%{version}/UPGRADE-1.0-1.5.pgsql.gz"
248 %triggerpostun -- %{name} <= 1.2.0
250 echo "Automatic upgrade from LMS<= 1.2.0 is NO LONGER SUPPORTED by lms team"
251 echo "You are advised to upgrade it manually"
254 %triggerpostun -- %{name} < 1.6.6-1.4
255 # nuke very-old config location (this mostly for Ra)
256 if [ -f /etc/httpd/httpd.conf ]; then
257 sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
260 # migrate from httpd (apache2) config dir
261 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
262 cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
263 mv -f /etc/httpd/%{name}.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
266 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
267 /usr/sbin/webapp register httpd %{_webapp}
268 %service -q httpd reload
271 %defattr(644,root,root,755)
272 %doc doc/{AUTHORS,ChangeLog,INSTALL,README*,lms*}
274 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.ini
275 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
276 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
277 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
280 %attr(770,root,http) %{_lmsvar}/backups
281 %attr(770,root,http) %{_lmsvar}/templates_c
282 %attr(770,root,http) %{_lmsvar}/documents
286 %exclude %{_lmsdir}/www/user
289 %exclude %{_lmsdir}/modules/sql.php
292 %attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.pl
294 %exclude %{_lmsdir}/templates/sql.html
295 %exclude %{_lmsdir}/templates/sqlprint.html
298 %defattr(644,root,root,755)
300 %attr(755,root,root) %{_sbindir}/*
303 %defattr(644,root,root,755)
304 %{_lmsdir}/modules/sql.php
305 %{_lmsdir}/templates/sql.html
306 %{_lmsdir}/templates/sqlprint.html
309 %defattr(644,root,root,755)
314 %defattr(644,root,root,755)
315 %attr(755,root,root) %{_sbindir}/lmsd-*
316 %attr(755,root,root) %{_libdir}/lms/*.so
317 %attr(754,root,root) /etc/rc.d/init.d/lmsd
319 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}