# Maintainer: Natanael Copa # Contributor: Michael Mason # Contributor: Cameron Banta pkgname=freeswitch pkgver=1.4.26 pkgrel=3 pkgdesc="A communications platform written in C from the ground up" url="http://www.freeswitch.org" arch="all" license="GPL" depends="" pkgusers="freeswitch" options="!configsub" pkggroups="freeswitch" makedepends="bash bsd-compat-headers curl-dev flac-dev gnutls-dev ldns-dev lame-dev libedit-dev libjpeg-turbo-dev libogg-dev libpri-dev libvorbis-dev linux-headers lua5.2-dev ncurses-dev net-snmp-dev openssl-dev pcre-dev portaudio-dev postgresql-dev sngtc_client-dev speex-dev speexdsp-dev sqlite-dev unixodbc-dev util-linux-dev zlib-dev autoconf automake libtool " install="$pkgname.pre-install $pkgname.pre-upgrade" subpackages="$pkgname-dbg $pkgname-dev $pkgname-flite $pkgname-timezones $pkgname-sample-config:conf $pkgname-freetdm $pkgname-sangoma $pkgname-snmp $pkgname-pgsql" _json_c="json-c-0.9.tar.gz" _flite="flite-2.0.0-release.tar.bz2" _lame="lame-3.98.4.tar.gz" _libshout="libshout-2.2.2.tar.gz" _mpg123="mpg123-1.13.2.tar.gz" _libsources=" freeswitch-$_json_c::http://files.freeswitch.org/downloads/libs/$_json_c freeswitch-$_flite::http://files.freeswitch.org/downloads/libs/$_flite freeswitch-$_lame::http://files.freeswitch.org/downloads/libs/$_lame freeswitch-$_libshout::http://files.freeswitch.org/downloads/libs/$_libshout freeswitch-$_mpg123::http://files.freeswitch.org/downloads/libs/$_mpg123 " source="http://files.freeswitch.org/$pkgname-$pkgver.tar.xz $_libsources getlib.patch modules.conf freeswitch.confd freeswitch.initd libshout-disable-examples.patch freeswitch-mod_shout-textrels.patch system-lame.patch FS-8612-calls-crash-due-to-read-codec-leak.patch FS-8871-Fixed-encoding-and-symbols-in-vanilla-config.patch fix-modconf-thread-join.patch " _builddir="$srcdir/$pkgname-$pkgver" prepare() { cd "$_builddir"/libs for i in $_libsources; do local f=${i##*/} ln -s ../../${f%.tar*} . || return 1 done cd "$_builddir" for i in $source; do case $i in libshout-disable-examples.patch) msg $i; cd "$srcdir"; patch -p0 -i "$srcdir"/$i || return 1;; *.patch) msg $i; cd "$_builddir"; patch -p1 -i "$srcdir"/$i || return 1;; esac done cd "$srcdir" update_config_sub || return 1 } build() { cd "$_builddir" # remove Werror sed -i -e 's/-Werror/-Wall/g' configure # i think our max cmd len is 32768 # by specifying it here we save our selves from some CPU cycles export lt_cv_sys_max_cmd_len=8192 cp -f "$srcdir/modules.conf" modules.conf || return 1 CFLAGS="-Wno-unused-but-set-variable" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --enable-fhs \ --with-scriptdir=/etc/freeswitch/scripts \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --with-devrandom=/dev/urandom \ --with-libpri \ --disable-debug \ --enable-core-pgsql-support \ --enable-system-lua \ || return 1 # first build libfreeswitch (in parallel) make src/include/switch_version.h src/include/switch_swigable_cpp.h make libfreeswitch.la || return 1 # finally we build the rest make -j1 all || return 1 } package(){ cd "$_builddir" make -j1 DESTDIR="$pkgdir" install samples-conf samples-htdocs \ || return 1 find "$pkgdir" -name '*.la' -delete install -m755 -D "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname || return 1 install -m644 -D "$srcdir"/$pkgname.confd \ "$pkgdir"/etc/conf.d/$pkgname || return 1 chown -R freeswitch:freeswitch "$pkgdir"/var/*/freeswitch } _mv_mod() { local moddir=usr/lib/freeswitch/mod i= mkdir -p "$subpkgdir"/$moddir for i in $@; do mv "$pkgdir"/$moddir/$i.so "$subpkgdir"/$moddir/ || return 1 done } flite() { pkgdesc="Freeswitch Text To Speech Module" install= _mv_mod mod_flite ## ## The mod_say_xx modules can be used with out flite (for numbers, etc using ## sound files). So they shouldn't be in the flite package -cB ## # _mv_mod mod_say_de mod_say_en mod_say_es mod_say_fr \ # mod_say_it mod_say_nl mod_say_zh mod_say_hu mod_say_ru \ # mod_say_th mod_say_he } freetdm() { pkgdesc="Freeswitch FreeTDM Module" install= _mv_mod mod_freetdm ftmod_analog ftmod_analog_em ftmod_libpri \ ftmod_skel ftmod_zt mv "$pkgdir"/usr/lib/libfreetdm.so* "$subpkgdir"/usr/lib/ } sangoma() { pkgdesc="Freeswitch Sangoma Media Transcode Codec Module" install= _mv_mod mod_sangoma_codec } timezones() { pkgdesc="Freeswitch timezone configuration" arch="noarch" install= replaces="freeswitch-sample-config" mkdir -p "$subpkgdir"/etc/freeswitch/autoload_configs mv "$pkgdir"/etc/freeswitch/autoload_configs/timezones.conf.xml \ "$subpkgdir"/etc/freeswitch/autoload_configs } snmp() { pkgdesc="Freeswitch SNMP module" install= _mv_mod mod_snmp } pgsql() { pkgdesc="Freeswitch PostgreSQL Module" install= _mv_mod mod_cdr_pg_csv } conf() { pkgdesc="Freeswitch sample configureation" arch="noarch" depends="freeswitch-timezones" install= mkdir -p "$subpkgdir"/etc/freeswitch # move all configs except freeswitch.xml for i in "$pkgdir"/etc/freeswitch/*; do [ "$i" = "$pkgdir"/etc/freeswitch/freeswitch.xml ] && continue mv "$i" "$subpkgdir"/etc/freeswitch/ || return 1 done mkdir -p "$pkgdir"/etc/freeswitch/scripts } md5sums="f9f48dffca89131410be0073793c2682 freeswitch-1.4.26.tar.xz 4653b3b9c568bb9c782178abfaac128d freeswitch-json-c-0.9.tar.gz 645db96ffc296cbb6d37f231cc1cc6b2 freeswitch-flite-2.0.0-release.tar.bz2 50d04c6a204d3d2b9fb2ef6479375f99 freeswitch-lame-3.98.4.tar.gz e409b006b5dad6d8668c3e429bf20159 freeswitch-libshout-2.2.2.tar.gz 452fd875cb5e4d16f77c757371836fff freeswitch-mpg123-1.13.2.tar.gz 1e7f335ee00f589825ecc9affa779346 getlib.patch 0eb382f73ed393f28b8a797ebbfa608b modules.conf c608cca8ad773acebf201f581438c7e7 freeswitch.confd 3b0bf4847a61afa28229b58763f4c400 freeswitch.initd 90b133b14a42c86d53d5e54dcbfbaf58 libshout-disable-examples.patch 4cd4923463c89bed053e6295b5a4ec40 freeswitch-mod_shout-textrels.patch 6a6c4aba80e99c236ef712b17f3cdd01 system-lame.patch 078925cba3d5c6b70071acfb591d3fc8 FS-8612-calls-crash-due-to-read-codec-leak.patch 08ec76f767af6b62c0d487ebf97ec4ba FS-8871-Fixed-encoding-and-symbols-in-vanilla-config.patch 3af0e9265d28e09f3cc729e566839ba0 fix-modconf-thread-join.patch" sha256sums="7d90e19723433ba3e73fee979775720e0ea41d208f73d0a9e6d02bf15bb8fac0 freeswitch-1.4.26.tar.xz 816fb2d4baab09e2f51a7c1be75bc9e03ed09d4cf3c2cd03c183f433bb9b565f freeswitch-json-c-0.9.tar.gz 678c3860fd539402b5d1699b921239072af6acb4e72dc4720494112807cae411 freeswitch-flite-2.0.0-release.tar.bz2 2cd9e29ab4999907edf3b8d95f6046c70b2ef4f2bf656a82ec15553fc11069b0 freeswitch-lame-3.98.4.tar.gz 38701125cb0e0349f4394dd3254d6037eeb8af0747c0942ff433ffbcd48d2367 freeswitch-libshout-2.2.2.tar.gz b3a855acc96e0061a0c2b1162e8aff80b6b1a03849e3756786db2fcacfc9a9bd freeswitch-mpg123-1.13.2.tar.gz ab437c92149b6fc88bc2fc8a228d6a5f8af574e2c90469a6dc4c753d13972c34 getlib.patch f83f9680d243eb254bf045571f971a6c5cf716367444cd48ed26d4c3367f4c41 modules.conf 846a29a361ef6eecd77876963b5c0133699c40fa8b34c68df42d5f8a1a1915b1 freeswitch.confd aa0d89221ffa47eba4a0e085f6041ee198476409dd15d1e90c5c357ba683f432 freeswitch.initd db0d3c252b5664ecb071bcf6868eff77c85dd7943a63fcfcac7e19db6a0ff61f libshout-disable-examples.patch be1009327de615f04956ba0b0f44183f31c263e380af8027f94b976a84bcb09a freeswitch-mod_shout-textrels.patch 11b107ca8632bb9c8fcb2aedfcfb421af24929aace4f56c34d4e701eb410e190 system-lame.patch cf40b3845a35c0de97c71b4fce2a49ad8d08d95a649dda30fcacb28e8a9be872 FS-8612-calls-crash-due-to-read-codec-leak.patch 01295702685df1f0a44df377e129aeb1eb811d79a40230a223a026179e4f689f FS-8871-Fixed-encoding-and-symbols-in-vanilla-config.patch 4919fb1010b1aa34e531a950e0281f4f0deccb1fea42f8eb2bbc6fb15654242b fix-modconf-thread-join.patch" sha512sums="97add95dc50597ab9c0cb5ab3dca39e83668038b08d06e86a3ac5e093740a5fae2e6143c5eabcb1a4d5db4c6cdb3094f9eef4023d2f1544f967e1faf87a79527 freeswitch-1.4.26.tar.xz 38b8729275bbfebaee783e703d19481f3d32b50cfdeb338644b8db2742573ea025702c789b5ce8d5067dcde23c5a16b46231eaadf0b9c5dbff392d410912c772 freeswitch-json-c-0.9.tar.gz e2b353721d0316fbd7948f90f9c9561d080eebd50e8dd0449a9c803ffbdb060a469385fadd63f535ade8d627cba37928d8e72ac61d5bcf98f73ca5ebb66549f8 freeswitch-flite-2.0.0-release.tar.bz2 1674e383c347fdbc57aa89b1e2f1dd50904440ae852e50c6a62cb26dfa8825de35d2b8115169caf19cf813614eb1cb0f279a3a9204f18ce3b943cfe59ccc4a73 freeswitch-lame-3.98.4.tar.gz d517d1d6a79dfd4819c42603faafc051c69270831f4894c01f6bd38e877eb008f8458534857641fd8d653fd437fb41ee1c558ff2a76339c3a8a579f4d5a26baf freeswitch-libshout-2.2.2.tar.gz 1940b6bf1c7167a7718ac0972e9c8cf9a49cf8c7a4a062052d00ead282cf4ae63214bfc317f2ccb424f6f3f26c602e91300d45635ba2d4f8da992c94b3ed0885 freeswitch-mpg123-1.13.2.tar.gz 4ceb48f64d2bc26a02cc0846276506241bfd30c156422b0a1d608fd172c099feb5c121a763652e9a45046dcdd0ba0eb71eab240e0c6ce2ad63ff781719e135a4 getlib.patch 6330e47cd3dcfdb4f5c99e91c9c725c7c8aa4f1691d83817d7600e510b5a586f3312bab84df3766448bbdab78cd1feebecf64b8280626b3f751f6e787f145e23 modules.conf a585f6411185a26206137a1ad97a06fd6c73e80c5439e9be45eabfa70e7a83120169ba882971fcd328436c8e0242cbd664170b80754ea2846021689baf1f1595 freeswitch.confd 643d0a2e43f5d3bf3b99fcb6f6422302cb4b74a95eccf844eafb100b15aa9856b4ff41f112d6637255c2e9e2bec9fedc9a9215dfff214dfb83b52eae16b71dca freeswitch.initd 91a6d7c8456de65855930b371f568f0230c28422e667453aa48fababd185b47677c06ff0c79f94c2a02182439b012d48cb54548cbde3d12b8d0e1ffbb9b229cc libshout-disable-examples.patch 5f085254ca9f5dc196afd39fc55e083b1998e776d9de2428e5657d99077526c33c1fc13f12432598184ce63138447fed7c318c384b743681703f5682dc8e1e50 freeswitch-mod_shout-textrels.patch 398dd0f2665415ff40348dc94d26ec7008fb59ec033f9d2c64dc1aa01071021f83f47954e95efc58c4033f22bb6da159e83e3b0d36b99189d5e7535ed6ae70bd system-lame.patch f951a6e065f638d3259f4897702dcf240d84a7b1204a0e7f51d60ab625e8eed74421c58bc58f08e1cd72db339e8166726545a6001a18e6cd56d54e4d57d2f46d FS-8612-calls-crash-due-to-read-codec-leak.patch a16f97d013b6beaf2eab77973217652120af0ec96be12a41e2e29754d27d746aaada45329e0ba354e3f224e7f0afa04f58dab2bfac9bcf360c308b219c5912d6 FS-8871-Fixed-encoding-and-symbols-in-vanilla-config.patch 6f8a84ea8e7aeb139c50fe5fca2936af0d06f29a427a5b909e9b74c3d12ccb42e6dfd39307d15c092da841b8020945441b7b582619ce995a1b3df86b7b9df6e8 fix-modconf-thread-join.patch"