aboutsummaryrefslogtreecommitdiffstats
path: root/main/freeswitch/APKBUILD
blob: e3037b5bd9b245c35d2af3800c520f1e4b6ddbf3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Michael Mason <ms13sp@gmail.com>
# Contributor: Cameron Banta <cbanta@gmail.com>
pkgname=freeswitch
pkgver=1.6.2
pkgrel=5
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
	flite-dev
	gnutls-dev
	ilbc-dev
	ldns-dev
	lame-dev
	libedit-dev
	libjpeg-turbo-dev
	libogg-dev
	libpri-dev
	libshout-dev
	libsndfile-dev
	libvorbis-dev
	linux-headers
	lua5.2-dev
	mpg123-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
	xmlrpc-c-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="
	"

source="http://files.freeswitch.org/freeswitch-releases/$pkgname-$pkgver.tar.xz
	$_libsources
	0001-FS-8427-Incompatible-type-for-ld-in-prinrtf.patch
	getlib.patch
	modules.conf
	freeswitch.confd
	freeswitch.initd
	FS-8612-calls-crash-due-to-read-codec-leak.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
		*.patch) msg $i; cd "$_builddir"; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	cd "$srcdir"
	update_config_sub || return 1
}

build() {
	cd "$_builddir"
	cp -f "$srcdir/modules.conf" modules.conf || return 1

	CFLAGS="-Wno-unused-but-set-variable" ./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-fhs \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--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 \
		--enable-system-xmlrpc-c \
		|| 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

	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="6e7fbf77be0fcccecf12284437e6cbda  freeswitch-1.6.2.tar.xz
80d7f0aa84278f5236805753ec3e3f1f  0001-FS-8427-Incompatible-type-for-ld-in-prinrtf.patch
1e7f335ee00f589825ecc9affa779346  getlib.patch
f99cb4857c5b79fc6646855fe74527c7  modules.conf
c608cca8ad773acebf201f581438c7e7  freeswitch.confd
3b0bf4847a61afa28229b58763f4c400  freeswitch.initd
078925cba3d5c6b70071acfb591d3fc8  FS-8612-calls-crash-due-to-read-codec-leak.patch"
sha256sums="cf26f491469d2f744fb48ba0a7e25cefd96305e0ef385eda09fca82c096bb48f  freeswitch-1.6.2.tar.xz
cc8e509c7aab120eb74a23b2c2a8c64e00497377ea9fc5572559c3361ddfefec  0001-FS-8427-Incompatible-type-for-ld-in-prinrtf.patch
ab437c92149b6fc88bc2fc8a228d6a5f8af574e2c90469a6dc4c753d13972c34  getlib.patch
212f6b4e8463cf2e1266582479f965fd96416c45cda0b016d0becd6e71fec015  modules.conf
846a29a361ef6eecd77876963b5c0133699c40fa8b34c68df42d5f8a1a1915b1  freeswitch.confd
aa0d89221ffa47eba4a0e085f6041ee198476409dd15d1e90c5c357ba683f432  freeswitch.initd
cf40b3845a35c0de97c71b4fce2a49ad8d08d95a649dda30fcacb28e8a9be872  FS-8612-calls-crash-due-to-read-codec-leak.patch"
sha512sums="b85ebbdc0f4111f76e798b91d23d05b63966fe8ac273bc2581857c1b9b810f970f25fd244ce40884d4939e835c72d7700448ea663a4f2650eb34d67325aa0517  freeswitch-1.6.2.tar.xz
5faaf44f36430ad18769b36e45571320a139e853f6adec2ed0f2c16fffdcd0461a30a674dbae18edc0701a5c1e76f5ddb30962960421db6b103e2f220b9482d0  0001-FS-8427-Incompatible-type-for-ld-in-prinrtf.patch
4ceb48f64d2bc26a02cc0846276506241bfd30c156422b0a1d608fd172c099feb5c121a763652e9a45046dcdd0ba0eb71eab240e0c6ce2ad63ff781719e135a4  getlib.patch
e5027d504c63a2f51419c8b071f4a7d3499177cf2bfd8782e039137475e20910cf3f654848e2d86ecdbcba147592ebdc988ee9083272d7c88f60322bcefa7a6a  modules.conf
a585f6411185a26206137a1ad97a06fd6c73e80c5439e9be45eabfa70e7a83120169ba882971fcd328436c8e0242cbd664170b80754ea2846021689baf1f1595  freeswitch.confd
643d0a2e43f5d3bf3b99fcb6f6422302cb4b74a95eccf844eafb100b15aa9856b4ff41f112d6637255c2e9e2bec9fedc9a9215dfff214dfb83b52eae16b71dca  freeswitch.initd
f951a6e065f638d3259f4897702dcf240d84a7b1204a0e7f51d60ab625e8eed74421c58bc58f08e1cd72db339e8166726545a6001a18e6cd56d54e4d57d2f46d  FS-8612-calls-crash-due-to-read-codec-leak.patch"