Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > 1ef8768542379b2c04dbb11ba4b62ce1 > files > 7

astpp-1.7.2-9.mga5.src.rpm

%global __requires_exclude perl\\((FreeSWITCH::Client|Win32)\\)|/usr/local/astpp/astpp-common.pl 
#global __requires_exclude perl\\((Kernel::.*|Win32)\\)
#global __provides_exclude perl\\(Kernel::.*\\)

Summary:	Open source VoIP billing and calling system
Name:		astpp
Version:	1.7.2
Release:	%mkrel 9
License:	MPLv1.1
Group:		Communications/Telephony
URL:		http://astpp.org/
Source0:	ASTPP-master.zip
Source1:	astpp.service
Source2:	astpp-tmpfiles.conf
Source3:	astpp.sysconfig
Patch0:		astpp-1.7-nochmodgrp.diff
Patch1:		astpp-1.7-apache.diff
Patch2:		astpp-1.7-nolocal.diff
Requires:	freeswitch-xml-curl
Requires:	freeswitch-xml-cdr
Requires:	freeswitch-perl
Requires:	freeswitch-sounds-moh
Requires:	freeswitch-sounds-en
Requires:	perl
Requires:	perl(Text::Template)
Requires:	perl(Locale::gettext_pp)
Requires:	perl-DBI
Requires:	perl(DBD::mysql)
Requires:	perl-YAML
Requires:	perl(Params::Validate)
Requires:	perl(Asterisk::AGI)
Requires:	perl(LWP::Simple)
Requires:	perl(URI::Escape)
Requires:	perl(Text::CSV)
Requires:	perl(Mail::Sendmail)
Requires:	perl(Email::Simple)
Requires:	perl(Time::DaysInMonth)
Requires:	perl(HTML::Template)
Requires:	perl(HTML::Template::Expr)
Requires:	perl(DateTime)
Requires:	perl(XML::Simple)
Requires:	perl(XML::LibXML)
Requires:	perl(Class::Singleton)
Requires:	perl(Data::Dumper)
Requires:	perl(Text::Template)
Requires:	perl(IO::Tty)
Requires:	perl(IO::All)
Requires:	perl(Test::Pod)
Requires:	perl(MIME::Types)
Requires:	perl(POE::Test::Loops)
Requires:	perl(Time::Zone)
Requires:	perl(Curses)
Requires:	perl(IO::String)
Requires:	perl(POE)
Requires:	perl(Sys::Syslog)
Requires:	perl(Log::Dispatch)
Requires:	perl(FCGI)
Requires:	perl(Email::Date::Format)
Requires:	perl(Set::Infinite)
Requires:	perl(DateTime::Set)
Requires:	perl(DateTime::Event::Recurrence)
Requires:	perl(Class::Data::Inheritable)
Requires:	perl(File::Slurp)
Requires:	perl(Template::Plugin::DateTime)
Requires:	perl(Text::CSV_XS)
Requires:	perl(Term::ReadKey)
Requires:	perl(DateTime::Format::Strptime)
Requires:	perl(DBI::Shell)
Requires:	perl(Net::Daemon)
Requires:	perl(XML::Writer)
Requires:	perl(JSON)
Requires:	astpp-sounds
Requires:	perl-astpp
Requires:	webserver
Requires:	php-gd
Requires:	php-pear
Requires:	php-mysql
Requires:	php-pdo
Requires:	php-json
Requires:	apache-mod_php
Requires:	php-curl
BuildArch:	noarch

%description
STPP is a mature Scalable/Clustering Open Source VoIP billing solution for 
Freeswitch and Asterisk. It supports pre-paid and post-paid billing
with call rating, credit control and call reporting. It also provides many 
other features such as calling cards, least cost routing (LCR), did 
management, resellers, callbacks, etc. ASTPP can be deployed with Opensips 
to offer a distributed Telco VoIP Billing infrastructure. We are also able 
to integrate with OSCommerce to provide a Web store for your users to purchase 
calling cards and sign up for VoIP accounts. We support multiple currencies 
for each account type with real-time update using Yahoo Finance. 

Please visit www.astpp.org for detailed information regarding features and 
functionalities.


%package	sounds
Summary:	Open source VoIP billing and calling system (Sounds files)
Group:          Communications/Telephony
Requires:       freeswitch-sounds-en

%description    sounds
ASTPP sound files.

%package -n	perl-astpp
Summary:        Open source VoIP billing and calling system (Sounds files)
Group:          Communications/Telephony

%description -n perl-astpp
AASTP perl modules.

%prep
%setup -q -n ASTPP-master
%patch0 -p0
%patch1 -p0
%patch2 -p1

%build
pushd modules/ASTPP
perl Makefile.PL
popd

%install
pushd modules/ASTPP
%makeinstall_std
popd
mkdir -p %{buildroot}%{_datadir}/%name
mkdir -p %{buildroot}/usr/share/man/man3/
mv %{buildroot}/usr/local/share/man/man3/ASTPP.3pm %{buildroot}/usr/share/man/man3/ASTPP.3pm

