summaryrefslogtreecommitdiffstats
path: root/main/sems/APKBUILD
blob: f11dbe5bea9241138373fa69897ed1e023ca18f0 (plain)
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
# Contributor: Francesco Colista <francesco.colista@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sems
pkgver=1.5.0
pkgrel=3
pkgdesc="SIP Express Media Server, an extensible SIP media server"
url="http://iptel.org/sems/"
arch="all"
license="GPLv2+"
pkgusers="sems"
pkggroups="sems"
install="$pkgname.pre-install"
makedepends="python-dev cmake bash openssl-dev
	libsamplerate-dev spandsp-dev flite-dev gsm-dev speex-dev
	"
subpackages="$pkgname-doc $pkgname-conf_auth $pkgname-conference
	$pkgname-diameter_client $pkgname-dsm $pkgname-early_announce
	$pkgname-g722 $pkgname-gsm $pkgname-ivr $pkgname-mailbox
	$pkgname-pin_collect $pkgname-speex $pkgname-xmlrpc2di"

source="ftp://ftp.iptel.org/pub/sems/sems-$pkgver.tar.gz
	sems-0001-Force-to-use-system-wide-GSM-includes.patch
	sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch
	sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch
    sems-0004-fix-PRACK-route.patch
	sems.initd
	"
#	sems-0005-Add-sw_prepaid_sip-plugin-to-default-exclude-list-du.patch
#	sems-0006-last-minute-fix-proper-version.patch
#	sems-0008-Install-email-template.patch
#	sems-0009-Don-t-start-py_sems-by-default.patch

# applied:
#	sems-0007-Fix-gateway-module-s-version-passing-in-CMake.patch
#	sems-0010-Move-CMake-defines.patch

_builddir="$srcdir/$pkgname-$pkgver"
prepare() {
	cd "$_builddir"
	rm -rf core/plug-in/gsm/gsm-1.0-pl10/
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}


build() {
	cd "$_builddir"
	# force cmake to use relative paths. It helps us avoid having the
	# full file path in the logs
	cmake \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_USE_RELATIVE_PATHS=yes \
		-DSEMS_USE_SPANDSP=yes \
		-DSEMS_USE_LIBSAMPLERATE=yes \
		-DSEMS_USE_ZRTP=NO \
		-DSEMS_USE_MP3=NO \
		-DSEMS_USE_ILBC=NO \
		-DSEMS_USE_TTS=yes \
		-DSEMS_USE_OPENSSL=yes \
		-DSEMS_USE_MONITORING=yes \
		-DSEMS_USE_IPV6=NO \
		-DSEMS_CFG_PREFIX= \
		-DSEMS_AUDIO_PREFIX=/usr/share \
		-DSEMS_EXEC_PREFIX=/usr \
		-DSEMS_LIBDIR=lib \
		|| return 1
	make
}

package() {
	cd "$_builddir"
	make install DESTDIR="$pkgdir"
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1
	# is empty
	rm -f "$pkgdir"/etc/sems/etc/conf_auth.conf

	install -o sems -g sems -d "$pkgdir"/var/spool/voicebox
	install -d -o sems  "$pkgdir"/var/run/sems
}

