# Conditional build:
%bcond_without lmsd # without lmsd daemon
#
-%define lmsver 1.6
-%define lmssubver 6
+%define lmsver 1.8
+%define lmssubver 0
Summary: LAN Managment System
Summary(pl): System Zarz±dzania Sieci± Lokaln±
Name: lms
Version: %{lmsver}.%{lmssubver}
-Release: 2
-License: GPL
-Vendor: LMS Developers
+Release: 1
+License: GPL v2
Group: Networking/Utilities
Source0: http://lms.rulez.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
-# Source0-md5: 8500349fc938d66504dca033abc3a5f5
+# Source0-md5: afa0680e112dc14c4fbb41d9ec2eedee
Source1: %{name}.conf
Source2: %{name}.init
Source3: %{name}.sysconfig
%{?with_lmsd:BuildRequires: libgadu-devel}
%{?with_lmsd:BuildRequires: mysql-devel}
%{?with_lmsd:BuildRequires: postgresql-devel}
+BuildRequires: rpmbuild(macros) >= 1.268
%{?with_lmsd:Requires(post,preun): /sbin/chkconfig}
-Requires: Smarty >= 2.6.2
+Requires: Smarty >= 2.6.10-4
Requires: php
Requires: php-gd
Requires: php-iconv
Requires: php-pcre
Requires: php-posix
-%{?with_lmsd:Requires: rc-scripts}
Requires: webapps
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Summary: LAN Managment System - LMS system backend
Summary(pl): LAN Managment System - backend systemu LMS
Group: Networking/Utilities
-Requires: %{name} = %{version}-%{release}
+Requires(post,preun): /sbin/chkconfig
+Requires: rc-scripts
Obsoletes: lms-almsd
%description lmsd
%description lmsd -l pl
Program zarz±dzaj±cy serwerem poprzez tworzenie plików
-konfiguracyjnych na podstawie bazy danych LMS'a i restartowanie
+konfiguracyjnych na podstawie bazy danych LMS-a i restartowanie
wybranych us³ug.
%prep
./configure --with-mysql
%{__make} \
- CC='%{__cc}' CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
+ CC='%{__cc}' \
+ CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -DLMS_LIB_DIR=\"%{_libdir}/lms/\" -I../..'
mv lmsd lmsd-mysql
./configure --with-pgsql
install -d $RPM_BUILD_ROOT%{_sbindir} \
$RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
$RPM_BUILD_ROOT/etc/lms/modules/{dns,ggnofity,nofity} \
- $RPM_BUILD_ROOT{%{_lmsvar}/{backups,templates_c},%{_libdir}/lms} \
+ $RPM_BUILD_ROOT{%{_lmsvar}/{backups,templates_c,documents},%{_libdir}/lms} \
$RPM_BUILD_ROOT%{_lmsdir}/www/{img,doc,user}
install *.php $RPM_BUILD_ROOT%{_lmsdir}/www
%post lmsd
/sbin/chkconfig --add lmsd
-if [ -f /var/lock/subsys/lmsd ]; then
- /etc/rc.d/init.d/lmsd restart >&2
-else
- echo "Run \"/etc/rc.d/init.d/lmsd start\" to start lmsd daemon."
-fi
+%service lmsd restart "lmsd daemon"
%preun lmsd
if [ "$1" = "0" ]; then
- if [ -f /var/lock/subsys/lmsd ]; then
- /etc/rc.d/init.d/lmsd stop >&2
- fi
+ %service lmsd stop
/sbin/chkconfig --del lmsd
fi
%triggerun -- apache1
%webapp_unregister apache %{_webapp}
-%triggerin -- apache >= 2.0.0
+%triggerin -- apache < 2.2.0, apache-base
%webapp_register httpd %{_webapp}
-%triggerun -- apache >= 2.0.0
+%triggerun -- apache < 2.2.0, apache-base
%webapp_unregister httpd %{_webapp}
%triggerpostun -- %{name} <= 1.0.4
%files
%defattr(644,root,root,755)
-%doc doc/{AUTHORS,ChangeLog*,INSTALL,README,UPGRADE*,lms*}
+%doc doc/{AUTHORS,ChangeLog,INSTALL,README*,lms*}
%dir %{_sysconfdir}
%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.ini
%dir %attr(750,root,http) %{_webapps}/%{_webapp}
%dir %{_lmsvar}
%attr(770,root,http) %{_lmsvar}/backups
%attr(770,root,http) %{_lmsvar}/templates_c
+%attr(770,root,http) %{_lmsvar}/documents
#
%dir %{_lmsdir}
%{_lmsdir}/www
%files scripts
%defattr(644,root,root,755)
-%dir %{_sbindir}
%attr(755,root,root) %{_sbindir}/*
%files sqlpanel
%files lmsd
%defattr(644,root,root,755)
%attr(755,root,root) %{_sbindir}/lmsd-*
+%dir %{_libdir}/lms
%attr(755,root,root) %{_libdir}/lms/*.so
%attr(754,root,root) /etc/rc.d/init.d/lmsd
-/etc/lms/modules/*
+# XXX: dir shared with base
+%dir %{_sysconfdir}
+%dir %{_sysconfdir}/modules
+%{_sysconfdir}/modules/*
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
%endif