%make DESTDIR=%{?buildroot:%{buildroot}} install_freeswitch_conf

%make DESTDIR=%{?buildroot:%{buildroot}} install_astpp

%{__install} -D -p -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf
%{__install} -D -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
%{__install} -D -m 744 %{SOURCE3} %{buildroot}/etc/sysconfig/%{name}
mkdir -p %{buildroot}/etc/%{name}
mkdir -p %{buildroot}/etc/%{name}/autoload_configs
mkdir -p %{buildroot}/etc/%{name}/dialplan/default

cat > %{buildroot}/etc/%{name}/vars.xml << EOF
<!-- Codecs -->
<!-- G7221@32000h,G7221@16000h,G722,PCMU,PCMA,iLBC,GSM,H263,H264
,H263-2000,H263-1998,H263,H261
SILK@8000h,SILK@12000h,SILK@16000h,SILK@24000h -->
<X-PRE-PROCESS cmd="set" data="global_codec_prefs=PCMU,PCMA,GSM,iLBC,H264"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMU,PCMA,GSM,iLBC,H264"/>

<!-- Defaults -->
<X-PRE-PROCESS cmd="set" data="call_debug=false"/>
<X-PRE-PROCESS cmd="set" data="console_loglevel=info"/>
<X-PRE-PROCESS cmd="set" data="default_areacode=208"/>
<X-PRE-PROCESS cmd="set" data="uk-ring=%%(400,200,400,450);%%(400,2200,400,450)"/>
<X-PRE-PROCESS cmd="set" data="us-ring=%%(2000, 4000, 440.0, 480.0)"/>
<X-PRE-PROCESS cmd="set" data="fr-ring=%%(1500, 3500, 440.0, 0.0)"/>
<X-PRE-PROCESS cmd="set" data="rs-ring=%%(1000, 4000, 425.0, 0.0)"/>
<X-PRE-PROCESS cmd="set" data="bong-ring=v=-7;%%(100,0,941.0,1477.0);v=-7;>=2;+=.1;%%(1400,0,350,440)"/>
<X-PRE-PROCESS cmd="set" data="sit=%%(274,0,913.8);%%(274,0,1370.6);%%(380,0,1776.7)"/>
<X-PRE-PROCESS cmd="set" data="use_profile=internal"/>
<X-PRE-PROCESS cmd="set" data="default_language=en"/>
<X-PRE-PROCESS cmd="set" data="default_dialect=us"/>
<X-PRE-PROCESS cmd="set" data="default_voice=callie"/>
<X-PRE-PROCESS cmd="set" data="ajax_refresh_rate=3000"/>
<X-PRE-PROCESS cmd="set" data="format_phone=Rxxx-xxx-xxxx"/>
<X-PRE-PROCESS cmd="set" data="format_phone=xxx-xxx-xxxx"/>
<X-PRE-PROCESS cmd="set" data="xml_cdr_archive=dir"/>
<X-PRE-PROCESS cmd="set" data="ringback=$${us-ring}"/>
<X-PRE-PROCESS cmd="set" data="transfer_ringback=$${us-ring}"/>

<!-- Dingaling -->
<!-- xmpp_client_profile and xmpp_server_profile xmpp_client_profile can be any string. xmpp_server_profile is appended to "dingaling_" to form the database name containing the "subscriptions" table. used by: dingaling.conf.xml enum.conf.xml -->
<X-PRE-PROCESS cmd="set" data="xmpp_client_profile=xmppc"/>
<X-PRE-PROCESS cmd="set" data="xmpp_server_profile=xmpps"/>
<X-PRE-PROCESS cmd="set" data="bind_server_ip=auto"/>

<!-- Domain -->
<X-PRE-PROCESS cmd="set" data="domain_name=$${domain}"/>

<!-- IP Address -->
<X-PRE-PROCESS cmd="set" data="local_ip_v4=auto-nat"/>
<X-PRE-PROCESS cmd="set" data="external_rtp_ip=auto-nat"/>
<X-PRE-PROCESS cmd="set" data="external_sip_ip=auto-nat"/>

<!-- Music on Hold -->
<X-PRE-PROCESS cmd="set" data="hold_music=local_stream://moh"/>

<!-- SIP -->
<!-- Used to turn on sip loopback unrolling. -->
<X-PRE-PROCESS cmd="set" data="unroll_loops=true"/>
<X-PRE-PROCESS cmd="set" data="sip_tls_version=tlsv1"/>

<!-- SIP Profile: External -->
<X-PRE-PROCESS cmd="set" data="external_auth_calls=false"/>
<X-PRE-PROCESS cmd="set" data="external_sip_port=5080"/>
<X-PRE-PROCESS cmd="set" data="external_tls_port=5081"/>
<X-PRE-PROCESS cmd="set" data="external_ssl_enable=false"/>
<X-PRE-PROCESS cmd="set" data="external_ssl_dir=$${base_dir}/conf/ssl"/>