_mv_sub() {
	local i
	for i in "$@"; do
		mkdir -p "$subpkgdir"/${i%/*}
		mv "$pkgdir"/$i "$subpkgdir"/$i
	done
}

conf_auth() {
	pkgdesc="Conference with authorization for SEMS"
	depends="sems sems-ivr"
	cd "$pkgdir"
	_mv_sub usr/lib/sems/ivr/conf_auth*
}

conference() {
	pkgdesc="Conferencing application for SEMS"
	depends="sems"
	cd "$pkgdir"
	_mv_sub etc/sems/etc/conference.conf \
		usr/lib/sems/plug-in/conference.so \
		usr/share/sems/audio/conference
}

diameter_client() {
	pkgdesc="A simple DIAMETER client implementation for SEMS"
	depends="sems"
	cd "$pkgdir"
	_mv_sub usr/lib/sems/plug-in/diameter_client.so
}

dsm() {
	pkgdesc="The state machine interpreter for SEMS"
	depends="sems"
	cd "$pkgdir"
	_mv_sub etc/sems/etc/dsm* \
		usr/lib/sems/plug-in/dsm.so \
		usr/lib/sems/dsm
}

early_announce() {
	pkgdesc="Early announce application for SEMS"
	depends="sems"
	cd "$pkgdir"
	_mv_sub etc/sems/etc/early_announce.conf \
		usr/lib/sems/plug-in/early_announce.so
}

g722() {
	pkgdesc="G.722 support for SEMS"
	depends="sems"
	_mv_sub usr/lib/sems/plug-in/g722.so
}

#gateway() {
#	pkgdesc="ISDN gateway for SEMS"
#	depends="sems"
#}

gsm() {
	pkgdesc="GSM support for SEMS"
	depends="sems"
	_mv_sub usr/lib/sems/plug-in/gsm.so
}

ivr() {
	pkgdesc="IVR functionallity for SEMS"
	depends="sems python"
	cd "$pkgdir"
	_mv_sub etc/sems/etc/ivr.conf \
		usr/lib/sems/plug-in/ivr.so \
		usr/lib/sems/ivr/log.*
}

mailbox() {
	pkgdesc="Mailbox application for SEMS"
	depends="sems sems-ivr"
	cd "$pkgdir"
	_mv_sub etc/sems/etc/mailbox*.conf \
		usr/share/sems/audio/mailbox \
		usr/lib/sems/plug-in/ivr.so \
		usr/lib/sems/ivr/*mailbox*
}

pin_collect() {
	pkgdesc="Collects a PIN for SEMS"
	depends="sems sems-ivr"
	cd "$pkgdir"
	_mv_sub etc/sems/etc/pin_collect.conf \
		usr/share/sems/audio/pin_collect \
		usr/lib/sems/plug-in/ivr.so \
		usr/lib/sems/ivr/pin_collect*
}

_python() {
	pkgdesc="Python bindings for SEMS"
	depends="python sems"
	cd "$pkgdir"
	_mv_sub \
		usr/lib/sems/plug-in/py_sems*
}

speex() {
	pkgdesc="Speex support for SEMS"
	depends="sems"
	_mv_sub usr/lib/sems/plug-in/speex.so
}

xmlrpc2di() {
	pkgdesc="XMLRPC interface for SEMS"
	depends="sems"
	_mv_sub \
		etc/sems/etc/xmlrpc2di.conf \
		usr/lib/sems/plug-in/xmlrpc2di.so
}


md5sums="ec0a88f9081679b3b4ab9d06e84ea759  sems-1.5.0.tar.gz
5b2fded836b44bda33f39adc37de4de7  sems-0001-Force-to-use-system-wide-GSM-includes.patch
b8efd1a6415afa08f7c676f6976fca36  sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch
331e7529833c906b4738006f32a65fde  sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch
62f03dac8e098b0333f3e8b06770b459  sems-0004-fix-PRACK-route.patch
36c2f993ba874781f5d3974b4f4c1503  sems.initd"
sha256sums="aec3dd76911d76b9a2ffbb82c6e36ba828514ccf500b7ab9df45ac7f8ef78547  sems-1.5.0.tar.gz
a36950f68e78af21f0e1152bb01e2f25f74b8c63210eecc01e4a4f90cf841371  sems-0001-Force-to-use-system-wide-GSM-includes.patch
0992f15e2a5c58d63a5a06dda027323e203fbf67d57022c11d5d63fd953088bc  sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch
04e0b2a944c5f64305e5711f5dfdcf4675fc7980225ef87267fcaff241168d46  sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch
2f2d7f6318dd6d202266aa96fab310ad2d7740286aa624d71f0f4b2c6636602e  sems-0004-fix-PRACK-route.patch
ebfd6b21fc447a0dd22651c25e2be78df8d158c1e321dc21870b81f0adfa134d  sems.initd"
sha512sums="f0e055bd33fac106ac2592e977a03b5e2fe93f539e0b60a7bf61881434849b119efebdd4784e0c9c06149992765db5995441e45fb23d0217726c6293c7984baf  sems-1.5.0.tar.gz
87c6f878c3ad5e947a9a80431ddf28f08c04ce1415b7c42878f66b423c78d909efda836c7c2d3ed97e075c08d7a07c4707a49c14ce42c1a3aa350de1878c8d09  sems-0001-Force-to-use-system-wide-GSM-includes.patch
4c09033d6acd1bbef2aa2d02571f74da29532decca67b9ce861872d8d9522ca31808d6e26c3b536913ef7a988f90d374e217187b9cadb6a79d5c830571e94b67  sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch
ba6f0d917464729c63628255bee3d864a954af4a510b802f0de1d51f35ff5d7c1c33cbe14db31818133a3c94f84da0f4bea4184ce1e8eae6aa9a1ba79f2e5347  sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch
816d93ef9ab5a38b8cb03ee5c68b9dd3ad3cb810e021b02c24def45ddd4d7f8223bb3f1fee5b897de18db323fc2ea99c4279bc0d0246e3926edb5604d37e1ffb  sems-0004-fix-PRACK-route.patch
db17090f1163873e24cd66fabc6c7b2ad108104bfe1f3e446381021f2d3c1bbb64f320cbce746809a49d4f1d723fd3af090981b49bca35ff6a78e6a6e9add17b  sems.initd"