# Conditional build:
%bcond_without lmsd # without lmsd daemon
#
-%define lmsver 1.9
-%define lmssubver 5
+%define lmsver 1.11
+%define lmssubver 10
Summary: LAN Managment System
Summary(pl.UTF-8): System Zarządzania Siecią Lokalną
Name: lms
Version: %{lmsver}.%{lmssubver}
-Release: 1
+Release: 2
License: GPL v2
Group: Networking/Utilities
-Source0: http://lms.org.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
-# Source0-md5: f3d0284b3f2028ba74d2b8c3f52897cb
+Source0: http://www.lms.org.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
+# Source0-md5: d3b2d755b10812a06b0989a82bcd950e
Source1: %{name}.conf
Source2: %{name}.init
Source3: %{name}.sysconfig
Patch0: %{name}-PLD.patch
Patch1: %{name}-amd64.patch
Patch2: %{name}-smarty.patch
-URL: http://lms.org.pl/
+URL: http://www.lms.org.pl/
BuildRequires: bison
BuildRequires: flex
%{?with_lmsd:BuildRequires: libgadu-devel}
%{?with_lmsd:BuildRequires: mysql-devel}
+BuildRequires: net-snmp-devel
%{?with_lmsd:BuildRequires: postgresql-devel}
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: rpmbuild(macros) >= 1.461
+BuildRequires: yacc
%{?with_lmsd:Requires(post,preun): /sbin/chkconfig}
-Requires: Smarty >= 2.6.10-4
+Requires: Smarty >= 2.6.18-2
Requires: php(gd)
Requires: php(iconv)
+Requires: php(mbstring)
+Requires: php(mysql)
Requires: php(pcre)
Requires: php(posix)
Requires: webapps
+Requires: webserver(access)
+Requires: webserver(alias)
Requires: webserver(php)
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _sysconfdir /etc/%{name}
%define _lmsdir %{_datadir}/%{name}
%define _lmsvar /var/lib/%{name}
-%define _smartyplugindir /usr/share/php/Smarty/plugins
+%define _smartyplugindir %{php_data_dir}/Smarty/plugins
%define _webapps /etc/webapps
%define _webapp %{name}
%if "%{_lib}" == "lib64"
%patch1 -p1
%endif
+%patch2 -p1
mkdir smarty-plugins
mv \
lib/Smarty/plugins/block.t.php \
-lib/Smarty/plugins/function.{bankaccount,handle,number,size,sum,tip}.php \
+lib/Smarty/plugins/function.{bankaccount,gentime,handle,number,size,sum,tip}.php \
lib/Smarty/plugins/modifier.{money_format,striphtml,to_words}.php \
smarty-plugins
rm -rf lib/Smarty
%triggerun -- apache < 2.2.0, apache-base
%webapp_unregister httpd %{_webapp}
-%triggerpostun -- %{name} <= 1.0.4
-echo "WARNING!!!"
-echo "_READ_ and upgrade LMS database:"
-echo "MySQL: /usr/share/doc/%{name}-%{version}/UPGRADE-1.0-1.5.mysql.gz"
-echo "PostgreSQL: /usr/share/doc/%{name}-%{version}/UPGRADE-1.0-1.5.pgsql.gz"
-
-%triggerpostun -- %{name} <= 1.2.0
-echo "BEWARE:"
-echo "Automatic upgrade from LMS<= 1.2.0 is NO LONGER SUPPORTED by lms team"
-echo "You are advised to upgrade it manually"
-echo
-
-%triggerpostun -- %{name} < 1.6.6-1.4
-# nuke very-old config location (this mostly for Ra)
-if [ -f /etc/httpd/httpd.conf ]; then
- sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
-fi
-
-# migrate from httpd (apache2) config dir
-if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
- cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
- mv -f /etc/httpd/%{name}.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
-fi
-
-rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-/usr/sbin/webapp register httpd %{_webapp}
-%service -q httpd reload
-
%files
%defattr(644,root,root,755)
%doc doc/{AUTHORS,ChangeLog,INSTALL,README*,lms*}