3 %bcond_without almsd # without almsd daemon
6 # - cosmetics (sort in %%files and %%install)
10 Summary: LAN Managment System
11 Summary(pl): System Zarz±dzania Sieci± Lokaln±
13 Version: %{lmsver}.%{lmssubver}
16 Vendor: LMS Developers
17 Group: Networking/Utilities
18 Source0: http://lms.rulez.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
19 # Source0-md5: 3f94f69e5b9b8c14ca883cbe5d1c7b68
22 Source3: %{name}.sysconfig
23 Patch0: %{name}-PLD.patch
24 Patch1: %{name}-amd64.patch
25 Patch2: %{name}-calendar.patch
26 URL: http://lms.rulez.pl/
27 %{?with_almsd:BuildRequires: libgadu-devel}
28 %{?with_almsd:BuildRequires: mysql-devel}
29 %{?with_almsd:BuildRequires: postgresql-devel}
30 %{?with_almsd:PreReq: rc-scripts}
31 %{?with_almsd:Requires(post,preun): /sbin/chkconfig}
37 Requires: Smarty >= 2.5.0
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define _sysconfdir /etc/%{name}
41 %define _lmsdir %{_datadir}/%{name}
42 %define _lmsvar /var/lib/%{name}
45 This is a package of applications in PHP and Perl for managing LANs.
46 It's using MySQL or PostgreSQL. The main goal is to get the best
47 service of users at provider's level. The main features in LMS are:
48 - database of users (name, surname, address, telefon number,
50 - database of computers (IP, MAC);
51 - easy-ridden financial system and funds of network;
52 - different subscriptions;
53 - sending warnings to users;
54 - many levels of access for LMS administrators;
55 - autogenerating ipchains, iptables, dhcpd, ethers file, oidentd,
56 openbsd packet filter configuration files/scripts;
57 - autogenerating almost any kind of config file using templates;
60 "LMS" jest skrótem od "LAN Management System". Jest to zestaw
61 aplikacji w PHP i Perlu, u³atwiaj±cych zarz±dzanie sieciami
62 osiedlowymi (popularnie zwanymi Amatorskimi Sieciami Komputerowymi),
63 opartych o bazê danych MySQL lub PostgreSQL. G³ówne za³o¿enia to
64 uzyskanie jako¶ci us³ug oraz obs³ugi u¿ytkowników na poziomie
65 providera z prawdziwego zdarzenia. Najbardziej podstawowe cechy LMS
67 - baza danych u¿ytkowników (imiê, nazwisko, adres, numer telefonu,
69 - baza danych komputerów (adres IP, adres MAC);
70 - prowadzenie prostego rachunku operacji finansowych oraz stanu
72 - ró¿ne taryfy abonamentowe;
73 - wysy³anie poczt± elektroniczn± upomnieñ do u¿ytkowników;
74 - automatyczne naliczanie op³at miesiêcznych;
75 - ró¿ne poziomy dostêpu do funkcji LMS dla administratorów;
76 - generowanie regu³ i plików konfiguracyjnych dla ipchains, iptables,
77 dhcpd, oidentd, packet filtra openbsd, wpisów /etc/ethers
78 - generowanie praktycznie ka¿dego pliku konfiguracyjnego na podstawie
79 danych w bazie przy u¿yciu prostych szablonów;
82 Summary: LAN Managment System - scripts
83 Summary(pl): LAN Managment System - skrypty
84 Group: Networking/Utilities
85 Requires: perl-Net-SMTP-Server
86 Requires: perl-Config-IniFiles
90 This package contains scripts to integrate LMS with your system,
91 monthly billing, notify users about their debts and cutting off
92 customers. Also you can build propably any kind of config file using
95 %description scripts -l pl
96 Ten pakiet zawiera skrypty do zintegrowania LMS z systemem, naliczania
97 comiesiêcznych op³at, powiadamiania u¿ytkowników o ich zad³u¿eniu oraz
98 ich automagicznego od³±czania. Mo¿esz tak¿e zbudowaæ prawdopodobnie
99 ka¿dy typ pliku konfiguracyjnego przy u¿yciu lms-mgc;
102 Summary: LAN Managment System - sqlpanel module
103 Summary(pl): LAN Managment System - modu³ sqlpanel
104 Group: Networking/Utilities
105 Requires: %{name} = %{version}-%{release}
107 %description sqlpanel
108 SQL-panel module allows you to execute SQL queries and directly modify
111 %description sqlpanel -l pl
112 Modu³ 'SQL - panel' daje mo¿liwo¶æ bezpo¶redniego dostêpu do bazy
113 danych poprzez zadawanie zapytañ SQL. Wyniki wy¶wietlane s± w formie
114 tabeli. Ponadto podawany jest czas wykonania zapytania.
117 Summary: LAN Managment System - simple user interface
118 Summary(pl): LAN Managment System - prosty interfejs u¿ytkownika
119 Group: Networking/Utilities
120 Requires: %{name} = %{version}-%{release}
123 Simple user interface.
125 %description user -l pl
126 Prosty interfejs u¿ytkownika.
129 Summary: LAN Managment System - LMS system backend
130 Summary(pl): LAN Managment System - backend systemu LMS
131 Group: Networking/Utilities
132 Requires: %{name} = %{version}-%{release}
135 A program to manage the server by creating configuration files based
136 upon LMS database and restarting selected services.
138 %description almsd -l pl
139 Program zarz±dzaj±cy serwerem poprzez tworzenie plików
140 konfiguracyjnych na podstawie bazy danych LMS'a i restartowanie
156 ./configure --with-mysql
158 CC='%{__cc}' CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -I../..'
163 ./configure --with-pgsql
166 CFLAGS='%{rpmcflags} -fPIC -DUSE_PGSQL -I../..'
173 rm -rf $RPM_BUILD_ROOT
174 install -d $RPM_BUILD_ROOT%{_sbindir} \
175 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,httpd} \
176 $RPM_BUILD_ROOT/etc/lms/modules/{dns,ggnofity,nofity} \
177 $RPM_BUILD_ROOT{%{_lmsvar}/{backups,templates_c},/usr/lib/lms} \
178 $RPM_BUILD_ROOT%{_lmsdir}/www/{img,doc,user,calendar}
180 install *.php $RPM_BUILD_ROOT%{_lmsdir}/www
181 install img/* $RPM_BUILD_ROOT%{_lmsdir}/www/img
182 cp -r doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc
183 cp -r lib contrib modules templates sample $RPM_BUILD_ROOT%{_lmsdir}
184 mv $RPM_BUILD_ROOT%{_lmsdir}/templates/calendar.html $RPM_BUILD_ROOT%{_lmsdir}/www/calendar
185 install bin/* $RPM_BUILD_ROOT%{_sbindir}
187 install sample/%{name}.ini $RPM_BUILD_ROOT%{_sysconfdir}
188 install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
191 install contrib/sqlpanel/sql.php $RPM_BUILD_ROOT%{_lmsdir}/modules
192 install contrib/sqlpanel/*.html $RPM_BUILD_ROOT%{_lmsdir}/templates
195 install contrib/customer/* $RPM_BUILD_ROOT%{_lmsdir}/www/user
199 install daemon/almsd-* $RPM_BUILD_ROOT%{_sbindir}
200 install daemon/modules/*/*.so $RPM_BUILD_ROOT/usr/lib/lms
201 cp -r daemon/modules/dns/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/dns
202 cp -r daemon/modules/ggnotify/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/ggnotify
203 cp -r daemon/modules/dns/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/nofity
204 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/lmsd
205 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
209 rm -rf $RPM_BUILD_ROOT
212 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
213 echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
214 if [ -f /var/lock/subsys/httpd ]; then
215 /usr/sbin/apachectl restart 1>&2
217 elif [ -d /etc/httpd/httpd.conf ]; then
218 ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
219 if [ -f /var/lock/subsys/httpd ]; then
220 /usr/sbin/apachectl restart 1>&2
225 /sbin/chkconfig --add lmsd
226 if [ -f /var/lock/subsys/lmsd ]; then
227 /etc/rc.d/init.d/lmsd restart >&2
229 echo "Run \"/etc/rc.d/init.d/lmsd start\" to start almsd daemon."
233 if [ "$1" = "0" ]; then
235 if [ -d /etc/httpd/httpd.conf ]; then
236 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
238 grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
239 /etc/httpd/httpd.conf.tmp
240 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
242 if [ -f /var/lock/subsys/httpd ]; then
243 /usr/sbin/apachectl restart 1>&2
248 if [ "$1" = "0" ]; then
249 if [ -f /var/lock/subsys/lmsd ]; then
250 /etc/rc.d/init.d/lmsd stop >&2
252 /sbin/chkconfig --del lmsd
255 %triggerpostun -- %{name} <= 1.0.4
257 echo "_READ_ and upgrade LMS database:"
258 echo "MySQL: /usr/share/doc/%{name}-%{version}/UPGRADE-1.0-1.5.mysql.gz"
259 echo "PostgreSQL: /usr/share/doc/%{name}-%{version}/UPGRADE-1.0-1.5.pgsql.gz"
263 %defattr(644,root,root,755)
264 %doc doc/{AUTHORS,ChangeLog*,README,TODO,UPGRADE*,lms*}
266 %attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.ini
267 %config(noreplace) %verify(not size mtime md5) /etc/httpd/%{name}.conf
270 %attr(770,root,http) %{_lmsvar}/backups
271 %attr(770,root,http) %{_lmsvar}/templates_c
275 %exclude %{_lmsdir}/www/user
278 %exclude %{_lmsdir}/modules/sql.php
281 %attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.sh
283 %exclude %{_lmsdir}/templates/sql.html
284 %exclude %{_lmsdir}/templates/sqlprint.html
287 %defattr(644,root,root,755)
289 %attr(755,root,root) %{_sbindir}/*
292 %defattr(644,root,root,755)
293 %{_lmsdir}/modules/sql.php
294 %{_lmsdir}/templates/sql.html
295 %{_lmsdir}/templates/sqlprint.html
298 %defattr(644,root,root,755)
303 %defattr(644,root,root,755)
304 %doc daemon/{lms.ini.sample,TODO}
305 %attr(755,root,root) %{_sbindir}/almsd-*
306 %attr(755,root,root) /usr/lib/lms/*.so
307 %attr(754,root,root) /etc/rc.d/init.d/lmsd
309 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}