]>
Commit | Line | Data |
---|---|---|
64351d7b TP |
1 | # TODO: |
2 | # - package documents/templates/default | |
03d9c849 | 3 | # - cosmetics (sort in %%files and %%install) |
64351d7b | 4 | # - consider contrib and samples (re)packaging |
273010b2 | 5 | # |
6 | # Conditional build: | |
a072064c | 7 | %bcond_without lmsd # without lmsd daemon |
fe902a4b | 8 | %bcond_with lmsd_debug # with lmsd debugging |
953ccfa8 | 9 | |
aef69fa8 | 10 | %define lmsver 1.11 |
8b501fcf | 11 | %define lmssubver 13 |
22909130 | 12 | Summary: LAN Managment System |
2359e96f | 13 | Summary(pl.UTF-8): System Zarządzania Siecią Lokalną |
22909130 | 14 | Name: lms |
273010b2 | 15 | Version: %{lmsver}.%{lmssubver} |
ad976df6 | 16 | Release: 11 |
ab4f73d4 | 17 | License: GPL v2 |
22909130 | 18 | Group: Networking/Utilities |
8670b6bc | 19 | Source0: http://www.lms.org.pl/download/%{lmsver}/%{name}-%{version}.tar.gz |
8b501fcf | 20 | # Source0-md5: 294899358ae2585a4030580d79a06ee8 |
885f795c JR |
21 | Source1: %{name}.init |
22 | Source2: %{name}.sysconfig | |
23 | Source3: %{name}-apache.conf | |
24 | Source4: %{name}-httpd.conf | |
46d522a5 | 25 | Patch0: %{name}-PLD.patch |
273010b2 | 26 | Patch1: %{name}-amd64.patch |
a1016496 | 27 | Patch2: %{name}-smarty.patch |
c66e68d7 | 28 | Patch3: build.patch |
864db7d0 | 29 | URL: http://www.lms.org.pl/ |
a1016496 ER |
30 | BuildRequires: bison |
31 | BuildRequires: flex | |
a072064c | 32 | %{?with_lmsd:BuildRequires: libgadu-devel} |
33 | %{?with_lmsd:BuildRequires: mysql-devel} | |
ac37211c | 34 | BuildRequires: net-snmp-devel |
aa4cb6ed | 35 | %{?with_lmsd:BuildRequires: postgresql-devel >= 8.2} |
a1016496 | 36 | BuildRequires: rpm-pythonprov |
495cdf06 | 37 | BuildRequires: rpmbuild(macros) >= 1.461 |
ac37211c | 38 | BuildRequires: yacc |
a072064c | 39 | %{?with_lmsd:Requires(post,preun): /sbin/chkconfig} |
8670b6bc | 40 | Requires: Smarty >= 2.6.18-2 |
a335e4ed ER |
41 | Requires: php(gd) |
42 | Requires: php(iconv) | |
ddd97afb SP |
43 | Requires: php(mbstring) |
44 | Requires: php(mysql) | |
a335e4ed ER |
45 | Requires: php(pcre) |
46 | Requires: php(posix) | |
3674e9e4 | 47 | Requires: webapps |
beed63b5 SP |
48 | Requires: webserver(access) |
49 | Requires: webserver(alias) | |
a335e4ed | 50 | Requires: webserver(php) |
885f795c | 51 | Conflicts: apache-base < 2.4.0-1 |
22909130 | 52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
53 | ||
273010b2 | 54 | %define _sysconfdir /etc/%{name} |
3674e9e4 ER |
55 | %define _webapps /etc/webapps |
56 | %define _webapp %{name} | |
64351d7b TP |
57 | %define _smartyplugindir %{php_data_dir}/Smarty/plugins |
58 | %define _lmsdir %{_datadir}/%{name} | |
59 | %define _lmsvar /var/lib/%{name} | |
22909130 | 60 | |
61 | %description | |
903f9044 | 62 | This is a package of applications in PHP and Perl for managing LANs. |
273010b2 | 63 | It's using MySQL or PostgreSQL. The main goal is to get the best |
888faf4b | 64 | service of users at provider's level. The main features in LMS are: |
03d9c849 | 65 | - database of users (name, surname, address, telephone number, |
64351d7b TP |
66 | commentary), |
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, | |
2dfa4d4f | 72 | - autogenerating ipchains, iptables, dhcpd, ethers file, oidentd, |
64351d7b | 73 | openbsd packet filter configuration files/scripts, |
90b91a27 | 74 | - autogenerating almost any kind of config file using templates. |
22909130 | 75 | |
62e7c272 JR |
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 | |
57c06cb1 | 79 | osiedlowymi (popularnie zwanymi Amatorskimi Sieciami Komputerowymi), |
62e7c272 JR |
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 | |
888faf4b | 82 | providera z prawdziwego zdarzenia. Najbardziej podstawowe cechy LMS |
83 | to: | |
62e7c272 | 84 | - baza danych użytkowników (imię, nazwisko, adres, numer telefonu, |
64351d7b TP |
85 | uwagi), |
86 | - baza danych komputerów (adres IP, adres MAC), | |
57c06cb1 | 87 | - prowadzenie prostego rachunku operacji finansowych oraz stanu |
64351d7b TP |
88 | funduszów sieci, |
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, | |
62e7c272 | 93 | - generowanie reguł i plików konfiguracyjnych dla ipchains, iptables, |
64351d7b | 94 | dhcpd, oidentd, packet filtra openbsd, wpisów /etc/ethers, |
62e7c272 JR |
95 | - generowanie praktycznie każdego pliku konfiguracyjnego na podstawie |
96 | danych w bazie przy użyciu prostych szablonów. | |
22909130 | 97 | |
c339c515 ŁJM |
98 | %package scripts |
99 | Summary: LAN Managment System - scripts | |
2359e96f | 100 | Summary(pl.UTF-8): LAN Managment System - skrypty |
273010b2 | 101 | Group: Networking/Utilities |
c339c515 ŁJM |
102 | Requires: perl-Config-IniFiles |
103 | Requires: perl-DBI | |
1e7c8904 | 104 | Requires: perl-Net-SMTP-Server |
c339c515 ŁJM |
105 | |
106 | %description scripts | |
342af906 JB |
107 | This package contains scripts to integrate LMS with your system, |
108 | monthly billing, notify users about their debts and cutting off | |
03d9c849 | 109 | customers. Also you can build probably any kind of config file using |
342af906 | 110 | lms-mgc. |
c339c515 | 111 | |
62e7c272 | 112 | %description scripts -l pl.UTF-8 |
342af906 | 113 | Ten pakiet zawiera skrypty do zintegrowania LMS z systemem, naliczania |
62e7c272 JR |
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. | |
c339c515 | 117 | |
273010b2 | 118 | %package sqlpanel |
119 | Summary: LAN Managment System - sqlpanel module | |
2359e96f | 120 | Summary(pl.UTF-8): LAN Managment System - moduł sqlpanel |
273010b2 | 121 | Group: Networking/Utilities |
d0c1a05f | 122 | Requires: %{name} = %{version}-%{release} |
273010b2 | 123 | |
124 | %description sqlpanel | |
125 | SQL-panel module allows you to execute SQL queries and directly modify | |
126 | data. | |
127 | ||
62e7c272 JR |
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 | |
273010b2 | 131 | tabeli. Ponadto podawany jest czas wykonania zapytania. |
132 | ||
133 | %package user | |
134 | Summary: LAN Managment System - simple user interface | |
2359e96f | 135 | Summary(pl.UTF-8): LAN Managment System - prosty interfejs użytkownika |
273010b2 | 136 | Group: Networking/Utilities |
d0c1a05f | 137 | Requires: %{name} = %{version}-%{release} |
273010b2 | 138 | |
139 | %description user | |
140 | Simple user interface. | |
141 | ||
62e7c272 JR |
142 | %description user -l pl.UTF-8 |
143 | Prosty interfejs użytkownika. | |
273010b2 | 144 | |
a072064c | 145 | %package lmsd |
efde61fc | 146 | Summary: LAN Managment System - LMS system backend |
2359e96f | 147 | Summary(pl.UTF-8): LAN Managment System - backend systemu LMS |
273010b2 | 148 | Group: Networking/Utilities |
f856e948 JB |
149 | Requires(post,preun): /sbin/chkconfig |
150 | Requires: rc-scripts | |
09a5ca2d | 151 | Obsoletes: lms-almsd |
273010b2 | 152 | |
a072064c | 153 | %description lmsd |
d0c1a05f JB |
154 | A program to manage the server by creating configuration files based |
155 | upon LMS database and restarting selected services. | |
273010b2 | 156 | |
62e7c272 JR |
157 | %description lmsd -l pl.UTF-8 |
158 | Program zarządzający serwerem poprzez tworzenie plików | |
f856e948 | 159 | konfiguracyjnych na podstawie bazy danych LMS-a i restartowanie |
62e7c272 | 160 | wybranych usług. |
9603d008 | 161 | |
5a4bc3c7 | 162 | %package userpanel |
aa4cb6ed SP |
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} | |
5a4bc3c7 GP |
167 | |
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. | |
175 | ||
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 | |
182 | formularza przelewu. | |
183 | ||
22909130 | 184 | %prep |
342af906 | 185 | %setup -q -n %{name} |
3d829255 | 186 | %patch0 -p1 |
c7b20370 | 187 | %if "%{_lib}" == "lib64" |
273010b2 | 188 | %patch1 -p1 |
189 | %endif | |
5e115572 | 190 | %patch2 -p1 |
c66e68d7 | 191 | %patch3 -p1 |
273010b2 | 192 | |
a1016496 | 193 | mkdir smarty-plugins |
64351d7b TP |
194 | %{__mv} \ |
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 \ | |
a1016496 | 198 | smarty-plugins |
64351d7b | 199 | %{__rm} -r lib/Smarty |
a1016496 | 200 | |
953ccfa8 | 201 | # cleanup backups after patching |
64351d7b | 202 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 %{__rm} |
953ccfa8 | 203 | |
273010b2 | 204 | %build |
a072064c | 205 | %if %{with lmsd} |
273010b2 | 206 | cd daemon |
207 | ||
fe902a4b | 208 | ./configure --with-mysql %{?with_lmsd_debug:--enable-debug0 --enable-debug1} |
273010b2 | 209 | %{__make} \ |
9a9c8fa3 TO |
210 | CC='%{__cc}' \ |
211 | CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..' | |
a072064c | 212 | mv lmsd lmsd-mysql |
273010b2 | 213 | |
fe902a4b | 214 | ./configure --with-pgsql %{?with_lmsd_debug:--enable-debug0 --enable-debug1} |
a072064c | 215 | %{__make} lmsd \ |
273010b2 | 216 | CC='%{__cc}' \ |
03d9c849 | 217 | CFLAGS='%{rpmcflags} -fPIC -DUSE_PGSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..' |
a072064c | 218 | mv lmsd lmsd-pgsql |
273010b2 | 219 | |
a1c1a4be TP |
220 | CFLAGS="%{rpmcflags}" %{__make} -j1 -C modules/parser \ |
221 | CC='%{__cc}' | |
64351d7b | 222 | |
273010b2 | 223 | cd .. |
224 | %endif | |
22909130 | 225 | |
226 | %install | |
227 | rm -rf $RPM_BUILD_ROOT | |
64351d7b | 228 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/%{name},%{_webapps}/%{_webapp}} \ |
183a276d | 229 | $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,lms/modules} \ |
64351d7b TP |
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} | |
233 | ||
234 | cp -a *.php img $RPM_BUILD_ROOT%{_lmsdir}/www | |
a1016496 | 235 | cp -a doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc |
64351d7b | 236 | cp -a contrib lib modules sample templates $RPM_BUILD_ROOT%{_lmsdir} |
a1016496 | 237 | cp -a smarty-plugins/* $RPM_BUILD_ROOT%{_smartyplugindir} |
64351d7b | 238 | cp -a bin/* $RPM_BUILD_ROOT%{_sbindir} |
273010b2 | 239 | |
64351d7b | 240 | %{__mv} $RPM_BUILD_ROOT{%{_lmsdir}/sample/%{name}.ini,%{_sysconfdir}} |
3674e9e4 | 241 | |
885f795c JR |
242 | install %{SOURCE3} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
243 | install %{SOURCE4} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
273010b2 | 244 | |
245 | # sqlpanel | |
64351d7b TP |
246 | %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/sql*.php,modules} |
247 | %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/*.html,templates} | |
273010b2 | 248 | |
249 | # user | |
64351d7b | 250 | %{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/customer/*,www/user} |
273010b2 | 251 | |
252 | # daemon | |
a072064c | 253 | %if %{with lmsd} |
64351d7b TP |
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 | |
258 | done | |
885f795c JR |
259 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/lmsd |
260 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
273010b2 | 261 | %endif |
22909130 | 262 | |
5a4bc3c7 | 263 | #userpanel |
64351d7b TP |
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 | |
5a4bc3c7 GP |
268 | |
269 | for MODULE in $RPM_BUILD_ROOT%{_lmsdir}/userpanel/modules/*; do | |
64351d7b TP |
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 | |
5a4bc3c7 GP |
274 | done |
275 | ||
22909130 | 276 | %clean |
277 | rm -rf $RPM_BUILD_ROOT | |
278 | ||
a072064c | 279 | %post lmsd |
273010b2 | 280 | /sbin/chkconfig --add lmsd |
d5c71495 | 281 | %service lmsd restart "lmsd daemon" |
273010b2 | 282 | |
a072064c | 283 | %preun lmsd |
273010b2 | 284 | if [ "$1" = "0" ]; then |
d5c71495 | 285 | %service lmsd stop |
273010b2 | 286 | /sbin/chkconfig --del lmsd |
287 | fi | |
288 | ||
3d0148ce | 289 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
3674e9e4 ER |
290 | %webapp_register apache %{_webapp} |
291 | ||
3d0148ce | 292 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
3674e9e4 ER |
293 | %webapp_unregister apache %{_webapp} |
294 | ||
885f795c | 295 | %triggerin -- apache-base |
3674e9e4 ER |
296 | %webapp_register httpd %{_webapp} |
297 | ||
885f795c | 298 | %triggerun -- apache-base |
3674e9e4 ER |
299 | %webapp_unregister httpd %{_webapp} |
300 | ||
22909130 | 301 | %files |
302 | %defattr(644,root,root,755) | |
ab4f73d4 | 303 | %doc doc/{AUTHORS,ChangeLog,INSTALL,README*,lms*} |
273010b2 | 304 | %dir %{_sysconfdir} |
1e7c8904 | 305 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.ini |
3674e9e4 ER |
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 | |
64351d7b | 309 | %{_smartyplugindir}/*.php |
273010b2 | 310 | # |
311 | %dir %{_lmsvar} | |
312 | %attr(770,root,http) %{_lmsvar}/backups | |
726bd551 | 313 | %attr(770,root,http) %{_lmsvar}/documents |
64351d7b | 314 | %attr(770,root,http) %{_lmsvar}/templates_c |
273010b2 | 315 | # |
22909130 | 316 | %dir %{_lmsdir} |
273010b2 | 317 | %{_lmsdir}/lib |
318 | %{_lmsdir}/modules | |
319 | %exclude %{_lmsdir}/modules/sql.php | |
64351d7b TP |
320 | %exclude %{_lmsdir}/modules/sqllang.php |
321 | %{_lmsdir}/templates | |
322 | %exclude %{_lmsdir}/templates/sql.html | |
323 | %exclude %{_lmsdir}/templates/sqlprint.html | |
324 | %{_lmsdir}/www | |
325 | %exclude %{_lmsdir}/www/user | |
326 | %exclude %{_lmsdir}/www/userpanel | |
273010b2 | 327 | %{_lmsdir}/contrib |
aed1f328 ER |
328 | %dir %{_lmsdir}/sample |
329 | %{_lmsdir}/sample/crontab-entry | |
64351d7b TP |
330 | %{_lmsdir}/sample/lms-mgc*.ini |
331 | %{_lmsdir}/sample/*.conf | |
332 | %{_lmsdir}/sample/*.txt | |
aed1f328 ER |
333 | %{_lmsdir}/sample/rc.lmsd |
334 | %{_lmsdir}/sample/rc.reminder_1st | |
b4677ec9 | 335 | %attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.pl |
aed1f328 | 336 | |
c339c515 | 337 | %files scripts |
342af906 | 338 | %defattr(644,root,root,755) |
64351d7b | 339 | %attr(755,root,root) %{_sbindir}/lms-* |
273010b2 | 340 | |
341 | %files sqlpanel | |
342 | %defattr(644,root,root,755) | |
343 | %{_lmsdir}/modules/sql.php | |
64351d7b | 344 | %{_lmsdir}/modules/sqllang.php |
273010b2 | 345 | %{_lmsdir}/templates/sql.html |
346 | %{_lmsdir}/templates/sqlprint.html | |
347 | ||
348 | %files user | |
349 | %defattr(644,root,root,755) | |
350 | %{_lmsdir}/www/user | |
351 | ||
a072064c | 352 | %if %{with lmsd} |
353 | %files lmsd | |
273010b2 | 354 | %defattr(644,root,root,755) |
b0f05b97 | 355 | %attr(755,root,root) %{_sbindir}/lmsd-*sql |
f856e948 JB |
356 | %dir %{_libdir}/lms |
357 | %attr(755,root,root) %{_libdir}/lms/*.so | |
273010b2 | 358 | %attr(754,root,root) /etc/rc.d/init.d/lmsd |
f856e948 JB |
359 | # XXX: dir shared with base |
360 | %dir %{_sysconfdir} | |
361 | %dir %{_sysconfdir}/modules | |
362 | %{_sysconfdir}/modules/* | |
273010b2 | 363 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
364 | %endif | |
5a4bc3c7 GP |
365 | |
366 | %files userpanel | |
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 | |
a937c8d2 | 378 | %attr(770,root,http) %{_lmsvar}/userpanel/templates_c |