APKBUILD 6.39 KB
Newer Older
1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2 3
# Contributor: Michael Mason <ms13sp@gmail.com>
# Contributor: Cameron Banta <cbanta@gmail.com>
4
pkgname=freeswitch
5 6
pkgver=1.8.7
pkgrel=0
7 8
pkgdesc="A communications platform written in C from the ground up"
url="http://www.freeswitch.org"
9
arch="all"
10
license="MPL-1.1"
11 12
makedepends="
	bash
13
	bsd-compat-headers
14
	coreutils
15
	curl-dev
16
	db-dev
17
	flac-dev
18
	flite-dev
19
	gdbm-dev
20
	gnutls-dev
21
	ilbc-dev
22
	lame-dev
23
	ldns-dev
24
	libedit-dev
25
	libexecinfo-dev
26 27 28
	libjpeg-turbo-dev
	libogg-dev
	libpri-dev
29
	openssl-dev
30 31
	libshout-dev
	libsndfile-dev
32 33
	libvorbis-dev
	linux-headers
34
	lua5.3-dev
35
	mpg123-dev
36 37
	ncurses-dev
	net-snmp-dev
38
	opus-dev
39
	pcre-dev
40
	perl-dev
41 42 43 44 45 46
	portaudio-dev
	postgresql-dev
	sngtc_client-dev
	speex-dev
	speexdsp-dev
	sqlite-dev
47
	tiff-dev
48 49
	unixodbc-dev
	util-linux-dev
50
	xmlrpc-c-dev
51
	yasm
52 53 54
	zlib-dev
	autoconf automake libtool
	"
55
install="$pkgname.pre-install $pkgname.pre-upgrade"
56 57 58 59
FREESWITCH_USER=freeswitch
FREESWITCH_GROUP=freeswitch
pkgusers="$FREESWITCH_USER"
pkggroups="$FREESWITCH_GROUP"
60
subpackages="$pkgname-static $pkgname-dev $pkgname-flite $pkgname-timezones::noarch
61
	$pkgname-sample-config:conf:noarch $pkgname-freetdm $pkgname-sangoma
62 63
	$pkgname-snmp $pkgname-pgsql $pkgname-perl $pkgname-perlesl
	$pkgname-openrc $pkgname-dbg"
64

65
source="https://files.freeswitch.org/freeswitch-releases/$pkgname-$pkgver.tar.xz
66
	0001-sofia-sip-byte-order.patch
67
	0002-FS-verto-bswap_64.patch
68
	configure-lua53.patch
69 70
	include-lua53.patch
	getlib.patch
71
	libvpx-fix-arm-float-abi.patch
72
	disable-Werror.patch
73
	modules.conf
74
	freeswitch.confd
75
	freeswitch.initd
76 77
	"

78
builddir="$srcdir/$pkgname-$pkgver"
79

80
prepare() {
81
	default_prepare
82
	autoreconf -vif
83
	update_config_sub
84 85
}

