# TODO: # * remove bundled libs # * patch init script # * add user Summary: Telephony Platform Name: freeswitch Version: 1.0.8 Release: 0.1.20110523%{?dist} # Needs work, depending on at least all of the "libs/" content we use License: MPLv1.1 Group: Applications/Internet URL: http://www.freeswitch.org/ #Source0: http://files.freeswitch.org/freeswitch-%{version}.tar.bz2 Source0: http://files.freeswitch.org/freeswitch-snapshot.tar.bz2 # See http://jira.freeswitch.org/browse/FS-302 Patch0: freeswitch-snapshot-locations.patch Patch1: freeswitch-snapshot-initscript.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires(pre): /usr/sbin/useradd %if %{with systemd} Requires(post): systemd-units Requires(post): systemd-sysv Requires(preun): systemd-units Requires(postun): systemd-units %else Requires(post): /sbin/chkconfig Requires(preun): /sbin/service, /sbin/chkconfig Requires(postun): /sbin/service %endif Requires: %{name}-libs = %{version}-%{release} # We patch *.in BuildRequires: autoconf, automake, libtool # The configure script tags the build based on git's output (snapshot only) BuildRequires: git # Main BuildRequires: ncurses-devel BuildRequires: python-devel BuildRequires: openssl-devel # ?? BuildRequires: libcurl-devel # libspandsp BuildRequires: libjpeg-devel # Replace provided libs BuildRequires: xmlrpc-c-devel BuildRequires: apr-devel BuildRequires: apr-util-devel BuildRequires: pcre-devel %description FreeSWITCH is a scalable telephony platform designed to route and interconnect popular communication protocols using audio, video, text or any other form of media. It was created in 2006 to fill the void left by proprietary commercial solutions. FreeSWITCH also provides a stable telephony platform on which many telephony applications can be developed using a wide range of free tools. %package libs Summary: Shared libraries for FreeSWITCH Group: System Environment/Libraries %description libs Shared libraries for FreeSWITCH. %package devel Summary: Development package for FreeSWITCH Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkgconfig %description devel Development package for FreeSWITCH. %prep %setup -q -n freeswitch-snapshot %patch0 -p1 %patch1 -p1 # Taken from the bottom of bootstrap.sh (no need to bootstrap all of libs/*) rm -f aclocal.m4 aclocal libtoolize --copy --automake autoconf autoheader automake --no-force --add-missing --copy rm -rf autom4te*.cache # We don't want to be using any bundled libs ##rm -rf libs/* #rm -rf libs/xmlrpc-c/ #rm -rf libs/apr/ #rm -rf libs/apr-util/ #rm -rf libs/curl/ #rm -rf libs/pcre/ %build %configure \ --disable-static \ --sysconfdir=%{_sysconfdir}/freeswitch \ --includedir=%{_includedir}/freeswitch \ --with-modinstdir=%{_libdir}/freeswitch \ --with-rundir=%{_var}/run/freeswitch \ --with-logfiledir=%{_var}/log/freeswitch \ --with-dbdir=%{_var}/lib/freeswitch \ --with-htdocsdir=%{_datadir}/freeswitch/htdocs \ --with-soundsdir=%{_datadir}/freeswitch/sounds \ --with-grammardir=%{_datadir}/freeswitch/grammar \ --with-scriptdir=%{_datadir}/freeswitch/scripts \ --with-recordingsdir=%{_var}/spool/freeswitch/recordings # --with-apr=%{_bindir}/apr-1-config #make %{?_smp_mflags} make %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} mkdir -p %{buildroot}%{_var}/run/freeswitch # Init script install -p -m 0755 -D build/freeswitch.init.redhat \ %{buildroot}/etc/init.d/freeswitch install -p -m 0644 -D build/freeswitch.sysconfig \ %{buildroot}/etc/sysconfig/freeswitch %clean rm -rf %{buildroot} %pre /usr/sbin/useradd -s /sbin/nologin -M -r -d / \ -c 'FreeSWITCH' freeswitch &>/dev/null || : %post %if %{with systemd} if [ $1 -eq 1 ] ; then /bin/systemctl daemon-reload &>/dev/null || : fi %else /sbin/chkconfig --add freeswitch %endif %preun if [ $1 -eq 0 ]; then %if %{with systemd} /bin/systemctl --no-reload disable freeswitch.service &>/dev/null || : /bin/systemctl stop freeswitch.service &>/dev/null || : %else /sbin/service freeswitch stop &>/dev/null || : /sbin/chkconfig --del freeswitch %endif fi %postun %if %{with systemd} /bin/systemctl daemon-reload &>/dev/null || : if [ $1 -ge 1 ]; then /bin/systemctl try-restart freeswitch.service &>/dev/null || : fi %else if [ $1 -ge 1 ]; then /sbin/service freeswitch condrestart &>/dev/null || : fi %endif %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc AUTHORS ChangeLog NEWS README /etc/init.d/freeswitch %config(noreplace) /etc/sysconfig/freeswitch %dir %{_sysconfdir}/freeswitch/ %config(noreplace) %{_sysconfdir}/freeswitch/* %{_bindir}/freeswitch %{_bindir}/fs_cli %{_bindir}/fs_ivrd %{_bindir}/fsxs %{_bindir}/gentls_cert %dir %{_libdir}/freeswitch/ %exclude %{_libdir}/freeswitch/*.la %{_libdir}/freeswitch/*.so %{_datadir}/freeswitch/ %attr(0750,freeswitch,freeswitch) %dir %{_var}/lib/freeswitch/ %attr(0750,freeswitch,freeswitch) %dir %{_var}/log/freeswitch/ %attr(0750,freeswitch,freeswitch) %dir %{_var}/log/freeswitch/xml_cdr/ %attr(0750,freeswitch,freeswitch) %dir %{_var}/run/freeswitch/ %dir %{_var}/spool/freeswitch/ %attr(0750,freeswitch,freeswitch) %dir %{_var}/spool/freeswitch/recordings/ %files libs %defattr(-,root,root,-) %doc COPYING %{_libdir}/*.so.* %files devel %defattr(-,root,root,-) %{_includedir}/freeswitch/ %{_libdir}/pkgconfig/freeswitch.pc %exclude %{_libdir}/*.la %{_libdir}/*.so %changelog * Mon Aug 8 2011 Matthias Saou 1.0.6-1 - Initial RPM release.