%define name pblogan %define version 0.0.6 %define release 2mdk %define webadminroot /var/www/html/admin Summary: Phone Box Log Analyzer Name: %{name} Version: %{version} Release: %{release} Source0: %{name}-%{version}.tar.bz2 Source1: phonedb.init.bz2 License: GPL URL: http://pblogan.sourceforge.net/ Group: System/Servers BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot PreReq: rpm-helper Requires: apache Requires: mod_php Requires: php-common Requires: php-pgsql Requires: perl BuildArch: noarch Prefix: %{webadminroot} %description Phone Box Log Analyzer allows you to capture and view the logs from a PBX. By connecting to the serial port of the PBX (usually used for printing to a serial printer) the logs may be captured and fed to a PostgreSQL database. A PHP Web interface to this database is provided. %prep %setup -q -c -n %{name}-%{version} mv home/httpd/html/phonedb/* . mv usr/local/bin/* . mv usr/local/etc/* . find * -name '*.phtml' | while read phtml; do mv $phtml ${phtml%%.phtml}.php done find . -type f -name "*"|xargs perl -p -i -e "s|.phtml|.php|g" find . -type f -name "*"|xargs perl -p -i -e "s|/usr/local/etc|%{_sysconfdir}|g" find . -type f -name "*"|xargs perl -p -i -e "s|pblogan.rc|pblogan.conf|g" bzcat %{SOURCE1} > phonedb.init %build %install [ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot} install -d %{buildroot}%{_initrddir} install -d %{buildroot}%{_sysconfdir} install -d %{buildroot}%{_sbindir} install -d %{buildroot}/var/log/central install -d %{buildroot}%{webadminroot}/%{name} install -m0644 *.php %{buildroot}%{webadminroot}/%{name}/ install -m0644 *.css %{buildroot}%{webadminroot}/%{name}/ install -m0644 *.inc %{buildroot}%{webadminroot}/%{name}/ install -m0644 *.html %{buildroot}%{webadminroot}/%{name}/ install -m0644 pblogan.rc %{buildroot}%{_sysconfdir}/pblogan.conf install -m0755 phonedb %{buildroot}%{_sbindir}/ install -m0755 readserial %{buildroot}%{_sbindir}/ install -m0755 phonedb.init %{buildroot}%{_initrddir}/phonedb %post %_post_service %{name} %preun %_preun_service %{name} %clean [ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot} %files %defattr(-,root,root) %doc ChangeLog INSTALL NOTES README TODO llamadas.dump %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/pblogan.conf %config(noreplace) %attr(0755,root,root) %{_initrddir}/phonedb %attr(0755,root,root) %{_sbindir}/phonedb %attr(0755,root,root) %{_sbindir}/readserial %{webadminroot}/%{name} %dir /var/log/central %changelog * Fri Oct 15 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.0.6-2mdk - fix deps * Thu Aug 14 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.9.0-1mdk - initial cooker contrib