/[gentoo-x86]/net-misc/ser/ser-0.9.6.ebuild
Gentoo

Contents of /net-misc/ser/ser-0.9.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Fri Aug 28 21:22:47 2009 UTC (10 years, 3 months ago) by betelgeuse
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Remove old version.
(Portage version: 2.2_rc38/cvs/Linux i686)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/ser/ser-0.9.6.ebuild,v 1.6 2008/06/15 11:04:25 zmedico Exp $
4
5 inherit eutils flag-o-matic toolchain-funcs multilib
6
7 IUSE="ipv6 mysql radius postgres jabber ldap ssl"
8
9 ETHZ_PV="1.0"
10 LDAP_PV="1.0"
11 LDAPS_PV="1.0"
12 SILOMAIL_PV="1.0"
13 MODULES_PV="0.9.0"
14
15 DESCRIPTION="SIP Express Router"
16 HOMEPAGE="http://www.iptel.org/ser"
17 SRC_URI="http://ftp.iptel.org/pub/ser/${PV}/src/${P}_src.tar.gz
18 mirror://gentoo/silomail-${SILOMAIL_PV}-${PN}-${MODULES_PV}.tar.gz
19 mirror://gentoo/ethz-${ETHZ_PV}-${PN}-${MODULES_PV}.tar.gz
20 ldap? ( mirror://gentoo/ldap-${LDAP_PV}-${PN}-${MODULES_PV}.tar.gz
21 mirror://gentoo/ldaps-${LDAPS_PV}-${PN}-${MODULES_PV}.tar.gz )"
22
23 SLOT="0"
24 LICENSE="GPL-2"
25 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
26
27 RDEPEND="
28 mysql? ( virtual/mysql )
29 radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
30 postgres? ( virtual/postgresql-server )
31 jabber? ( dev-libs/expat )
32 ldap? (
33 net-nds/openldap
34 ssl? ( dev-libs/openssl )
35 )"
36
37 DEPEND="${RDEPEND}
38 >=sys-devel/bison-1.35
39 >=sys-devel/flex-2.5.4a"
40
41 pkg_setup() {
42 enewgroup ser
43 enewuser ser -1 -1 /dev/null ser
44 }
45
46 src_unpack() {
47 local modules extmodules MY_A x
48
49 # unpack ser source
50 unpack ${P}_src.tar.gz
51
52 cd "${S}"
53 use ipv6 || \
54 sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
55 sed -i -e 's/\(CFLAGS+=-mcpu=ultrasparc\) -minline-all-stringops/\1/g' \
56 Makefile.defs || die #157109
57
58 # external modules
59 extmodules="silomail ethz"
60
61 use mysql && \
62 modules="${modules} mysql"
63
64 use radius && \
65 modules="${modules} auth_radius group_radius uri_radius avp_radius"
66
67 use jabber && \
68 modules="${modules} jabber"
69
70 use postgres && \
71 modules="${modules} postgres"
72
73 use ldap && \
74 extmodules="${extmodules} ldap"
75
76 use ldap && use ssl && \
77 extmodules="${extmodules} ldaps"
78
79 # put list of modules into Makefile, we need the list
80 # during compile and install phase...
81 sed -i -e "s:^\(include_modules.*\):\1 ${modules} ${extmodules}:" \
82 Makefile || die
83
84 # fix ser.cfg
85 sed -i -e "/force_send_socket(smaug:5080);/ d" \
86 etc/ser.cfg || die
87
88 # unpack external modules
89 # ugly i know...
90 for x in ${extmodules}; do
91 MY_A=$(eval echo ${x}-\${$(echo ${x} | tr "[:lower:]" "[:upper:]")_PV}-${PN}-${MODULES_PV})
92 mkdir -p "${S}"/modules/${x}
93 cd "${S}"/modules/${x}
94 unpack ${MY_A}.tar.gz
95 # fix makefiles
96 if [[ -f "${FILESDIR}"/${MY_A}.diff ]]; then
97 epatch "${FILESDIR}"/${MY_A}.diff
98 fi
99 done
100
101 # remove sasl if openldap hasn't been built with it
102 if use ldap && ! built_with_use net-nds/openldap sasl; then
103 sed -i -e "s:-lsasl::g" \
104 "${S}"/modules/ldap/Makefile || die
105
106 if use ssl; then
107 sed -i -e "s:-lsasl::g" \
108 "${S}"/modules/ldaps/Makefile || die
109 fi
110 fi
111 }
112
113 src_compile() {
114 # add -fPIC
115 append-flags -fPIC
116
117 emake all \
118 CC="`tc-getCC`" \
119 CFLAGS="${CFLAGS}" \
120 cfg-prefix=/ \
121 cfg-target=/etc/ser/ \
122 ${myconf} || die
123 }
124
125 src_install () {
126 emake install \
127 prefix="" \
128 bin-prefix="${D}"/usr/sbin \
129 bin-dir="" \
130 cfg-prefix="${D}"/etc \
131 cfg-dir=ser/ \
132 cfg-target=/etc/ser/ \
133 modules-prefix="${D}"/usr/$(get_libdir)/ser \
134 modules-dir=modules \
135 modules-target=/usr/$(get_libdir)/ser/modules/ \
136 man-prefix="${D}"/usr/share/man \
137 man-dir="" \
138 doc-prefix="${D}"/usr/share/doc \
139 doc-dir=${P} || die
140
141 newinitd "${FILESDIR}"/ser.rc6 ser
142 newconfd "${FILESDIR}"/ser.confd ser
143 exeinto /usr/sbin
144 newexe scripts/harv_ser.sh harv_ser.sh
145 newexe scripts/sc serctl
146 newexe scripts/ser_mysql.sh ser_mysql.sh
147
148 chown -R root:ser "${D}"/etc/ser
149 chmod 750 "${D}"/etc/ser
150 chmod 640 "${D}"/etc/ser/*
151
152 # fix manpages
153 sed -i -e "s:^.B /ser-${PV}AUTHORS:.B /usr/share/doc/${PF}/AUTHORS:" \
154 -e "s:^.B /ser:.B /usr/sbin/ser:" \
155 "${D}"/usr/share/man/*/* || die
156 }
157
158 pkg_preinst() {
159 has_version "${CATEGORY}/${PN}"
160 previous_installed_version=$?
161 }
162
163 pkg_postinst() {
164 if [[ $previous_installed_version = 0 ]] ; then
165 einfo "Changing permissions on ${ROOT}etc/ser"
166
167 chown -R root:ser "${ROOT}"/etc/ser
168 chmod 750 "${ROOT}"/etc/ser
169 chmod 640 "${ROOT}"/etc/ser/*
170 fi
171 }

  ViewVC Help
Powered by ViewVC 1.1.20