86
build() {
87
	cd "$builddir"
88
	cp -f "$srcdir/modules.conf" modules.conf
89
	CFLAGS="-Wno-unused-but-set-variable" ./configure \
90 91
		--build=$CBUILD \
		--host=$CHOST \
92
		--prefix=/usr \
93
		--enable-fhs \
94 95
		--localstatedir=/var \
		--sysconfdir=/etc \
96
		--with-scriptdir=/etc/freeswitch/scripts \
97
		--mandir=/usr/share/man \
98
		--infodir=/usr/share/info \
99
		--with-devrandom=/dev/urandom \
Jeff Bilyk's avatar
Jeff Bilyk committed
100
		--with-libpri \
101
		--disable-debug \
102
		--enable-core-pgsql-support \
103
		--enable-system-lua \
104
		--enable-system-xmlrpc-c
105

106 107
	# build freetdm with -lexecinfo
	make -C libs/freetdm LIBS="-lexecinfo"
108
	# first build libfreeswitch (in parallel)
109
	make src/include/switch_version.h src/include/switch_swigable_cpp.h
110
	make libfreeswitch.la
111
	# finally we build the rest
112
	make -j1 all
113 114

	# build perlesl module
115
	cd "$builddir"/libs/esl
116
	make -j1 perlmod
117

118 119
}
package(){
120
	cd "$builddir"
121
	make -j1 DESTDIR="$pkgdir" install samples-conf samples-htdocs
Natanael Copa's avatar
Natanael Copa committed
122

123
	install -m755 -D "$srcdir"/$pkgname.initd \
124
		"$pkgdir"/etc/init.d/$pkgname
125
	install -m644 -D "$srcdir"/$pkgname.confd \
126
		"$pkgdir"/etc/conf.d/$pkgname
127
	chown -R $FREESWITCH_USER:$FREESWITCH_GROUP "$pkgdir"/var/*/freeswitch
128 129

	# install perlesl module
130
	cd "$builddir"/libs/esl
131
	make -j1 DESTDIR="$pkgdir" perlmod-install
132 133
}

134 135

_mv_mod() {
136
	local moddir=usr/lib/freeswitch/mod i=
137 138
	mkdir -p "$subpkgdir"/$moddir
	for i in $@; do
139
		mv "$pkgdir"/$moddir/$i.so "$subpkgdir"/$moddir/
140 141 142 143 144 145 146
	done
}


flite() {
        pkgdesc="Freeswitch Text To Speech Module"
        install=
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
        _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/
163 164
}

165 166 167 168 169 170
sangoma() {
	pkgdesc="Freeswitch Sangoma Media Transcode Codec Module"
	install=
	_mv_mod mod_sangoma_codec
}

171 172 173 174 175 176 177 178 179
timezones() {
	pkgdesc="Freeswitch timezone configuration"
	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
}

180 181 182 183 184 185 186 187 188 189 190 191
snmp() {
	pkgdesc="Freeswitch SNMP module"
	install=
	_mv_mod mod_snmp
}

pgsql() {
	pkgdesc="Freeswitch PostgreSQL Module"
	install=
	_mv_mod mod_cdr_pg_csv
}

192 193 194 195 196 197 198 199 200 201 202 203 204
perl() {
	pkgdesc="Freeswitch Perl module"
	install=
	_mv_mod mod_perl
}

perlesl() {
	pkgdesc="Freeswitch Perl ESL module"
	install=
	mkdir -p "$subpkgdir"/usr/lib/perl5
	mv "$pkgdir"/usr/lib/perl5/* "$subpkgdir"/usr/lib/perl5
}

205 206
conf() {
	pkgdesc="Freeswitch sample configureation"
207
	depends="freeswitch-timezones"
208
	install=
209
	mkdir -p "$subpkgdir"/etc/freeswitch
210 211 212
	# move all configs except freeswitch.xml
	for i in "$pkgdir"/etc/freeswitch/*; do
		[ "$i" = "$pkgdir"/etc/freeswitch/freeswitch.xml ] && continue
213
		mv "$i" "$subpkgdir"/etc/freeswitch/
214
	done
215
	mkdir -p "$pkgdir"/etc/freeswitch/scripts
216
}
217

218
sha512sums="d395368989763ef35fe4f700692febfc18e548a2a7ed13ffde87ed5330b4f5b39ef322b4aaed69c0c84192b42b2fe11c7f778826902851d139cec1f702a98b56  freeswitch-1.8.7.tar.xz
219
8a7ca31cc80524b02edc83af891a32af64dd7834ac14b1389112f2ce7fe06fe602d24509a299898f25e807dd0b88544aecb990bf4bd37ee1c7023ae58dacd28a  0001-sofia-sip-byte-order.patch
220
5f93150e1acd632df98bc3bed5613fb1e45180ae4096dcfee5c060da213c8355339260eaf5758cd77c785f6d84cf0661650a872ec574b586ab19803d4f6955f8  0002-FS-verto-bswap_64.patch
221 222
222e3510790de29e29428c70325eb1d4e7852eb4315ee546f137293868bd71acf89e7c85c5ca9d0eb708090c9eef91878a8e12c1b9d5cc99a68fecbd42ad962f  configure-lua53.patch
c1960f3c7acf729468b819f7f15d66a251c3967b2784bce18c7755b333156e687c55fdc1aceda588ceb1bf9638e2fd4a31a169b00b15c5040cf1001c3c73913b  include-lua53.patch
223
4ceb48f64d2bc26a02cc0846276506241bfd30c156422b0a1d608fd172c099feb5c121a763652e9a45046dcdd0ba0eb71eab240e0c6ce2ad63ff781719e135a4  getlib.patch
224
98a53f289c3647cafd05b6f847da0504a838a6e06545c133c10fb058c2d941e6bccf2820f44649fc25f94a4a5b7c1280eaee91098e8110f96ed3342c1cb4346c  libvpx-fix-arm-float-abi.patch
225
16e9208fca7f0a1985dd01ec38ddabb6a79da83ad6ab004bb66de528ac45f02fadaddc50a9f228e1aa38fae213fa5af0ca858b7af629b67a7d654339f813a68c  disable-Werror.patch
226
6deecb303e765d44bdd970d5a7079c9dd9ce17d12056b68cd978a182a86b477b4a3c19d2f5a18f36199ca2e0594a3b84de521ab821e2f8c89f7449a3d7f21279  modules.conf
227
a585f6411185a26206137a1ad97a06fd6c73e80c5439e9be45eabfa70e7a83120169ba882971fcd328436c8e0242cbd664170b80754ea2846021689baf1f1595  freeswitch.confd
228
643d0a2e43f5d3bf3b99fcb6f6422302cb4b74a95eccf844eafb100b15aa9856b4ff41f112d6637255c2e9e2bec9fedc9a9215dfff214dfb83b52eae16b71dca  freeswitch.initd"