<!-- SIP Profile: Internal -->
<X-PRE-PROCESS cmd="set" data="internal_auth_calls=true"/>
<X-PRE-PROCESS cmd="set" data="internal_sip_port=5060"/>
<X-PRE-PROCESS cmd="set" data="internal_tls_port=5061"/>
<X-PRE-PROCESS cmd="set" data="internal_ssl_enable=false"/>
<X-PRE-PROCESS cmd="set" data="internal_ssl_dir=$${base_dir}/conf/ssl"/>

<!-- Sound -->
<!-- Sets the sound directory. -->
<X-PRE-PROCESS cmd="set" data="sound_prefix=/usr/share/freeswitch/sounds/en/us/callie/"/>
EOF


cat > %{buildroot}/etc/%{name}/freeswitch.xml << EOF
<?xml version="1.0"?>
<document type="freeswitch/xml">
  <X-PRE-PROCESS cmd="include" data="vars.xml"/>

  <section name="configuration" description="Various Configuration">
    <X-PRE-PROCESS cmd="include" data="autoload_configs/*.xml"/>
  </section>

  <section name="dialplan" description="Regex/XML Dialplan">
    <!--<X-PRE-PROCESS cmd="include" data="dialplan/*.xml"/>-->
  </section>
  
</document>
EOF


cp freeswitch/conf/autoload_configs/xml_curl.conf.xml %{buildroot}/etc/%{name}/autoload_configs
cp freeswitch/conf/autoload_configs/xml_cdr.conf.xml %{buildroot}/etc/%{name}/autoload_configs
cp freeswitch/conf/autoload_configs/cdr_csv.conf.xml %{buildroot}/etc/%{name}/autoload_configs
cp freeswitch/conf/autoload_configs/modules.conf.xml %{buildroot}/etc/%{name}/autoload_configs
cp freeswitch/conf/dialplan/default/astpp_callingcards.xml %{buildroot}/etc/%{name}/dialplan/default


%post
%_tmpfilescreate %{name}
%_post_service %{name}

%preun
%_preun_service %{name}


%files
%doc sql/* freeswitch/conf/*
%config(noreplace) %{webappconfdir}/%{name}.conf
%{_var}/www/astpp/*
%{_var}/www/astpp/.htaccess
%{_var}/www/cgi-bin
%{_datadir}/astpp/*
/usr/share/freeswitch/scripts/astpp-callingcards.pl
%config(noreplace) /var/lib/astpp/astpp-config.conf
/var/lib/astpp
%{_unitdir}/%{name}.service
%attr(0644,root,root) %config(noreplace) /etc/sysconfig/%{name}
%{_tmpfilesdir}/%{name}.conf
%config(noreplace) /etc/%{name}


%files sounds
%{_datadir}/freeswitch/sounds/*

%files -n perl-astpp
%perl_sitelib/*
%{_mandir}/man3/ASTPP.3pm.xz


%changelog
* Wed Oct 15 2014 umeabot <umeabot> 1.7.2-9.mga5
+ Revision: 746468
- Second Mageia 5 Mass Rebuild

* Tue Oct 14 2014 danf <danf> 1.7.2-8.mga5
+ Revision: 738712
- Properly escape %% when creating vars.xml file

* Wed Oct 01 2014 tv <tv> 1.7.2-7.mga5
+ Revision: 733978
- rebuild for pear deps

* Sat Sep 27 2014 tv <tv> 1.7.2-6.mga5
+ Revision: 730844
- add exclude

* Tue Sep 16 2014 umeabot <umeabot> 1.7.2-5.mga5
+ Revision: 678006
- Mageia 5 Mass Rebuild

  + tv <tv>
    - use %%global for req/prov exclude
    - use %%global for req/prov exclude
    - autoconvert to new prov/req excludes

* Wed Dec 18 2013 dmorgan <dmorgan> 1.7.2-4.mga4
+ Revision: 558421
- Fix build for autobuild ( create %%_datadir/%%name)

* Sat Oct 19 2013 umeabot <umeabot> 1.7.2-3.mga4
+ Revision: 523675
- Mageia 4 Mass Rebuild

* Fri May 24 2013 dlucio <dlucio> 1.7.2-2.mga4
+ Revision: 426238
- 1.7.2

* Fri May 17 2013 dlucio <dlucio> 1.7-7.mga4
+ Revision: 413507
- Missing config files

* Fri May 17 2013 dlucio <dlucio> 1.7-6.mga3
+ Revision: 413503
- S1, S2 & S3

* Wed May 15 2013 dlucio <dlucio> 1.7-5.mga3
+ Revision: 413303
- missing files for freeswitch config

* Wed May 15 2013 dlucio <dlucio> 1.7-4.mga3
+ Revision: 413270
- missing files for post install

* Tue May 14 2013 dlucio <dlucio> 1.7-3.mga3
+ Revision: 413181
- PHP requires

* Tue May 14 2013 dlucio <dlucio> 1.7-2.mga3
+ Revision: 413166
- some requires exceptions

* Tue May 14 2013 dlucio <dlucio> 1.7-1.mga3
+ Revision: 413139
- Correct group
- P2 to move out of usr/local
- P0 & P1 added
- imported package astpp