]> git.pld-linux.org Git - packages/lms.git/blame - lms.spec
rebuild with openssl 3.0.0
[packages/lms.git] / lms.spec
CommitLineData
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 12Summary: LAN Managment System
2359e96f 13Summary(pl.UTF-8): System Zarządzania Siecią Lokalną
22909130 14Name: lms
273010b2 15Version: %{lmsver}.%{lmssubver}
697cbfba 16Release: 13
ab4f73d4 17License: GPL v2
22909130 18Group: Networking/Utilities
8670b6bc 19Source0: http://www.lms.org.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
8b501fcf 20# Source0-md5: 294899358ae2585a4030580d79a06ee8
885f795c
JR
21Source1: %{name}.init
22Source2: %{name}.sysconfig
23Source3: %{name}-apache.conf
24Source4: %{name}-httpd.conf
46d522a5 25Patch0: %{name}-PLD.patch
273010b2 26Patch1: %{name}-amd64.patch
a1016496 27Patch2: %{name}-smarty.patch
c66e68d7 28Patch3: build.patch
864db7d0 29URL: http://www.lms.org.pl/
a1016496
ER
30BuildRequires: bison
31BuildRequires: flex
a072064c 32%{?with_lmsd:BuildRequires: libgadu-devel}
33%{?with_lmsd:BuildRequires: mysql-devel}
ac37211c 34BuildRequires: net-snmp-devel
aa4cb6ed 35%{?with_lmsd:BuildRequires: postgresql-devel >= 8.2}
a1016496 36BuildRequires: rpm-pythonprov
495cdf06 37BuildRequires: rpmbuild(macros) >= 1.461
b5c8534d 38BuildRequires: sed >= 4.0
a072064c 39%{?with_lmsd:Requires(post,preun): /sbin/chkconfig}
8670b6bc 40Requires: Smarty >= 2.6.18-2
a335e4ed
ER
41Requires: php(gd)
42Requires: php(iconv)
ddd97afb
SP
43Requires: php(mbstring)
44Requires: php(mysql)
a335e4ed
ER
45Requires: php(pcre)
46Requires: php(posix)
3674e9e4 47Requires: webapps
beed63b5
SP
48Requires: webserver(access)
49Requires: webserver(alias)
a335e4ed 50Requires: webserver(php)
885f795c 51Conflicts: apache-base < 2.4.0-1
22909130 52BuildRoot: %{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 62This is a package of applications in PHP and Perl for managing LANs.
273010b2 63It's using MySQL or PostgreSQL. The main goal is to get the best
888faf4b 64service 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
78aplikacji w PHP i Perlu, ułatwiających zarządzanie sieciami
57c06cb1 79osiedlowymi (popularnie zwanymi Amatorskimi Sieciami Komputerowymi),
62e7c272
JR
80opartych o bazę danych MySQL lub PostgreSQL. Główne założenia to
81uzyskanie jakości usług oraz obsługi użytkowników na poziomie
888faf4b 82providera z prawdziwego zdarzenia. Najbardziej podstawowe cechy LMS
83to:
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
99Summary: LAN Managment System - scripts
2359e96f 100Summary(pl.UTF-8): LAN Managment System - skrypty
273010b2 101Group: Networking/Utilities
c339c515
ŁJM
102Requires: perl-Config-IniFiles
103Requires: perl-DBI
1e7c8904 104Requires: perl-Net-SMTP-Server
c339c515
ŁJM
105
106%description scripts
342af906
JB
107This package contains scripts to integrate LMS with your system,
108monthly billing, notify users about their debts and cutting off
03d9c849 109customers. Also you can build probably any kind of config file using
342af906 110lms-mgc.
c339c515 111
62e7c272 112%description scripts -l pl.UTF-8
342af906 113Ten pakiet zawiera skrypty do zintegrowania LMS z systemem, naliczania
62e7c272
JR
114comiesięcznych opłat, powiadamiania użytkowników o ich zadłużeniu oraz
115ich automagicznego odłączania. Możesz także zbudować prawdopodobnie
116każdy typ pliku konfiguracyjnego przy użyciu lms-mgc.
c339c515 117
273010b2 118%package sqlpanel
119Summary: LAN Managment System - sqlpanel module
2359e96f 120Summary(pl.UTF-8): LAN Managment System - moduł sqlpanel
273010b2 121Group: Networking/Utilities
d0c1a05f 122Requires: %{name} = %{version}-%{release}
273010b2 123
124%description sqlpanel
125SQL-panel module allows you to execute SQL queries and directly modify
126data.
127
62e7c272
JR
128%description sqlpanel -l pl.UTF-8
129Moduł 'SQL - panel' daje możliwość bezpośredniego dostępu do bazy
130danych poprzez zadawanie zapytań SQL. Wyniki wyświetlane są w formie
273010b2 131tabeli. Ponadto podawany jest czas wykonania zapytania.
132
133%package user
134Summary: LAN Managment System - simple user interface
2359e96f 135Summary(pl.UTF-8): LAN Managment System - prosty interfejs użytkownika
273010b2 136Group: Networking/Utilities
d0c1a05f 137Requires: %{name} = %{version}-%{release}
273010b2 138
139%description user
140Simple user interface.
141
62e7c272
JR
142%description user -l pl.UTF-8
143Prosty interfejs użytkownika.
273010b2 144
a072064c 145%package lmsd
efde61fc 146Summary: LAN Managment System - LMS system backend
2359e96f 147Summary(pl.UTF-8): LAN Managment System - backend systemu LMS
273010b2 148Group: Networking/Utilities
f856e948
JB
149Requires(post,preun): /sbin/chkconfig
150Requires: rc-scripts
09a5ca2d 151Obsoletes: lms-almsd
273010b2 152
a072064c 153%description lmsd
d0c1a05f
JB
154A program to manage the server by creating configuration files based
155upon LMS database and restarting selected services.
273010b2 156
62e7c272
JR
157%description lmsd -l pl.UTF-8
158Program zarządzający serwerem poprzez tworzenie plików
f856e948 159konfiguracyjnych na podstawie bazy danych LMS-a i restartowanie
62e7c272 160wybranych usług.
9603d008 161
5a4bc3c7 162%package userpanel
aa4cb6ed
SP
163Summary: LAN Managment System - Userpanel
164Summary(pl.UTF-8): System Zarządzania Siecią Lokalną - Panel Użytkownika
165Group: Networking/Utilities
166Requires: %{name} = %{version}-%{release}
5a4bc3c7
GP
167
168%description userpanel
169Userpanel is automated virtual customer service, based on LMS and
170using its core features. It enables customers (or it's intended to) to
171do review their payments, change their personal details or computer
172properties, modify subscriptions, submit problems, track their
173requests on Helpdesk and print invoices. It means, it makes a closer
174contact with their ISP.
175
176%description userpanel -l pl.UTF-8
177Userpanel jest opartą na szkielecie LMS (i ściśle z LMS
178współpracującą) implementacją tzw. e-boku. Umożliwia (albo będzie
179umożliwiał) klientom przeglądanie stanu swoich wpłat, zmianę swoich
180danych osobowych, edycję właściwości swoich komputerów, zmianę taryf,
181zgłaszanie błędów oraz awarii do Helpdesku, wydruk faktur oraz
182formularza 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
b5c8534d
JB
193%{__sed} -i -e '1s,/usr/bin/python$,%{__python},' contrib/LMS2Nagios/nagios-v6-{check,gen}.py
194
a1016496 195mkdir smarty-plugins
64351d7b
TP
196%{__mv} \
197 lib/Smarty/plugins/block.t.php \
198 lib/Smarty/plugins/function.{bankaccount,gentime,handle,memory,number,size,sum,tip}.php \
199 lib/Smarty/plugins/modifier.{money_format,striphtml,to_words}.php \
a1016496 200 smarty-plugins
64351d7b 201%{__rm} -r lib/Smarty
a1016496 202
953ccfa8 203# cleanup backups after patching
64351d7b 204find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 %{__rm}
953ccfa8 205
273010b2 206%build
a072064c 207%if %{with lmsd}
273010b2 208cd daemon
209
fe902a4b 210./configure --with-mysql %{?with_lmsd_debug:--enable-debug0 --enable-debug1}
273010b2 211%{__make} \
9a9c8fa3
TO
212 CC='%{__cc}' \
213 CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
b5c8534d 214%{__mv} lmsd lmsd-mysql
273010b2 215
fe902a4b 216./configure --with-pgsql %{?with_lmsd_debug:--enable-debug0 --enable-debug1}
a072064c 217%{__make} lmsd \
273010b2 218 CC='%{__cc}' \
03d9c849 219 CFLAGS='%{rpmcflags} -fPIC -DUSE_PGSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
b5c8534d 220%{__mv} lmsd lmsd-pgsql
273010b2 221
a1c1a4be
TP
222CFLAGS="%{rpmcflags}" %{__make} -j1 -C modules/parser \
223 CC='%{__cc}'
64351d7b 224
273010b2 225cd ..
226%endif
22909130 227
228%install
229rm -rf $RPM_BUILD_ROOT
64351d7b 230install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/%{name},%{_webapps}/%{_webapp}} \
183a276d 231 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,lms/modules} \
64351d7b
TP
232 $RPM_BUILD_ROOT%{_smartyplugindir} \
233 $RPM_BUILD_ROOT%{_lmsdir}/{lms,userpanel,www/{doc,user,userpanel/modules}} \
234 $RPM_BUILD_ROOT%{_lmsvar}/{backups,documents,templates_c,userpanel/templates_c}
235
236cp -a *.php img $RPM_BUILD_ROOT%{_lmsdir}/www
a1016496 237cp -a doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc
64351d7b 238cp -a contrib lib modules sample templates $RPM_BUILD_ROOT%{_lmsdir}
a1016496 239cp -a smarty-plugins/* $RPM_BUILD_ROOT%{_smartyplugindir}
64351d7b 240cp -a bin/* $RPM_BUILD_ROOT%{_sbindir}
273010b2 241
64351d7b 242%{__mv} $RPM_BUILD_ROOT{%{_lmsdir}/sample/%{name}.ini,%{_sysconfdir}}
3674e9e4 243
885f795c
JR
244install %{SOURCE3} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
245install %{SOURCE4} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
273010b2 246
247# sqlpanel
64351d7b
TP
248%{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/sql*.php,modules}
249%{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/sqlpanel/*.html,templates}
273010b2 250
251# user
64351d7b 252%{__mv} $RPM_BUILD_ROOT%{_lmsdir}/{contrib/customer/*,www/user}
273010b2 253
254# daemon
a072064c 255%if %{with lmsd}
64351d7b
TP
256install daemon/lmsd-*sql $RPM_BUILD_ROOT%{_sbindir}
257install daemon/modules/*/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}
258for module in dns ggnotify notify; do
259 cp -a daemon/modules/$module/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/$module
260done
885f795c
JR
261install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/lmsd
262install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
273010b2 263%endif
22909130 264
5a4bc3c7 265#userpanel
64351d7b
TP
266cp -a userpanel/{lib,modules,templates} $RPM_BUILD_ROOT%{_lmsdir}/userpanel
267cp -a userpanel/{index.php,style} $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel
268ln -s %{_lmsdir}/www/userpanel/style $RPM_BUILD_ROOT%{_lmsdir}/userpanel
269ln -s %{_lmsvar}/userpanel/templates_c $RPM_BUILD_ROOT%{_lmsdir}/userpanel
5a4bc3c7
GP
270
271for MODULE in $RPM_BUILD_ROOT%{_lmsdir}/userpanel/modules/*; do
64351d7b
TP
272 MODULE=$(basename $MODULE)
273 mkdir $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE
274 ln -s %{_lmsdir}/userpanel/modules/$MODULE/style \
275 $RPM_BUILD_ROOT%{_lmsdir}/www/userpanel/modules/$MODULE
5a4bc3c7
GP
276done
277
22909130 278%clean
279rm -rf $RPM_BUILD_ROOT
280
a072064c 281%post lmsd
273010b2 282/sbin/chkconfig --add lmsd
d5c71495 283%service lmsd restart "lmsd daemon"
273010b2 284
a072064c 285%preun lmsd
273010b2 286if [ "$1" = "0" ]; then
d5c71495 287 %service lmsd stop
273010b2 288 /sbin/chkconfig --del lmsd
289fi
290
3d0148ce 291%triggerin -- apache1 < 1.3.37-3, apache1-base
3674e9e4
ER
292%webapp_register apache %{_webapp}
293
3d0148ce 294%triggerun -- apache1 < 1.3.37-3, apache1-base
3674e9e4
ER
295%webapp_unregister apache %{_webapp}
296
885f795c 297%triggerin -- apache-base
3674e9e4
ER
298%webapp_register httpd %{_webapp}
299
885f795c 300%triggerun -- apache-base
3674e9e4
ER
301%webapp_unregister httpd %{_webapp}
302
22909130 303%files
304%defattr(644,root,root,755)
ab4f73d4 305%doc doc/{AUTHORS,ChangeLog,INSTALL,README*,lms*}
273010b2 306%dir %{_sysconfdir}
1e7c8904 307%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.ini
3674e9e4
ER
308%dir %attr(750,root,http) %{_webapps}/%{_webapp}
309%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
310%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
64351d7b 311%{_smartyplugindir}/*.php
273010b2 312#
313%dir %{_lmsvar}
314%attr(770,root,http) %{_lmsvar}/backups
726bd551 315%attr(770,root,http) %{_lmsvar}/documents
64351d7b 316%attr(770,root,http) %{_lmsvar}/templates_c
273010b2 317#
22909130 318%dir %{_lmsdir}
273010b2 319%{_lmsdir}/lib
320%{_lmsdir}/modules
321%exclude %{_lmsdir}/modules/sql.php
64351d7b
TP
322%exclude %{_lmsdir}/modules/sqllang.php
323%{_lmsdir}/templates
324%exclude %{_lmsdir}/templates/sql.html
325%exclude %{_lmsdir}/templates/sqlprint.html
326%{_lmsdir}/www
327%exclude %{_lmsdir}/www/user
328%exclude %{_lmsdir}/www/userpanel
273010b2 329%{_lmsdir}/contrib
aed1f328
ER
330%dir %{_lmsdir}/sample
331%{_lmsdir}/sample/crontab-entry
64351d7b
TP
332%{_lmsdir}/sample/lms-mgc*.ini
333%{_lmsdir}/sample/*.conf
334%{_lmsdir}/sample/*.txt
aed1f328
ER
335%{_lmsdir}/sample/rc.lmsd
336%{_lmsdir}/sample/rc.reminder_1st
b4677ec9 337%attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.pl
aed1f328 338
c339c515 339%files scripts
342af906 340%defattr(644,root,root,755)
64351d7b 341%attr(755,root,root) %{_sbindir}/lms-*
273010b2 342
343%files sqlpanel
344%defattr(644,root,root,755)
345%{_lmsdir}/modules/sql.php
64351d7b 346%{_lmsdir}/modules/sqllang.php
273010b2 347%{_lmsdir}/templates/sql.html
348%{_lmsdir}/templates/sqlprint.html
349
350%files user
351%defattr(644,root,root,755)
352%{_lmsdir}/www/user
353
a072064c 354%if %{with lmsd}
355%files lmsd
273010b2 356%defattr(644,root,root,755)
b0f05b97 357%attr(755,root,root) %{_sbindir}/lmsd-*sql
f856e948
JB
358%dir %{_libdir}/lms
359%attr(755,root,root) %{_libdir}/lms/*.so
273010b2 360%attr(754,root,root) /etc/rc.d/init.d/lmsd
f856e948
JB
361# XXX: dir shared with base
362%dir %{_sysconfdir}
363%dir %{_sysconfdir}/modules
364%{_sysconfdir}/modules/*
273010b2 365%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
366%endif
5a4bc3c7
GP
367
368%files userpanel
369%defattr(644,root,root,755)
370%dir %{_lmsdir}/userpanel
371%{_lmsdir}/userpanel/lib
372%{_lmsdir}/userpanel/modules
373%{_lmsdir}/userpanel/templates
374%{_lmsdir}/userpanel/templates_c
375%{_lmsdir}/userpanel/style
376%dir %{_lmsdir}/www/userpanel
377%{_lmsdir}/www/userpanel/style
378%{_lmsdir}/www/userpanel/index.php
379%dir %{_lmsvar}/userpanel
a937c8d2 380%attr(770,root,http) %{_lmsvar}/userpanel/templates_c
This page took 0.103464 seconds and 4 git commands to generate.