Gentoo Archives: gentoo-commits

From: Austin English <wizardedit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/ser/, net-misc/ser/files/
Date: Wed, 04 May 2016 01:02:45
Message-Id: 1462322520.e319077e56afb257b19adefbf0d83e8e93396614.wizardedit@gentoo
1 commit: e319077e56afb257b19adefbf0d83e8e93396614
2 Author: Austin English <wizardedit <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 4 00:42:00 2016 +0000
4 Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
5 CommitDate: Wed May 4 00:42:00 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e319077e
7
8 net-misc/ser: use #!/sbin/openrc-run instead of #!/sbin/runscript
9
10 Gentoo-Bug: https://bugs.gentoo.org/573846
11
12 Package-Manager: portage-2.2.26
13
14 net-misc/ser/files/ser.rc6 | 2 +-
15 net-misc/ser/ser-0.9.7-r2.ebuild | 178 +++++++++++++++++++++++++++++++++++++++
16 2 files changed, 179 insertions(+), 1 deletion(-)
17
18 diff --git a/net-misc/ser/files/ser.rc6 b/net-misc/ser/files/ser.rc6
19 index dfe74b0..61c0a33 100644
20 --- a/net-misc/ser/files/ser.rc6
21 +++ b/net-misc/ser/files/ser.rc6
22 @@ -1,4 +1,4 @@
23 -#!/sbin/runscript
24 +#!/sbin/openrc-run
25 # Copyright 2002 Frauenhofer Gesellschaft FOKUS, Germany.
26 # Distributed under the terms of the GNU General Public License, v2 or later
27 # $Id$
28
29 diff --git a/net-misc/ser/ser-0.9.7-r2.ebuild b/net-misc/ser/ser-0.9.7-r2.ebuild
30 new file mode 100644
31 index 0000000..77f0459
32 --- /dev/null
33 +++ b/net-misc/ser/ser-0.9.7-r2.ebuild
34 @@ -0,0 +1,178 @@
35 +# Copyright 1999-2016 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +# $Id$
38 +
39 +EAPI=5
40 +
41 +inherit eutils flag-o-matic multilib toolchain-funcs user
42 +
43 +ETHZ_PV="1.0"
44 +LDAP_PV="1.0"
45 +LDAPS_PV="1.0"
46 +SILOMAIL_PV="1.0"
47 +MODULES_PV="0.9.0"
48 +
49 +DESCRIPTION="SIP Express Router"
50 +HOMEPAGE="http://www.iptel.org/ser"
51 +SRC_URI="
52 + http://ftp.iptel.org/pub/ser/${PV}/src/${P}_src.tar.gz
53 + mirror://gentoo/silomail-${SILOMAIL_PV}-${PN}-${MODULES_PV}.tar.gz
54 + mirror://gentoo/ethz-${ETHZ_PV}-${PN}-${MODULES_PV}.tar.gz
55 + ldap? (
56 + mirror://gentoo/ldap-${LDAP_PV}-${PN}-${MODULES_PV}.tar.gz
57 + mirror://gentoo/ldaps-${LDAPS_PV}-${PN}-${MODULES_PV}.tar.gz
58 + )"
59 +
60 +SLOT="0"
61 +LICENSE="GPL-2"
62 +KEYWORDS="~amd64 ~ppc ~sparc x86"
63 +IUSE="ipv6 mysql radius postgres xmpp ldap ssl"
64 +
65 +RDEPEND="
66 + mysql? ( virtual/mysql )
67 + radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
68 + postgres? ( dev-db/postgresql:=[server] )
69 + xmpp? ( dev-libs/expat )
70 + ldap? (
71 + net-nds/openldap
72 + ssl? ( dev-libs/openssl:0= )
73 + )"
74 +
75 +DEPEND="${RDEPEND}
76 + >=sys-devel/bison-1.35
77 + >=sys-devel/flex-2.5.4a"
78 +
79 +pkg_setup() {
80 + enewgroup ser
81 + enewuser ser -1 -1 /dev/null ser
82 +}
83 +
84 +src_prepare() {
85 + local modules extmodules MY_A MY_PATCH_A x
86 + use ipv6 || \
87 + sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
88 + sed -i -e 's/\(CFLAGS+=-mcpu=ultrasparc\) -minline-all-stringops/\1/g' \
89 + Makefile.defs || die #157109
90 +
91 + # external modules
92 + extmodules="silomail ethz"
93 +
94 + if use mysql; then
95 + modules="${modules} mysql"
96 + epatch "${FILESDIR}/${P}-mysql.diff"
97 + fi
98 +
99 + if use radius; then
100 + modules="${modules} auth_radius group_radius uri_radius avp_radius"
101 + epatch "${FILESDIR}/${P}-radius.diff"
102 + fi
103 +
104 + use xmpp && \
105 + modules="${modules} jabber"
106 +
107 + use postgres && \
108 + modules="${modules} postgres"
109 +
110 + use ldap && \
111 + extmodules="${extmodules} ldap"
112 +
113 + use ldap && use ssl && \
114 + extmodules="${extmodules} ldaps"
115 +
116 + # put list of modules into Makefile, we need the list
117 + # during compile and install phase...
118 + sed -i -e "s:^\(include_modules.*\):\1 ${modules} ${extmodules}:" \
119 + Makefile || die
120 +
121 + # fix ser.cfg
122 + sed -i -e "/force_send_socket(smaug:5080);/ d" \
123 + etc/ser.cfg || die
124 +
125 + # unpack external modules
126 + # ugly i know...
127 + for x in ${extmodules}; do
128 + MY_A=$(eval echo ${x}-\${$(echo ${x} | tr "[:lower:]" "[:upper:]")_PV}-${PN}-${MODULES_PV})
129 + MY_PATCH_A="${P}-extmod-${x}"
130 + mkdir -p "${S}"/modules/${x} || die
131 + cd "${S}"/modules/${x} || die
132 + unpack ${MY_A}.tar.gz
133 + # fix makefiles
134 + if [[ -f "${FILESDIR}"/${MY_A}.diff ]]; then
135 + epatch "${FILESDIR}"/${MY_A}.diff
136 + fi
137 +
138 + # additional patches
139 + if [[ -f "${FILESDIR}"/${MY_PATCH_A}.diff ]]; then
140 + epatch "${FILESDIR}"/${MY_PATCH_A}.diff
141 + fi
142 + done
143 +
144 + # remove sasl if openldap hasn't been built with it
145 + if use ldap && ! built_with_use net-nds/openldap sasl; then
146 + sed -i -e "s:-lsasl::g" \
147 + "${S}"/modules/ldap/Makefile || die
148 +
149 + if use ssl; then
150 + sed -i -e "s:-lsasl::g" \
151 + "${S}"/modules/ldaps/Makefile || die
152 + fi
153 + fi
154 +}
155 +
156 +src_compile() {
157 + # add -fPIC
158 + append-flags -fPIC
159 +
160 + emake all \
161 + CC="`tc-getCC`" \
162 + CFLAGS="${CFLAGS}" \
163 + cfg-prefix=/ \
164 + cfg-target=/etc/ser/
165 +}
166 +
167 +src_install () {
168 + emake install \
169 + prefix="" \
170 + bin-prefix="${D}"/usr/sbin \
171 + bin-dir="" \
172 + cfg-prefix="${D}"/etc \
173 + cfg-dir=ser/ \
174 + cfg-target=/etc/ser/ \
175 + modules-prefix="${D}"/usr/$(get_libdir)/ser \
176 + modules-dir=modules \
177 + modules-target=/usr/$(get_libdir)/ser/modules/ \
178 + man-prefix="${D}"/usr/share/man \
179 + man-dir="" \
180 + doc-prefix="${D}"/usr/share/doc \
181 + doc-dir="${P}"
182 +
183 + newinitd "${FILESDIR}"/ser.rc6 ser
184 + newconfd "${FILESDIR}"/ser.confd ser
185 + newsbin scripts/harv_ser.sh harv_ser.sh
186 + newsbin scripts/sc serctl
187 + newsbin scripts/ser_mysql.sh ser_mysql.sh
188 +
189 + chown -R root:ser "${D}"/etc/ser || die
190 + chmod 750 "${D}"/etc/ser || die
191 + chmod 640 "${D}"/etc/ser/* || die
192 +
193 + # fix manpages
194 + sed -i -e "s:^.B /ser-${PV}AUTHORS:.B /usr/share/doc/${PF}/AUTHORS:" \
195 + -e "s:^.B /ser:.B /usr/sbin/ser:" \
196 + "${D}"/usr/share/man/*/* || die
197 +}
198 +
199 +pkg_preinst() {
200 + has_version "${CATEGORY}/${PN}"
201 + previous_installed_version=$?
202 +}
203 +
204 +pkg_postinst() {
205 + if [[ $previous_installed_version = 0 ]] ; then
206 + einfo "Changing permissions on ${ROOT}etc/ser"
207 +
208 + chown -R root:ser "${ROOT}"/etc/ser
209 + chmod 750 "${ROOT}"/etc/ser
210 + chmod 640 "${ROOT}"/etc/ser/*
211 + fi
212 +}