]> git.pld-linux.org Git - packages/lms.git/commitdiff
- updated to 1.4.0 auto/ac/lms-1_4_0-0_1
authoraverne <averne@pld-linux.org>
Fri, 15 Oct 2004 14:18:30 +0000 (14:18 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    lms.spec -> 1.34

lms.spec

index 45062557fcaee4913aeab4f1be25693d41af0628..1f11331c37088b4675212b8ff58f0d78ee29b73d 100644 (file)
--- a/lms.spec
+++ b/lms.spec
@@ -1,32 +1,49 @@
+#
+# Conditional build:
+%bcond_without almsd           # without almsd daemon
+#
+# TODO:
+# - almsd description
+# - cosmetics (sort in %%files and %%install)
+# - contrib split
+%define                lmsver          1.4
+%define                lmssubver       0
 Summary:       LAN Managment System
 Summary(pl):   System Zarz±dzania Sieci± Lokaln±
 Name:          lms
-Version:       1.0.4
-Release:       2
+Version:       %{lmsver}.%{lmssubver}
+Release:       0.1
 License:       GPL
 Vendor:                LMS Developers
 Group:         Networking/Utilities
-Source0:       http://lms.rulez.pl/download/%{name}-%{version}.tar.gz
-# Source0-md5: 1481b7b7b8c14a739ce38f14c1fd2aeb
+Source0:       http://lms.rulez.pl/download/%{lmsver}/%{name}-%{version}.tar.gz
+# Source0-md5: e43e0aa0dacaed71987839c7da3dd7d8
+Source1:       %{name}.conf
+Source2:       %{name}.init
+Source3:       %{name}.sysconfig
 Patch0:                %{name}-PLD.patch
+Patch1:                %{name}-amd64.patch
 URL:           http://lms.rulez.pl/
+%{?with_almsd:BuildRequires:   libgadu-devel}
+%{?with_almsd:BuildRequires:   mysql-devel}
+%{?with_almsd:BuildRequires:   postgresql-devel}
+%{?with_almsd:PreReq:          rc-scripts}
+%{?with_almsd:Requires(post,preun):    /sbin/chkconfig}
 Requires:      php
+Requires:      php-gd
 Requires:      php-posix
 Requires:      php-pcre
 Requires:      webserver
 Requires:      Smarty >= 2.5.0
-Requires:      adodb >= 2.90
-BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _lmsdir         /home/services/httpd/html/%{name}
-%define                _sharedstatedir /var/lib
-# when spec'll be finished, this should go to RA-branch
-# because sharedstatedir is already defined at rpm macros from HEAD
+%define                _sysconfdir     /etc/%{name}
+%define                _lmsdir         %{_datadir}/%{name}
+%define                _lmsvar         /var/lib/%{name}
 
 %description
 This is a package of applications in PHP and Perl for managing LANs.
-It's using MySQL or PostgreSQL. The main goal is to get the best 
+It's using MySQL or PostgreSQL. The main goal is to get the best
 service of users at provider's level. The main features in LMS are:
 - database of users (name, surname, address, telefon number,
   commentary);
@@ -64,11 +81,10 @@ to:
 %package scripts
 Summary:       LAN Managment System - scripts
 Summary(pl):   LAN Managment System - skrypty
+Group:         Networking/Utilities
 Requires:      perl-Net-SMTP-Server
 Requires:      perl-Config-IniFiles
 Requires:      perl-DBI
-BuildArch:     noarch
-Group:         Networking/Utilities
 
 %description scripts
 This package contains scripts to integrate LMS with your system,
@@ -82,46 +98,204 @@ comiesi
 ich automagicznego od³±czania. Mo¿esz tak¿e zbudowaæ prawdopodobnie
 ka¿dy typ pliku konfiguracyjnego przy u¿yciu lms-mgc;
 
+%package sqlpanel
+Summary:       LAN Managment System - sqlpanel module
+Summary(pl):   LAN Managment System - modu³ sqlpanel
+Group:         Networking/Utilities
+Requires:      %{name}
+
+%description sqlpanel
+SQL-panel module allows you to execute SQL queries and directly modify
+data.
+
+%description sqlpanel -l pl
+Modu³ 'SQL - panel' daje mo¿liwo¶æ bezpo¶redniego dostêpu do bazy
+danych poprzez zadawanie zapytañ SQL. Wyniki wy¶wietlane s± w formie
+tabeli. Ponadto podawany jest czas wykonania zapytania.
+
+%package user
+Summary:       LAN Managment System - simple user interface
+Summary(pl):   LAN Managment System - prosty interfejs u¿ytkownika
+Group:         Networking/Utilities
+Requires:      %{name}
+
+%description user
+Simple user interface.
+
+%description user -l pl
+Prosty interfejs u¿ytkownika.
+
+%package almsd
+Summary:       LAN Managment System - almsd
+Group:         Networking/Utilities
+Requires:      %{name}
+
+%description almsd
+TODO
+
 %prep
 %setup -q -n %{name}
 %patch0 -p1
+%ifarch amd64
+%patch1 -p1
+%endif
+
+%build
+%if %{with almsd}
+
+cd daemon
+
+./configure --with-mysql
+%{__make} \
+       CC='%{__cc}' CFLAGS='%{rpmcflags} -fPIC -DUSE_MYSQL -I../..'
+mv almsd almsd-mysql
+
+rm db.o
+
+./configure --with-pgsql
+%{__make} almsd \
+       CC='%{__cc}' \
+       CFLAGS='%{rpmcflags} -fPIC -DUSE_PGSQL -I../..'
+mv almsd almsd-pgsql
+
+cd ..
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_lmsdir}/img
-install -d $RPM_BUILD_ROOT%{_bindir}
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
-install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/{backups,templates_c}
-install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/{lib,modules,templates}
-
-install *.php $RPM_BUILD_ROOT%{_lmsdir}
-install bin/* $RPM_BUILD_ROOT%{_bindir}
-install lib/* $RPM_BUILD_ROOT%{_datadir}/%{name}/lib
-install img/* $RPM_BUILD_ROOT%{_lmsdir}/img
-install modules/* $RPM_BUILD_ROOT%{_datadir}/%{name}/modules
-install templates/* $RPM_BUILD_ROOT%{_datadir}/%{name}/templates
-install sample/%{name}.ini $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
+install -d $RPM_BUILD_ROOT%{_sbindir} \
+          $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,httpd} \
+          $RPM_BUILD_ROOT/etc/lms/modules/{dns,ggnofity,nofity} \
+          $RPM_BUILD_ROOT{%{_lmsvar}/{backups,templates_c},/usr/lib/lms} \
+          $RPM_BUILD_ROOT%{_lmsdir}/www/{img,doc,user}
+
+install *.php $RPM_BUILD_ROOT%{_lmsdir}/www
+install img/* $RPM_BUILD_ROOT%{_lmsdir}/www/img
+cp -r doc/html $RPM_BUILD_ROOT%{_lmsdir}/www/doc
+cp -r lib contrib modules templates sample $RPM_BUILD_ROOT%{_lmsdir}
+install bin/* $RPM_BUILD_ROOT%{_sbindir}
+
+install sample/%{name}.ini $RPM_BUILD_ROOT%{_sysconfdir}
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
+
+# sqlpanel
+install contrib/sqlpanel/sql.php $RPM_BUILD_ROOT%{_lmsdir}/modules
+install contrib/sqlpanel/*.html $RPM_BUILD_ROOT%{_lmsdir}/templates
+
+# user
+install contrib/customer/* $RPM_BUILD_ROOT%{_lmsdir}/www/user
+
+# daemon
+%if %{with almsd}
+install daemon/almsd-* $RPM_BUILD_ROOT%{_sbindir}
+install daemon/modules/*/*.so $RPM_BUILD_ROOT/usr/lib/lms
+cp -r daemon/modules/dns/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/dns
+cp -r daemon/modules/ggnotify/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/ggnotify
+cp -r daemon/modules/dns/sample $RPM_BUILD_ROOT%{_sysconfdir}/modules/nofity
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/lmsd
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
+       echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
+       if [ -f /var/lock/subsys/httpd ]; then
+               /usr/sbin/apachectl restart 1>&2
+       fi
+elif [ -d /etc/httpd/httpd.conf ]; then
+       ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
+       if [ -f /var/lock/subsys/httpd ]; then
+               /usr/sbin/apachectl restart 1>&2
+       fi
+fi
+
+%post almsd
+/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 almsd daemon."
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+       umask 027
+       if [ -d /etc/httpd/httpd.conf ]; then
+               rm -f /etc/httpd/httpd.conf/99_%{name}.conf
+       else
+               grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
+                       /etc/httpd/httpd.conf.tmp
+               mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
+       fi
+       if [ -f /var/lock/subsys/httpd ]; then
+               /usr/sbin/apachectl restart 1>&2
+       fi
+fi
+
+%preun almsd
+if [ "$1" = "0" ]; then
+       if [ -f /var/lock/subsys/lmsd ]; then
+               /etc/rc.d/init.d/lmsd stop >&2
+       fi
+       /sbin/chkconfig --del lmsd
+fi
+
+%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"
+echo
+
 %files
 %defattr(644,root,root,755)
