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 Group: Networking/Utilities
18 Source0: http://lms.rulez.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
19 # Source0-md5: afa0680e112dc14c4fbb41d9ec2eedee
22 Source3: %{name}.sysconfig
23 Patch0: %{name}-PLD.patch
24 Patch1: %{name}-amd64.patch
25 URL: http://lms.rulez.pl/
26 %{?with_lmsd:BuildRequires: libgadu-devel}
27 %{?with_lmsd:BuildRequires: mysql-devel}
28 %{?with_lmsd:BuildRequires: postgresql-devel}
29 BuildRequires: rpmbuild(macros) >= 1.268
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 %service lmsd restart "lmsd daemon"
219 if [ "$1" = "0" ]; then
221 /sbin/chkconfig --del lmsd
224 %triggerin -- apache1
225 %webapp_register apache %{_webapp}
227 %triggerun -- apache1
228 %webapp_unregister apache %{_webapp}
230 %triggerin -- apache < 2.2.0, apache-base
231 %webapp_register httpd %{_webapp}
233 %triggerun -- apache < 2.2.0, apache-base
234 %webapp_unregister httpd %{_webapp}
236 %triggerpostun -- %{name} <= 1.0.4
238 echo "_READ_ and upgrade LMS database:"
239 echo "MySQL: /usr/share/doc/%{name}-%{version}/UPGRADE-1.0-1.5.mysql.gz"
240 echo "PostgreSQL: /usr/share/doc/%{name}-%{version}/UPGRADE-1.0-1.5.pgsql.gz"
242 %triggerpostun -- %{name} <= 1.2.0
244 echo "Automatic upgrade from LMS<= 1.2.0 is NO LONGER SUPPORTED by lms team"
245 echo "You are advised to upgrade it manually"
248 %triggerpostun -- %{name} < 1.6.6-1.4
249 # nuke very-old config location (this mostly for Ra)
250 if [ -f /etc/httpd/httpd.conf ]; then
251 sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
254 # migrate from httpd (apache2) config dir
255 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
256 cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
257 mv -f /etc/httpd/%{name}.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
260 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
261 /usr/sbin/webapp register httpd %{_webapp}
262 %service -q httpd reload
265 %defattr(644,root,root,755)
266 %doc doc/{AUTHORS,ChangeLog,INSTALL,README*,lms*}
268 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.ini
269 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
270 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
271 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
274 %attr(770,root,http) %{_lmsvar}/backups
275 %attr(770,root,http) %{_lmsvar}/templates_c
276 %attr(770,root,http) %{_lmsvar}/documents
280 %exclude %{_lmsdir}/www/user
283 %exclude %{_lmsdir}/modules/sql.php
286 %attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.pl
288 %exclude %{_lmsdir}/templates/sql.html
289 %exclude %{_lmsdir}/templates/sqlprint.html
292 %defattr(644,root,root,755)
294 %attr(755,root,root) %{_sbindir}/*
297 %defattr(644,root,root,755)
298 %{_lmsdir}/modules/sql.php
299 %{_lmsdir}/templates/sql.html
300 %{_lmsdir}/templates/sqlprint.html
303 %defattr(644,root,root,755)
308 %defattr(644,root,root,755)
309 %attr(755,root,root) %{_sbindir}/lmsd-*
310 %attr(755,root,root) %{_libdir}/lms
311 %attr(754,root,root) /etc/rc.d/init.d/lmsd
312 %{_sysconfdir}/modules
313 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}