Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 6d1a1f56d99132a29c7ab2f9712ca94c > files > 3

op_panel-0.25-5mdv2009.0.src.rpm

Summary:	Switchboard type application for the Asterisk PBX
Name:		op_panel
Version:	0.25
Release:	%mkrel 5
License:	GPL
Group:		System/Servers
URL:		http://www.asternic.org/
Source0:	http://www.asternic.org/files/%{name}-%{version}.tar.bz2
Source1:	op_server.init.bz2
Source2:	op_server.sysconfig.bz2
Patch0:		op_panel-0.24-mdv_conf.diff
Requires(post): rpm-helper
Requires(preun): rpm-helper
Requires(pre):	apache-conf >= 2.0.54
Requires(pre):	apache-mpm >= 2.0.54
Requires(pre):	apache-mod_php
Requires:	apache-mod_php
BuildArch:	noarch
BuildRequires:	dos2unix
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

%description
Flash Operator Panel is a switchboard type application for the
Asterisk PBX. It runs on a web browser with the flash plugin. It
is able to display information about your PBX activity in real
time. The layout is configurable (button sizes and colors, icons,
etc). You can have more than 100 buttons active per screen. On the
Live Demo there are 28 buttons defined. It also supports contexts:
you can have one server running and many different client displays
(for hosted PBX, different departments, etc). It can integrate
with CRM software, by poping up a web page (and passing the CLID)
when a specified button is ringing.

%prep

%setup -q -n %{name}-%{version}
%patch0 -p1

bzcat %{SOURCE1} > op_server.init
bzcat %{SOURCE2} > op_server.sysconfig

# clean up CVS stuff
for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do
    if [ -e "$i" ]; then rm -r $i; fi >&/dev/null
done

# fix dir perms
find . -type d | xargs chmod 755

# fix file perms
find . -type f | xargs chmod 644

# strip away annoying ^M
find -type f | grep -v "\.gif" | grep -v "\.png" | grep -v "\.jpg" | grep -v "\.swf"  | xargs dos2unix -U

%build

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_sysconfdir}/op_panel
install -d %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_bindir}
install -d %{buildroot}/var/www/op_panel
install -d %{buildroot}/var/log/op_server

install -m0755 op_server.init %{buildroot}%{_initrddir}/op_server
install -m0644 op_server.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/op_server
install -m0755 op_server.pl %{buildroot}%{_sbindir}/op_server
install -m0755 ming-source/operator_panel.pl %{buildroot}%{_bindir}/operator_panel
install -m0644 *.cfg %{buildroot}%{_sysconfdir}/op_panel/
install -m0644 html/* %{buildroot}/var/www/op_panel/


# fix docs
cp ming-source/README README.ming-source

# fix variables.txt file
touch %{buildroot}/var/www/op_panel/variables.txt

# fix apache config
cat > %{buildroot}/%{_sysconfdir}/httpd/conf/webapps.d/op_panel.conf << EOF

Alias /%{name} %{_var}/www/%{name}

<Directory %{_var}/www/%{name}>
    Allow from all
</Directory>
EOF

# install log rotation stuff
cat > %{buildroot}%{_sysconfdir}/logrotate.d/op_server << EOF
/var/log/op_server/output.log /var/log/op_server/error.log {
    rotate 5
    monthly
    missingok
    notifempty
    nocompress
    prerotate
        %{_initrddir}/op_server restart > /dev/null 2>&1
    endscript
    postrotate
        %{_initrddir}/op_server restart > /dev/null 2>&1
    endscript
}
EOF

%post
%_post_service op_server
if [ -f %{_var}/lock/subsys/op_server ]; then
    %{_initrddir}/op_server restart 1>&2;
fi
%_post_webapp

%preun
%_preun_service op_server

%postun
if [ "$1" = "0" ]; then
    if [ -f %{_var}/lock/subsys/op_server ]; then
        %{_initrddir}/op_server restart 1>&2
    fi
fi
%_postun_webapp

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc CHANGES FAQ LICENSE README RECIPES TODO UPGRADE README.ming-source extensions.conf.sample
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/op_panel/*.cfg
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf/webapps.d/op_panel.conf
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/op_server
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/op_server
%attr(0755,root,root) %{_initrddir}/op_server
%attr(0755,root,root) %{_sbindir}/op_server
%attr(0755,root,root) %{_bindir}/operator_panel
/var/www/op_panel
%attr(0644,apache,root) %config(noreplace) /var/www/op_panel/variables.txt
%dir %attr(0755,root,root) /var/log/op_server


%changelog
* Wed Jul 30 2008 Thierry Vignaud <tvignaud@mandriva.com> 0.25-5mdv2009.0
+ Revision: 254909
- rebuild

* Mon Feb 18 2008 Thierry Vignaud <tvignaud@mandriva.com> 0.25-3mdv2008.1
+ Revision: 171013
- rebuild
- fix "foobar is blabla" summary (=> "blabla") so that it looks nice in rpmdrake
- kill re-definition of %%buildroot on Pixel's request

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

* Mon Jun 25 2007 Oden Eriksson <oeriksson@mandriva.com> 0.25-2mdv2008.0
+ Revision: 43838
- fix deps

* Wed May 09 2007 Oden Eriksson <oeriksson@mandriva.com> 0.25-1mdv2008.0
+ Revision: 25441
- Import op_panel



* Sun Mar 19 2006 Stefan van der Eijk <stefan@eijk.nu> 0.25-1mdk
- 0.25

* Wed Feb 08 2006 Oden Eriksson <oeriksson@mandriva.com> 0.24-1mdk
- initial Mandriva package