Browse code

Added debug support and a warning about the incompatibility to old versions

Nils Ohlmeier authored on 03/09/2003 00:26:03
Showing 1 changed files
... ...
@@ -1,11 +1,7 @@
1
-# Copyright 1999-2003 Gentoo Technologies, Inc.
1
+# Copyright 1999-2003 Fraunhofer Fokus
2 2
 # Distributed under the terms of the GNU General Public License v2
3 3
 # $Header$
4 4
 
5
-# TODO: 
6
-#  - add USE Debug !!!
7
-#  - remove debug statements
8
-
9 5
 DESCRIPTION="SIP Express Router"
10 6
 
11 7
 HOMEPAGE="http://www.iptel.org/ser"
... ...
@@ -13,17 +9,20 @@ SRC_URI="ftp://ftp.berlios.de/pub/ser/0.8.11/src/${P}_src.tar.gz"
13 9
 
14 10
 LICENSE="GPL-2"
15 11
 SLOT="0"
16
-KEYWORDS="x86"
17
-IUSE="ipv6 mysql postgres"
12
+KEYWORDS="~x86 ~ppc ~sparc"
13
+IUSE="debug ipv6 mysql postgres"
18 14
 
19 15
 DEPEND=">=sys-devel/gcc-2.95.3
20 16
 		>=sys-devel/bison-1.35
21 17
 		>=sys-devel/flex-2.5.4a
22
-		mysql? ( >=dev-db/mysql-3.23.52 )"
18
+		mysql? ( >=dev-db/mysql-3.23.52 )
19
+		postgres? ( >=dev-db/postgresql-7.3.4 )"
23 20
 
24 21
 S="${WORKDIR}/${P}"
25 22
 
26 23
 inc_mod=""
24
+make_options=""
25
+
27 26
 check_mods() {
28 27
 	if [ "`use mysql`" ]; then
29 28
 		inc_mod="${inc_mod} mysql"
... ...
@@ -51,11 +50,16 @@ src_compile() {
51 50
 		cp Makefile.defs Makefile.defs.orig 
52 51
 		sed -e "s/-DUSE_IPV6//g" Makefile.defs.orig > Makefile.defs;
53 52
 	fi
53
+	# optimization can result in strange debuging symbols so omit it in case
54
+	if [ "`use debug`" ]; then
55
+		make_options="${make_options} mode=debug"
56
+	else
57
+		make_options="${make_options} CFLAGS=${CFLAGS}"
58
+	fi
54 59
 
55 60
 	check_mods
56
-echo "Mods: ${inc_mod}"
57 61
 
58
-	make all CFLAGS="${CFLAGS}" \
62
+	make all "${make_options}" \
59 63
 		prefix=${D}/ \
60 64
 		include_modules="${inc_mod}" \
61 65
 		cfg-prefix=/ \
... ...
@@ -64,7 +68,7 @@ echo "Mods: ${inc_mod}"
64 68
 
65 69
 src_install () {
66 70
 	check_mods
67
-echo "Mods: ${inc_mod}"
71
+
68 72
 	make install \
69 73
 		prefix=${D}/ \
70 74
 		include_modules="${inc_mod}" \
... ...
@@ -89,6 +93,14 @@ echo "Mods: ${inc_mod}"
89 93
 	fi
90 94
 }
91 95
 
96
+pkg_postinst() {
97
+	einfo "WARNING: If you upgraded from a previous Ser version"
98
+	einfo "please read the README, NEWS and INSTALL files in the"
99
+	einfo "documentation directory because the database and the"
100
+	einfo "configuration file of old Ser versions are incompatible"
101
+	einfo "with the current version."
102
+}
103
+
92 104
 pkg_prerm () {
93 105
 	/etc/init.d/ser stop >/dev/null
94 106
 }