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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Tue Nov 4 05:20:48 2014 UTC (5 years, 1 month ago) by patrick
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
Improve ebuild for repoman happy

(Portage version: 2.2.14/cvs/Linux x86_64, RepoMan options: --force, unsigned Manifest commit)

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

  ViewVC Help
Powered by ViewVC 1.1.20