aboutsummaryrefslogtreecommitdiffstats
path: root/testing/sems/APKBUILD
blob: c261a43eff9e2efb11d762a95769cc9ce3d400f5 (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
# Contributor: Francesco Colista <francesco.colista@gmail.com>
# Maintainer: Francesco Colista <francesco.colista@gmail.com>
pkgname=sems
pkgver=1.2.1
pkgrel=1
pkgdesc="High performance, extensible media server for SIP (RFC3261) based VoIP  services"
url="http://iptel.org/sems/"
arch="x86 x86_64"
license="GPL-2"
install="$pkgname.pre-install $pkgname.post-install"
makedepends="python-dev openssl-dev cmake bash"
source="http://ftp.iptel.org/pub/sems/sems-$pkgver.tar.gz
	0003-cc-and-cflags.patch
	sems.conf
	sems.initd
	"

prepare() {
	cd "$srcdir"/$pkgname-$pkgver
	for i in "$srcdir"/*.patch; do
		[ -f "$i" ] || continue
		msg "Applying $i"
		patch -p1 -i $i || return 1
	done

	sed -i -e 's:^cfg-prefix.*:cfg-prefix = $(basedir):' \
	       -e 's:^cfg-target.*:cfg-target = $(cfg-dir):' \
		Makefile.defs \
		|| return 1

	# Patch for fixin unistd.h 
	sed -i -e 's:\*\/:\n*\/\n#include <unistd.h>:'  core/AmArg.cpp
	sed -i -e 's:\*\/:\n*\/\n#include <unistd.h>:'  core/AmMediaProcessor.cpp
	sed -i -e 's:\*\/:\n*\/\n#include <unistd.h>:'  core/AmRtpReceiver.cpp
	sed -i -e 's:\*\/:\n*\/\n#include <unistd.h>:'	core/plug-in/sipctrl/udp_trsp.cpp
	sed -i -e 's:\*\/:\n*\/\n#include <unistd.h>:'  core/plug-in/stats/query_stats.cxx
	sed -i -e 's:\*\/:\n*\/\n#include <unistd.h>:'  apps/annrecorder/AnnRecorder.cpp
	sed -i -e 's:\*\/:\n*\/\n#include <unistd.h>:'  apps/callback/CallBack.cpp
	sed -i -e 's:\*\/:\n*\/\n#include <unistd.h>:'  apps/diameter_client/ServerConnection.cpp
	sed -i -e 's:\*\/:\n*\/\n#include <unistd.h>:'  apps/dsm/mods/mod_sys/ModSys.cpp
}


build() {
	cd "$srcdir"/$pkgname-$pkgver

	make	PREFIX=/usr \
		cfg-target=/etc/sems/ \
		exclude_modules+="ivr examples py_sems speex gateway mp3 echo g722" \
		WITH_MPG123DECODER=no \
		all || return 1
}

package() {
	cd "$srcdir"/$pkgname-$pkgver

	make	PREFIX=/usr \
		DESTDIR="$pkgdir" \
		cfg-target=/etc/sems/ \
		cfg-prefix="$pkgdir" \
		exclude_modules+="ivr examples py_sems speex gateway mp3 echo g722" \
		WITH_MPG123DECODER=no \
		install || return 1

	 install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	 install -m644 -D "$srcdir"/$pkgname.conf "$pkgdir"/etc/sems/$pkgname.conf
}

md5sums="f0545c0708849e1a723d453244c2a79e  sems-1.2.1.tar.gz
0054e6ed7e11393e71204876179d3199  0003-cc-and-cflags.patch
8b74528c8605b7adb01a0133fcd0c247  sems.conf
2e738c6402eb1fbceb279cf050a9090f  sems.initd"