-%doc doc/* sample/*.ini sample/*txt sample/rc.reminder_1st sample/crontab-entry
+%doc doc/{AUTHORS,ChangeLog*,README,TODO,UPGRADE*,lms*}
+%dir %{_sysconfdir}
+%attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.ini
+%config(noreplace) %verify(not size mtime md5) /etc/httpd/%{name}.conf
+#
+%dir %{_lmsvar}
+%attr(770,root,http) %{_lmsvar}/backups
+%attr(770,root,http) %{_lmsvar}/templates_c
+#
 %dir %{_lmsdir}
-%dir %{_datadir}/%{name}
-%dir %{_sharedstatedir}/%{name}
-%attr(770,root,http) %{_sharedstatedir}/%{name}/templates_c
-%attr(770,root,http) %{_sharedstatedir}/%{name}/backups
-%{_lmsdir}/*.php
-%{_lmsdir}/img
-%{_datadir}/%{name}/lib
-%{_datadir}/%{name}/modules
-%{_datadir}/%{name}/templates
-%dir %{_sysconfdir}/%{name}
-%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/*.ini
+%{_lmsdir}/www
+%exclude %{_lmsdir}/www/user
+%{_lmsdir}/lib
+%{_lmsdir}/modules
+%exclude %{_lmsdir}/modules/sql.php
+%{_lmsdir}/contrib
+%{_lmsdir}/sample
+%attr(755,root,root) %{_lmsdir}/sample/traffic_ipt.sh
+%{_lmsdir}/templates
+%exclude %{_lmsdir}/templates/sql.html
+%exclude %{_lmsdir}/templates/sqlprint.html
 
 %files scripts
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/lms-*
-%doc sample/*.ini
+%dir %{_sbindir}
+%attr(755,root,root) %{_sbindir}/*
+
+%files sqlpanel
+%defattr(644,root,root,755)
+%{_lmsdir}/modules/sql.php
+%{_lmsdir}/templates/sql.html
+%{_lmsdir}/templates/sqlprint.html
+
+%files user
+%defattr(644,root,root,755)
+%{_lmsdir}/www/user
+
+%if %{with almsd}
+%files almsd
+%defattr(644,root,root,755)
+%doc daemon/{lms.ini.sample,TODO}
+%attr(755,root,root) %{_sbindir}/almsd-*
+%attr(755,root,root) /usr/lib/lms/*.so
+%attr(754,root,root) /etc/rc.d/init.d/lmsd
+/etc/lms/modules/*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
+%endif
This page took 0.050674 seconds and 4 git commands to generate.