Browse code

preliminary version (tarball and digest have to be created by hand for testing)

Nils Ohlmeier authored on 27/08/2003 21:03:45
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,94 @@
1
+# Copyright 1999-2003 Gentoo Technologies, Inc.
2
+# Distributed under the terms of the GNU General Public License v2
3
+# $Header$
4
+
5
+# TODO: 
6
+#  - add USE Debug !!!
7
+#  - remove debug statements
8
+
9
+DESCRIPTION="SIP Express Router"
10
+
11
+HOMEPAGE="http://www.iptel.org/ser"
12
+SRC_URI="ftp://ftp.berlios.de/pub/ser/0.8.11/src/${P}_src.tar.gz"
13
+
14
+LICENSE="GPL-2"
15
+SLOT="0"
16
+KEYWORDS="x86"
17
+IUSE="ipv6 mysql postgres"
18
+
19
+DEPEND=">=sys-devel/gcc-2.95.3
20
+		>=sys-devel/bison-1.35
21
+		>=sys-devel/flex-2.5.4a
22
+		mysql? ( >=dev-db/mysql-3.23.52 )"
23
+
24
+S="${WORKDIR}/${P}"
25
+
26
+inc_mod=""
27
+check_mods() {
28
+	if [ "`use mysql`" ]; then
29
+		inc_mod="${inc_mod} mysql"
30
+	fi
31
+	if [ "`use postgres`" ]; then
32
+		inc_mod="${inc_mod} postgres"
33
+	fi
34
+	
35
+	# test some additional modules for which
36
+	# no USE variables exist
37
+	
38
+	# jabber module requires dev-libs/expat
39
+	if [ -f "/usr/include/expat.h" ]; then
40
+		inc_mod="${inc_mod} jabber"
41
+	fi
42
+	# Radius modules requires installed radiusclient
43
+	# which is not in portage yet
44
+	if [ -f "/usr/include/radiusclient.h" -o  -f "/usr/local/include/radisuclient.h" ]; then
45
+		inc_mod="${inc_mod} auth_radius group_radius uri_radius"
46
+	fi
47
+}
48
+
49
+src_compile() {
50
+	if [ ! "`use ipv6`" ]; then
51
+		cp Makefile.defs Makefile.defs.orig 
52
+		sed -e "s/-DUSE_IPV6//g" Makefile.defs.orig > Makefile.defs;
53
+	fi
54
+
55
+	check_mods
56
+echo "Mods: ${inc_mod}"
57
+
58
+	make all CFLAGS="${CFLAGS}" \
59
+		prefix=${D}/ \
60
+		include_modules="${inc_mod}" \
61
+		cfg-prefix=/ \
62
+		cfg-target=/etc/ser/ || die
63
+}
64
+
65
+src_install () {
66
+	check_mods
67
+echo "Mods: ${inc_mod}"
68
+	make install \
69
+		prefix=${D}/ \
70
+		include_modules="${inc_mod}" \
71
+		bin-prefix=${D}/usr/sbin \
72
+		bin-dir="" \
73
+		cfg-prefix=${D}/etc \
74
+		cfg-dir=ser/ \
75
+		cfg-target=/etc/ser \
76
+		modules-prefix=${D}/usr/lib/ser \
77
+		modules-dir=modules \
78
+		modules-target=/usr/lib/ser/modules/ \
79
+		man-prefix=${D}/usr/share/man \
80
+		man-dir="" \
81
+		doc-prefix=${D}/usr/share/doc \
82
+		doc-dir=${P} || die
83
+	exeinto /etc/init.d
84
+	newexe gentoo/ser.init ser
85
+
86
+	# fix what the Makefile don't do
87
+	if [ ! "`use mysql`" ]; then
88
+		rm ${D}/usr/sbin/ser_mysql.sh
89
+	fi
90
+}
91
+
92
+pkg_prerm () {
93
+	/etc/init.d/ser stop >/dev/null
94
+}