projects/aports·blob master · refs

243 lines · 6.5 KiB

1# Contributor: Michael Mason <[email protected]>
2# Contributor: Cameron Banta <[email protected]>
3# Contributor: Francesco Colista <[email protected]>
4# Maintainer: Natanael Copa <[email protected]>
5pkgname=freeswitch
6pkgver=1.10.12
7pkgrel=6
8pkgdesc="A communications platform written in C from the ground up"
9url="https://www.freeswitch.org/"
10arch="all"
11license="MPL-1.1"
12options="!check" # fixme: failing tests
13makedepends="
14 apr-dev
15 autoconf
16 automake
17 bash
18 bsd-compat-headers
19 coreutils
20 curl-dev
21 diffutils
22 flite-dev
23 gdbm-dev
24 lame-dev
25 ldns-dev
26 libedit-dev
27 libjpeg-turbo-dev
28 libks-dev
29 libpq-dev
30 libshout-dev
31 libsndfile-dev
32 libsrtp-dev
33 libtool
34 linux-headers
35 lua5.3-dev
36 mpg123-dev
37 mariadb-dev
38 ncurses-dev
39 nasm
40 net-snmp-dev
41 openssl-dev>3
42 opus-dev
43 pcre-dev
44 perl-dev
45 portaudio-dev
46 py3-setuptools
47 python3-dev
48 sngtc_client-dev
49 sofia-sip-dev
50 spandsp3-dev
51 speex-dev
52 speexdsp-dev
53 sqlite-dev
54 tiff-dev
55 unixodbc-dev
56 util-linux-dev
57 xmlrpc-c-dev
58 zlib-dev
59 "
60install="$pkgname.pre-install $pkgname.pre-upgrade"
61_freeswitch_user=freeswitch
62_freeswitch_group=freeswitch
63pkgusers="$_freeswitch_user"
64pkggroups="$_freeswitch_group"
65subpackages="$pkgname-dbg
66 $pkgname-dev $pkgname-flite $pkgname-timezones::noarch
67 $pkgname-sample-config:conf:noarch $pkgname-sangoma
68 $pkgname-snmp $pkgname-pgsql $pkgname-mariadb $pkgname-python3
69 $pkgname-perl $pkgname-perlesl $pkgname-openrc"
70
71source="https://files.freeswitch.org/freeswitch-releases/freeswitch-$pkgver.-release.tar.xz
72 getlib.patch
73 libvpx-fix-arm-float-abi.patch
74 disable-Werror.patch
75 python-3.10.patch
76 gcc14.patch
77 gcc15.patch
78 modules.conf
79 freeswitch.confd
80 freeswitch.initd
81 "
82
83builddir="$srcdir/$pkgname-$pkgver.-release"
84
85# secfixes:
86# 1.10.11-r0:
87# - CVE-2023-51443
88# 1.10.7-r0:
89# - CVE-2021-37624
90# - CVE-2021-41105
91# - CVE-2021-41145
92# - CVE-2021-41157
93# - CVE-2021-41158
94
95prepare() {
96 default_prepare
97 NOCONFIGURE=1 autoreconf -vif
98 update_config_sub
99}
100
101build() {
102 cp -f "$srcdir/modules.conf" modules.conf
103 # Wno-format-truncation: https://github.com/signalwire/freeswitch/issues/652
104 CFLAGS="$CFLAGS -Wno-unused-but-set-variable -Wno-format-truncation" ./configure \
105 ac_cv_func_sched_setscheduler=no \
106 --build=$CBUILD \
107 --host=$CHOST \
108 --prefix=/usr \
109 --enable-fhs \
110 --localstatedir=/var \
111 --sysconfdir=/etc \
112 --with-scriptdir=/etc/freeswitch/scripts \
113 --mandir=/usr/share/man \
114 --infodir=/usr/share/info \
115 --with-devrandom=/dev/urandom \
116 --with-python3 \
117 --disable-debug \
118 --enable-core-pgsql-support \
119 --enable-system-lua \
120 --enable-system-xmlrpc-c
121
122 make libs/libvpx/libvpx.a
123 # first build libfreeswitch (in parallel)
124 make src/include/switch_version.h src/include/switch_swigable_cpp.h
125 make libfreeswitch.la
126 # finally we build the rest
127 make all
128
129 # build perlesl module
130 cd "$builddir"/libs/esl
131 make perlmod
132
133 # deal with pkg-config version being bogus
134 cd "$builddir"
135 sed -i s:-release::g build/freeswitch.pc
136}
137
138check() {
139 make check
140}
141
142package() {
143 make -j1 DESTDIR="$pkgdir" install samples-conf samples-htdocs
144
145 install -m755 -D "$srcdir"/$pkgname.initd \
146 "$pkgdir"/etc/init.d/$pkgname
147 install -m644 -D "$srcdir"/$pkgname.confd \
148 "$pkgdir"/etc/conf.d/$pkgname
149 chown -R $_freeswitch_user:$_freeswitch_group "$pkgdir"/var/*/freeswitch
150
151 # install perlesl module
152 cd "$builddir"/libs/esl
153 make -j1 DESTDIR="$pkgdir" perlmod-install
154}
155
156_mv_mod() {
157 local moddir=usr/lib/freeswitch/mod i=
158 mkdir -p "$subpkgdir"/$moddir
159 for i in "$@"; do
160 mv "$pkgdir"/$moddir/$i.so "$subpkgdir"/$moddir/
161 done
162}
163
164flite() {
165 pkgdesc="Freeswitch Text To Speech Module"
166 _mv_mod mod_flite
167##
168## The mod_say_xx modules can be used with out flite (for numbers, etc using
169## sound files). So they shouldn't be in the flite package -cB
170##
171# _mv_mod mod_say_de mod_say_en mod_say_es mod_say_fr \
172# mod_say_it mod_say_nl mod_say_zh mod_say_hu mod_say_ru \
173# mod_say_th mod_say_he
174}
175
176sangoma() {
177 pkgdesc="Freeswitch Sangoma Media Transcode Codec Module"
178 _mv_mod mod_sangoma_codec
179}
180
181timezones() {
182 pkgdesc="Freeswitch timezone configuration"
183 replaces="freeswitch-sample-config"
184 mkdir -p "$subpkgdir"/etc/freeswitch/autoload_configs
185 mv "$pkgdir"/etc/freeswitch/autoload_configs/timezones.conf.xml \
186 "$subpkgdir"/etc/freeswitch/autoload_configs
187}
188
189snmp() {
190 pkgdesc="Freeswitch SNMP module"
191 _mv_mod mod_snmp
192}
193
194pgsql() {
195 pkgdesc="Freeswitch PostgreSQL Module"
196 _mv_mod mod_cdr_pg_csv
197}
198
199mariadb() {
200 pkgdesc="Freeswitch MariaDB Module"
201 _mv_mod mod_mariadb
202}
203
204perl() {
205 pkgdesc="Freeswitch Perl module"
206 _mv_mod mod_perl
207}
208
209perlesl() {
210 pkgdesc="Freeswitch Perl ESL module"
211 mkdir -p "$subpkgdir"/usr/lib/perl5
212 mv "$pkgdir"/usr/lib/perl5/* "$subpkgdir"/usr/lib/perl5
213}
214
215python3() {
216 pkgdesc="Freeswitch Python3 module"
217 _mv_mod mod_python3
218}
219
220conf() {
221 pkgdesc="Freeswitch sample configuration"
222 depends="freeswitch-timezones"
223 mkdir -p "$subpkgdir"/etc/freeswitch
224 # move all configs except freeswitch.xml
225 for i in "$pkgdir"/etc/freeswitch/*; do
226 [ "$i" = "$pkgdir"/etc/freeswitch/freeswitch.xml ] && continue
227 mv "$i" "$subpkgdir"/etc/freeswitch/
228 done
229 mkdir -p "$pkgdir"/etc/freeswitch/scripts
230}
231
232sha512sums="
2335f9812b5ffa9964bc17fc4b35e2ffd55b1f11a0f24b4e4b8a1b0abb7e6eb0738dbeb7090ee183ffb8daf2e7871fb31e47f27bb054cd9e0270588fc34b8766066 freeswitch-1.10.12.-release.tar.xz
2344ceb48f64d2bc26a02cc0846276506241bfd30c156422b0a1d608fd172c099feb5c121a763652e9a45046dcdd0ba0eb71eab240e0c6ce2ad63ff781719e135a4 getlib.patch
23598a53f289c3647cafd05b6f847da0504a838a6e06545c133c10fb058c2d941e6bccf2820f44649fc25f94a4a5b7c1280eaee91098e8110f96ed3342c1cb4346c libvpx-fix-arm-float-abi.patch
23616e9208fca7f0a1985dd01ec38ddabb6a79da83ad6ab004bb66de528ac45f02fadaddc50a9f228e1aa38fae213fa5af0ca858b7af629b67a7d654339f813a68c disable-Werror.patch
2374739be0c1c6783ace2bd10f7573b1ca86be013d21a7f973b5fd348c98fb9ed1a548baacee6bb65b7501251106c8dbd7266997f8699d2d7070a2bd7efe145b866 python-3.10.patch
238c71076ebf0cb40f8dc9e3edf9795035a38a619d3e4f0ee143b6c1a86d6cdb3daa3832181af68c4bf48465206acc905432eb2d0211a42e0a25b8c84b886c40c0e gcc14.patch
239ca102730ee6eb10b45a411b926c9aa8126544220e0ee0a1f644ce831e4d4b15fe8ab2ae00e4840605911865552ab5844cd4200127be45d57527c67e953a27edf gcc15.patch
240b2e4e5982e600098e00d5dce801f6159dc3d0765e9de5acc05492b4c811f399b4302c4c6a91d9788d8464d46d9c7a64b70a345130b97aa5a73da41acc57f67de modules.conf
2416acd45b36fc36abd68083431d88f9baff67dbe2491871617afea3b557508b3e8aac669fdb793c3232c66117529108abec5f4d1f3455d755ead84ebce1e7cb4d7 freeswitch.confd
242f74f3a9dd781e49f3590ed63c48515bc9a5871bba51773f38b1c697da7792f7a107b24f2cad85fbe17457d8240d7489ad173658a658c56addc738211b092003b freeswitch.initd
243"