add working spec file

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6365 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-11-20 23:23:32 +00:00
parent 471bab89f7
commit 84c06d6374
1 changed files with 219 additions and 0 deletions

219
build/freeswitch.spec Normal file
View File

@ -0,0 +1,219 @@
Name: freeswitch-snapshot
Summary: FreeSWITCH open source telephony platform
License: MPL
Group: Productivity/Telephony/Servers
Version: 6012
Release: 0
URL: http://www.freeswitch.org/
Packager: Peter Nixon
Vendor: http://peternixon.net/
Source0: %{name}-%{version}.tar.bz2
Source1: freeswitch.ld.so.conf
Source2: freeswitch.init
Source3: freeswitch.sysconfig
Source4: modules.conf
Patch0: curses.patch
#AutoReqProv: no
BuildRequires: alsa-devel
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: curl-devel
BuildRequires: gcc-c++
BuildRequires: gnutls-devel
#BuildRequires: libogg-devel
BuildRequires: libtool >= 1.5.14
BuildRequires: lzo-devel
BuildRequires: freeradius-client-snapshot-devel
BuildRequires: mysql-devel
BuildRequires: ncurses-devel
BuildRequires: openldap2-devel
BuildRequires: openssl-devel
BuildRequires: perl
BuildRequires: pkgconfig
BuildRequires: python-devel
BuildRequires: termcap
#BuildRequires: unixODBC-devel
#BuildRequires: sqlite-devel
%if %{?suse_version:1}0
%if 0%{?suse_version} > 910
#BuildRequires: autogen
%endif
%endif
# Fedora doesn't seem to have 'which' as part of the base system
%if %{?fedora_version:1}0
BuildRequires: which
%endif
%if 0%{?suse_version} > 800
#PreReq: /usr/sbin/useradd /usr/sbin/groupadd
PreReq: %insserv_prereq %fillup_prereq
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.
We support various communication technologies such as SIP, H.323, IAX2 and GoogleTalk making it easy to interface with other open source PBX systems such as sipX, OpenPBX, Bayonne, YATE or Asterisk.
We also support both wide and narrow band codecs making it an ideal solution to bridge legacy devices to the future. The voice channels and the conference bridge module all can operate at 8, 16 or 32 kilohertz and can bridge channels of different rates.
FreeSWITCH runs on several operating systems including Windows, Max OS X, Linux, BSD and Solaris on both 32 and 64 bit platforms.
Our developers are heavily involved in open source and have donated code and other resources to other telephony projects including sipX, Asterisk and OpenPBX.
%debug_package
%package devel
Summary: Development package for FreeSWITCH open source telephony platform
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
FreeSWITCH development files
%package codec-passthru-amr
Summary: Pass-through AMR Codec support for FreeSWITCH open source telephony platform
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Conflicts: codec-amr
%description codec-passthru-amr
Pass-through AMR Codec support for FreeSWITCH open source telephony platform
%package codec-passthru-g723_1
Summary: Pass-through g723.1 Codec support for FreeSWITCH open source telephony platform
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Conflicts: codec-g723_1
%description codec-passthru-g723_1
Pass-through g723.1 Codec support for FreeSWITCH open source telephony platform
%package codec-passthru-g729
Summary: Pass-through g729 Codec support for FreeSWITCH open source telephony platform
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Conflicts: codec-g729
%description codec-passthru-g729
Pass-through g729 Codec support for FreeSWITCH open source telephony platform
%prep
%setup -q
%patch0
%build
#export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -DLDAP_DEPRECATED -fPIC -DPIC"
export CFLAGS="$RPM_OPT_FLAGS -fPIC -DPIC"
%if 0%{?suse_version} > 1000 && 0%{?suse_version} < 1030
export CFLAGS="$CFLAGS -fstack-protector"
%endif
export VERBOSE=yes
export CFLAGS="$CFLAGS -g -ggdb"
export MOD_CFLAGS="-g -ggdb"
export DESTDIR=$RPM_BUILD_ROOT/
export PKG_CONFIG_PATH=/usr/bin/pkg-config:$PKG_CONFIG_PATH
export ACLOCAL_FLAGS="-I /usr/share/aclocal"
./bootstrap.sh
#./configure -C \
%configure -C \
--prefix=/opt/freeswitch \
--sysconfdir=%{_sysconfdir} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--enable-core-libedit-support
# --enable-core-odbc-support
#Create the version header file here
cat src/include/switch_version.h.in | sed "s/@SVN_VERSION@/%{version}/g" > src/include/switch_version.h
touch .noversion
cp %{SOURCE4} .
make
%install
make DESTDIR=$RPM_BUILD_ROOT install
#make DESTDIR=$RPM_BUILD_ROOT -C src/mod/event_handlers/mod_cdr install
#make DESTDIR=$RPM_BUILD_ROOT -C src/mod/codecs/mod_speex install
#make DESTDIR=$RPM_BUILD_ROOT -C src/mod/codecs/mod_g729 install
#make DESTDIR=$RPM_BUILD_ROOT -C src/mod/xml_int/mod_xml_rpc install
# Create a log dir
mkdir -p $RPM_BUILD_ROOT/opt/freeswitch/log
#Install the library path config so the system can find the modules
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/ld.so.conf.d/
#install -m 744 suse/freeswitch.init $RPM_BUILD_ROOT/etc/init.d/freeswitch
install -D -m 744 %{SOURCE2} $RPM_BUILD_ROOT/etc/init.d/freeswitch
mkdir -p $RPM_BUILD_ROOT/usr/sbin
ln -sf /etc/init.d/freeswitch $RPM_BUILD_ROOT/usr/sbin/rcfreeswitch
install -D -m 744 %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/freeswitch
%pre
/usr/sbin/groupadd -r freeswitch 2> /dev/null || :
/usr/sbin/useradd -r -g freeswitch -s /bin/false -c "Freeswitch daemon" -d /opt/freeswitch/var freeswitch 2> /dev/null || :
%post
%{?run_ldconfig:%run_ldconfig}
%postun
%{?run_ldconfig:%run_ldconfig}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%dir %attr(750,root,root) /opt/freeswitch/db
%dir %attr(750,root,root) /opt/freeswitch/log
%dir %attr(750,root,root) /opt/freeswitch/log/xml_cdr
%dir %attr(750,root,root) /opt/freeswitch/htdocs
%dir %attr(750,root,root) /opt/freeswitch/scripts
#%dir %attr(750,root,root) /opt/freeswitch/grammer
%dir %attr(750,root,root) /opt/freeswitch/conf
%config(noreplace) %attr(750,root,root) /opt/freeswitch/conf/*.xml
/etc/ld.so.conf.d/*
%{_bindir}/freeswitch
#/opt/freeswitch/bin/freeswitch
/etc/init.d/freeswitch
/etc/sysconfig/freeswitch
/usr/sbin/rcfreeswitch
#/opt/freeswitch/lib/*.so*
%{_libdir}/*.so*
/opt/freeswitch/mod/*.so*
%files codec-passthru-amr
/opt/freeswitch/mod/mod_amr.so*
%files codec-passthru-g723_1
/opt/freeswitch/mod/mod_g723_1.so*
%files codec-passthru-g729
/opt/freeswitch/mod/mod_g729.so*
%files devel
%defattr(-,root,root)
%{_libdir}/*.a
%{_libdir}/*.la
/opt/freeswitch/mod/*.a
/opt/freeswitch/mod/*.la
/opt/freeswitch/include/*.h
%changelog
* Tue Apr 24 2007 - peter+rpmspam@suntel.com.tr
- Added a debug package
- Split the passthrough codecs into separate packages
* Fri Mar 16 2007 - peter+rpmspam@suntel.com.tr
- Added devel package
* Thu Mar 15 2007 - peter+rpmspam@suntel.com.tr
- Initial RPM release