#%%undefine __find_provides #%%undefine __find_requires Summary: freePBX (former Asterisk Managment Portal (AMP)) Name: freepbx Version: 2.0.2 Release: %mkrel 0.r1357.2 License: GPL Group: System/Servers URL: http://coalescentsystems.ca/index.php?page=freePBX_AMP #Source0: http://prdownloads.sourceforge.net/amportal/%{name}-%{version}.tar.bz2 Source0: %{name}.tar.bz2 # S1 is nowhere to be found on the net... Source1: http://www.areski.net/asterisk-meetme/sources/asterisk_meetme_v1.tar.bz2 Source2: freepbx_bootstrap.sh.bz2 Patch0: freepbx-2.0.2-mdv_conf.diff Patch1: asterisk-meetme_v1-mdv_conf.diff Requires(pre): apache-conf >= 2.0.54 Requires(pre): apache-mpm-prefork >= 2.0.54 Requires(pre): apache-mod_php php-mysql Requires(post): ccp >= 0.4.0 Requires: apache-mod_php Requires: php-mysql Requires: php-cli Requires: sudo Requires: asterisk Requires: asterisk-addons Requires: op_panel # the commented deps is from a deep research of asterisk@home # the packages exist in main/contrib. please keep this #Requires: asterisk-app_notify #Requires: asterisk-res_bonjour #Requires: asterisk-app_nv_faxdetect #Requires: asterisk-app_nv_backgrounddetect Requires: perl-CGI-Session Requires: perl-Data-UUID Requires: perl-IPC-Signal Requires: perl-Proc-WaitStat Requires: perl-Net-Telnet Requires: perl-asterisk-perl Requires: mime-construct #Requires: sipsak Requires: festival #Requires: ngrep BuildArch: noarch BuildRequires: dos2unix BuildRequires: apache-base >= 2.0.54 Obsoletes: amp Provides: amp = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-root %description The goal of the Asterisk Management Portal (AMP) project is to bring together best-of-breed applications to produce a standardized implementation of Asterisk complete with a Web-based administrative interface. %prep %setup -q -n %{name} -a1 # fix silly ms space naming pushd asterisk-meetme_v1/images/icons mv "Darth Vader.GIF" "darth_vader.gif" mv "Hoth Soldier.GIF" "hoth_soldier.gif" mv "Landspeeder Ben.GIF" "landspeeder_ben.gif" mv "Larry the Lobster.GIF" "larry_the_lobster.gif" mv "Major Matt Mason.GIF" "major_matt_mason.gif" mv "Obi Wan With Hood.GIF" "obi_wan_with_hood.gif" mv "Rebel Tech.GIF" "rebel_tech.gif" mv "Scout Trooper.GIF" "scout_trooper.gif" mv "Wedge.GIF" "wedge.gif" popd %patch0 -p1 %patch1 -p0 # fix dir perms find . -type d | xargs chmod 755 # fix file perms find . -type f | xargs chmod 644 # clean up CVS stuff for i in `find . -type d -name .svn` `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 # strip away annoying ^M find -type f | grep -v "\.gif" | grep -v "\.GIF" | grep -v "\.png" | grep -v "\.jpg" | grep -v "\.au" | grep -v "\.jar" | grep -v "\.cab" | grep -v "\.mo" | xargs dos2unix -b -U # instead of maintaining a patch find -type f | xargs perl -pi -e "s|/etc/amportal\.conf|%{_sysconfdir}/%{name}/amportal\.conf|g" # now let's nuke cruft we don't need (this is a lot!) find . -type f -name "\.DS_Store" | xargs rm -f rm -rf amp_conf/cgi-bin rm -rf amp_conf/htdocs/_asterisk rm -rf amp_conf/mohmp3 rm -rf amp_conf/sbin rm -rf upgrades # fix docs mv amp_conf/htdocs/recordings/ABOUT.txt ARI.ABOUT.txt mv amp_conf/htdocs/recordings/CHANGE.log ARI.CHANGE.log mv amp_conf/htdocs/recordings/LICENSE.txt ARI.LICENSE.txt mv amp_conf/htdocs/recordings/README.txt ARI.README.txt mv amp_conf/htdocs/admin/cdr/CHANGELOG.txt CDR.CHANGELOG.txt mv amp_conf/htdocs/admin/cdr/info.txt CDR.info.txt bzcat %{SOURCE2} > freepbx_bootstrap.sh %build %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_sysconfdir}/asterisk install -d %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d install -d %{buildroot}%{_sbindir} install -d %{buildroot}/var/www/%{name} install -d %{buildroot}/var/www/%{name}/panel install -d %{buildroot}%{_datadir}/%{name}/asterisk install -d %{buildroot}/var/www/%{name}/meetme install -d %{buildroot}%{_localstatedir}/asterisk/agi-bin install -m0644 amportal.conf %{buildroot}%{_sysconfdir}/%{name}/amportal.conf install -m0755 amp_conf/agi-bin/* %{buildroot}%{_localstatedir}/asterisk/agi-bin/ install -m0755 amp_conf/bin/* %{buildroot}%{_datadir}/%{name}/ install -m0755 apply_conf.sh %{buildroot}%{_datadir}/%{name}/ install -m0644 amp_conf/htdocs_panel/*.php %{buildroot}/var/www/%{name}/panel/ install -m0644 amp_conf/htdocs/admin/images/freepbx.png %{buildroot}/var/www/%{name}/ install -m0644 amp_conf/astetc/* %{buildroot}%{_datadir}/%{name}/asterisk/ install -m0755 freepbx_bootstrap.sh %{buildroot}%{_sbindir}/freepbx_bootstrap perl -pi -e "s|_DOCDIR_|%{_docdir}/%{name}-%{version}|g" %{buildroot}%{_sbindir}/freepbx_bootstrap cp -aRf amp_conf/htdocs/* %{buildroot}/var/www/%{name}/ cp -aRf asterisk-meetme_v1/* %{buildroot}/var/www/%{name}/meetme/ mv %{buildroot}/var/www/%{name}/meetme/lib/defines.php %{buildroot}%{_sysconfdir}/%{name}/meetme.php mv %{buildroot}/var/www/%{name}/recordings/includes/main.conf.php %{buildroot}%{_sysconfdir}/%{name}/ari.php cat > %{buildroot}/%{_sysconfdir}/httpd/conf/webapps.d/%{name}.conf << EOF Alias /%{name} /var/www/%{name} <Directory /var/www/%{name}> Allow from all </Directory> <Directory %{_localstatedir}/asterisk/agi-bin> AllowOverride All Options ExecCGI Order allow,deny Allow from all </Directory> <Directory /var/www/%{name}/admin> AllowOverride All Order allow,deny Allow from all AuthType Basic AuthName "Restricted Area" AuthUserFile %{_sysconfdir}/%{name}/freepbx_web_users Require user admin </Directory> <Directory /var/www/%{name}/meetme> AllowOverride All Order allow,deny Allow from all AuthType Basic AuthName "Restricted Area" AuthUserFile %{_sysconfdir}/%{name}/freepbx_web_users Require user admin </Directory> <Directory /var/www/%{name}/recordings> AllowOverride All Order allow,deny Allow from all AuthType Basic AuthName "Restricted Area" AuthUserFile %{_sysconfdir}/%{name}/freepbx_web_users Require user admin </Directory> <Directory /var/www/%{name}/panel> AllowOverride All Order allow,deny Allow from all AuthType Basic AuthName "Restricted Area" AuthUserFile %{_sysconfdir}/%{name}/freepbx_web_users Require user admin </Directory> <Location /op_panel> AllowOverride All Order allow,deny Allow from all AuthType Basic AuthName "Restricted Area" AuthUserFile %{_sysconfdir}/%{name}/freepbx_web_users Require user admin </Location> EOF echo "# add users here" > %{buildroot}%{_sysconfdir}/%{name}/freepbx_web_users # fix config files touch %{buildroot}%{_sysconfdir}/%{name}/op_buttons_additional.cfg cat > README.mandriva << EOF F r e e P B X (A s t e r i s k M a n a g m e n t P o r t a l) ------------------------------------------------------------------ Please run the %{buildroot}%{_sbindir}/freepbx_bootstrap script and then make the MySQL databases as shown. EOF %post # Upgrade the configuration file using ccp if needed # More information in ccp(1) ccp --backup --delete --ifexist --set NoOrphans --type ini --oldfile %{_sysconfdir}/amp/amportal.conf --newfile %{_sysconfdir}/%{name}/amportal.conf.rpmnew ccp --backup --delete --ifexist --set NoOrphans --type ini --oldfile %{_sysconfdir}/%{name}/amportal.conf --newfile %{_sysconfdir}/%{name}/amportal.conf.rpmnew ccp --backup --delete --ifexist --set NoOrphans --type ini --oldfile %{_sysconfdir}/%{name}/ari.php --newfile %{_sysconfdir}/%{name}/ari.php.rpmnew ccp --backup --delete --ifexist --set NoOrphans --type ini --oldfile %{_sysconfdir}/%{name}/meetme.php --newfile %{_sysconfdir}/%{name}/meetme.php.rpmnew ccp --backup --delete --ifexist --set NoOrphans --type ini --oldfile %{_sysconfdir}/%{name}/op_buttons_additional.cfg --newfile %{_sysconfdir}/%{name}/op_buttons_additional.cfg.rpmnew # make sure op_server is running if ! [ -f /var/lock/subsys/op_server ]; then %{_initrddir}/op_server start 1>&2; fi %_post_webapp %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 CONTRIB.txt ChangeLog FAQ INSTALL docs/README.directory README* SQL/*.sql ARI* CDR* # %attr(0640,apache,root) %config(noreplace) %{_sysconfdir}/%{name}/amportal.conf %attr(0644,apache,root) %config(noreplace) %{_sysconfdir}/%{name}/op_buttons_additional.cfg %attr(0640,apache,root) %config(noreplace) %{_sysconfdir}/%{name}/meetme.php %attr(0640,apache,root) %config(noreplace) %{_sysconfdir}/%{name}/ari.php %attr(0640,apache,root) %config(noreplace) %{_sysconfdir}/%{name}/freepbx_web_users %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf/webapps.d/%{name}.conf # %attr(0755,root,root) %{_sbindir}/freepbx_bootstrap # %attr(0755,root,root) %{_localstatedir}/asterisk/agi-bin/dialparties.agi %attr(0755,root,root) %{_localstatedir}/asterisk/agi-bin/directory %attr(0755,root,root) %{_localstatedir}/asterisk/agi-bin/fixlocalprefix %attr(0755,root,root) %{_localstatedir}/asterisk/agi-bin/list-item-remove.php %attr(0755,root,root) %{_localstatedir}/asterisk/agi-bin/phpagi-asmanager.php %attr(0755,root,root) %{_localstatedir}/asterisk/agi-bin/phpagi.php %attr(0755,root,root) %{_localstatedir}/asterisk/agi-bin/recordingcheck %attr(0755,root,root) %{_localstatedir}/asterisk/agi-bin/dialparties.agi.php # %attr(0755,root,root) %{_datadir}/%{name}/ampbackup.pl %attr(0755,root,root) %{_datadir}/%{name}/archive_recordings %attr(0755,root,root) %{_datadir}/%{name}/php-asmanager.php %attr(0755,root,root) %{_datadir}/%{name}/retrieve_backup_cron_from_mysql.pl %attr(0755,root,root) %{_datadir}/%{name}/retrieve_conf %attr(0755,root,root) %{_datadir}/%{name}/retrieve_iax_conf_from_mysql.pl %attr(0755,root,root) %{_datadir}/%{name}/retrieve_op_conf_from_mysql.pl %attr(0755,root,root) %{_datadir}/%{name}/retrieve_queues_conf_from_mysql.pl %attr(0755,root,root) %{_datadir}/%{name}/retrieve_sip_conf_from_mysql.pl %attr(0755,root,root) %{_datadir}/%{name}/retrieve_zap_conf_from_mysql.pl %attr(0755,root,root) %{_datadir}/%{name}/retrieve_parse_amportal_conf.pl %attr(0755,root,root) %{_datadir}/%{name}/fax-process.pl %attr(0755,root,root) %{_datadir}/%{name}/apply_conf.sh %{_datadir}/%{name}/asterisk # /var/www/%{name} %changelog * Mon Apr 03 2006 Oden Eriksson <oeriksson@mandriva.com> 2.0.2-0.1357.2mdk - fix the meetme patch - relocate the ARI config - better file security on the config files * Mon Apr 03 2006 Oden Eriksson <oeriksson@mandriva.com> 2.0.2-0.1357.1mdk - used a fresh svn snap (1357) - renamed to freepbx - rediffed P0 (stefan also touched it) * Thu Feb 09 2006 Oden Eriksson <oeriksson@mandriva.com> 2.0-0.20060208.3mdk - added meetme * Thu Feb 09 2006 Oden Eriksson <oeriksson@mandriva.com> 2.0-0.20060208.2mdk - small fixes * Thu Feb 09 2006 Oden Eriksson <oeriksson@mandriva.com> 2.0-0.20060208.1mdk - initial Mandriva package * Wed Dec 21 2005 Stefan van der Eijk <stefan@eijk.nu> 1.10.010-1mdk - Initial package