Search
j0ke.net Open Build Service
>
Projects
>
server:telephony
>
freePBX
> freepbx.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File freepbx.spec of Package freePBX
# # spec file for package freePBX (Version 2.10.0) # # #!BuildIgnore: post-build-checks BuildRequires: libpri >= 1.4.1 BuildRequires: asterisk18 >= 1.8 curl libedit BuildRequires: mysql BuildRequires: php php-pear Summary: Asterisk web GUI Name: freepbx Version: 2.11.0.25 Release: 1 License: GPL Group: System/Servers Source0: %{name}-%{version}.tar.gz Source1: freepbx-trixbox-ampperm.sql Source2: freepbx-suse-webroot.sql Patch0: freepbx-2.10.0-webroot.patch BuildRoot: %{_tmppath}/%{name}-%{version} URL: http://www.freepbx.org/ AutoReqProv: off Requires: mysql php php-pear php-pcntl php-posix php-mysql php-gettext ruby bash coreutils sed Recommends: apache2-mod_php5 Requires: asterisk18 >= 1.8 Provides: perl(retrieve_parse_amportal_conf.pl) %if 0%{?suse_version} %define _srvroot /srv/www %else %define _srvroot /var/www %endif %define _cgidir %{_srvroot}/cgi-bin %define _docroot %{_srvroot}/htdocs %description FreePBX is a Standardised Implementation of Asterisk that gives you a GUI to manage your system. If you have looked into Asterisk, you would know that it does not come with any built in programming. You cannot plug a phone into it and make it work without editing configuration files, writing dialplans, and various messing about. FreePBX simplifies this by giving you a pre-written set of dialplans that allow you to have a fully functional PBX pretty much straight away. %prep %setup -q -n %{name} %if 0%{?suse_version} %patch0 cp %{S:2} . %endif %build %pre /usr/bin/mysql -u root --password=passw0rd --execute "quit" if [ "$?" -ne 0 ] then echo "The password of the root mysql user is not set as standard for freePBX !" exit fi %install %{__install} -d %{buildroot}/usr/src/%{name}-%{version} cp -r * %{buildroot}/usr/src/%{name}-%{version} %{__install} -m 644 %{SOURCE1} %{buildroot}/usr/src/%{name}-%{version}/SQL %post mv -f /usr/src/%{name} /usr/src/%{name}.RPMSAVE ln -s /usr/src/%{name}-%{version} /usr/src/%{name} # Only process the next section if it's a new install # check this by testing for the existence of asterisk:admin table /usr/bin/mysql --batch --user=root --password=passw0rd --execute="select count(*) from admin;" asterisk 2>/dev/null if [ "$?" -ne 0 ] ; then #create SQL table for FreePBX.org /usr/bin/mysqladmin create asterisk --user=root --password=passw0rd 2>/dev/null # create SQL database asteriskcdrdb /usr/bin/mysqladmin create asteriskcdrdb --user=root --password=passw0rd 2>/dev/null # Setting Permissions /usr/bin/mysql --user=root --password=passw0rd < /usr/src/%{name}-%{version}/SQL/freepbx-trixbox-ampperm.sql # Setting Permissions /usr/bin/mysql --user=root --password=passw0rd asterisk < /usr/src/%{name}-%{version}/SQL/newinstall.sql /usr/bin/mysql --user=root --password=passw0rd asteriskcdrdb < /usr/src/%{name}-%{version}/SQL/cdr_mysql_table.sql cp /usr/src/%{name}-%{version}/amportal.conf %{_sysconfdir} sed -i s@AMPWEBROOT=/var/www/html@AMPWEBROOT=%{_docroot}@g %{_sysconfdir}/amportal.conf sed -i s@AMPCGIBIN=/var/www/cgi-bin@AMPCGIBIN=%{_cgidir}@g %{_sysconfdir}/amportal.conf sed -i s@FOPWEBROOT=/var/www/html/panel@FOPWEBROOT=%{_docroot}/panel@g %{_sysconfdir}/amportal.conf echo " *** Installing FreePBX.org app" cd /usr/src/%{name}-%{version} echo a | ./install_amp echo " *** setting permissions and default values" cd /usr/src/%{name}-%{version} && ./apply_conf.sh else echo " *** Updating FreePBX.org app" cd /usr/src/%{name}-%{version} echo a | ./install_amp fi touch %{_docroot}/panel/op_buttons_additional.cfg touch %{_docroot}/panel/op_buttons_custom.cfg touch /var/log/asterisk/cdr-csv/Master.csv chmod 777 /var/log/asterisk/cdr-csv/Master.csv mkdir -p /var/lib/asterisk/sounds/custom/ if ! grep amportal /etc/rc.d/rc.local >/dev/null 2>&1; then echo "/usr/sbin/amportal start" >> /etc/rc.d/rc.local fi chmod 755 /var/spool/asterisk/monitor if [ -x /usr/sbin/amportal ]; then amportal restart fi %files %defattr(-,root,root) %doc freepbx-suse-webroot.sql /usr/src/%{name}-%{version}/* %changelog