Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-mobilephone/kannel/, app-mobilephone/kannel/files/
Date: Thu, 25 Aug 2016 17:02:41
Message-Id: 1472144517.f9f601a8838ce9a1eea2e2e90532fd7618fd9b13.pacho@gentoo
1 commit: f9f601a8838ce9a1eea2e2e90532fd7618fd9b13
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 25 17:01:57 2016 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 25 17:01:57 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9f601a8
7
8 app-mobilephone/kannel: Fix starting with supplementary group ID's (#512500 by Ján Regeš).
9
10 Package-Manager: portage-2.3.0
11
12 .../kannel/files/kannel-1.5.0-initgroups.patch | 11 ++
13 app-mobilephone/kannel/kannel-1.5.0-r3.ebuild | 129 +++++++++++++++++++++
14 2 files changed, 140 insertions(+)
15
16 diff --git a/app-mobilephone/kannel/files/kannel-1.5.0-initgroups.patch b/app-mobilephone/kannel/files/kannel-1.5.0-initgroups.patch
17 new file mode 100644
18 index 00000000..665ca6d
19 --- /dev/null
20 +++ b/app-mobilephone/kannel/files/kannel-1.5.0-initgroups.patch
21 @@ -0,0 +1,11 @@
22 +--- a/gwlib/utils.c.old 2016-08-25 18:52:59.944949612 +0200
23 ++++ b/gwlib/utils.c 2016-08-25 18:53:30.352659566 +0200
24 +@@ -387,7 +387,7 @@
25 + }
26 +
27 + #ifndef __INTERIX
28 +- if (initgroups(user, -1) == -1) {
29 ++ if (initgroups(user, pass->pw_gid) == -1) {
30 + error(errno, "Could not set supplementary group ID's.");
31 + }
32 + #endif
33
34 diff --git a/app-mobilephone/kannel/kannel-1.5.0-r3.ebuild b/app-mobilephone/kannel/kannel-1.5.0-r3.ebuild
35 new file mode 100644
36 index 00000000..c3f641e
37 --- /dev/null
38 +++ b/app-mobilephone/kannel/kannel-1.5.0-r3.ebuild
39 @@ -0,0 +1,129 @@
40 +# Copyright 1999-2016 Gentoo Foundation
41 +# Distributed under the terms of the GNU General Public License v2
42 +# $Id$
43 +
44 +EAPI=6
45 +WANT_AUTOMAKE=none
46 +
47 +inherit autotools flag-o-matic ssl-cert user
48 +
49 +DESCRIPTION="Powerful SMS and WAP gateway"
50 +HOMEPAGE="http://www.kannel.org/"
51 +SRC_URI="http://www.kannel.org/download/${PV}/gateway-${PV}.tar.gz"
52 +
53 +LICENSE="Apache-1.1"
54 +SLOT="0"
55 +KEYWORDS="~amd64 ~x86"
56 +IUSE="debug doc mysql libressl pam pcre postgres sqlite ssl"
57 +
58 +RESTRICT="test" # some tests fail with "address already in use"
59 +
60 +RDEPEND="
61 + sys-libs/e2fsprogs-libs
62 + dev-libs/libxml2:2
63 + dev-lang/perl
64 + sys-libs/zlib
65 + ssl? (
66 + libressl? ( dev-libs/libressl:0= )
67 + !libressl? ( dev-libs/openssl:0= ) )
68 + mysql? ( virtual/mysql )
69 + sqlite? ( dev-db/sqlite:3 )
70 + postgres? ( dev-db/postgresql:=[server] )
71 + pcre? ( dev-libs/libpcre:3 )
72 + pam? ( virtual/pam )
73 +"
74 +DEPEND="${RDEPEND}
75 + >=sys-devel/bison-2.2
76 + doc? ( media-gfx/transfig
77 + app-text/jadetex
78 + app-text/docbook-dsssl-stylesheets
79 + app-text/docbook-sgml-dtd:3.1 )
80 +"
81 +
82 +S="${WORKDIR}/gateway-${PV}"
83 +
84 +PATCHES=(
85 + "${FILESDIR}/${PN}-1.5.0-custom-wap-ports.patch"
86 + "${FILESDIR}/${PN}-1.4.3-autotools.patch"
87 + "${FILESDIR}/${PN}-1.4.3-external-libuuid.patch"
88 + "${FILESDIR}/${PN}-1.5.0-initgroups.patch"
89 +)
90 +
91 +pkg_setup() {
92 + enewgroup kannel
93 + enewuser kannel -1 -1 /var/log/kannel kannel
94 +}
95 +
96 +src_prepare() {
97 + default
98 +
99 + #by default, use current directory for logging
100 + sed -i -e 's:/tmp/::' doc/examples/kannel.conf
101 +
102 + mv configure.in configure.ac || die
103 + eautoconf
104 +}
105 +
106 +src_configure() {
107 + append-flags -fno-strict-aliasing # some code breaks strict aliasing
108 + econf \
109 + --enable-localtime \
110 + --disable-start-stop-daemon \
111 + --without-sqlite2 \
112 + $(use_enable pam) \
113 + $(use_enable debug debug) \
114 + $(use_enable pcre) \
115 + $(use_enable doc docs) \
116 + $(use_enable ssl) \
117 + $(use_with mysql) \
118 + $(use_with sqlite sqlite3) \
119 + $(use_with postgres pgsql)
120 +}
121 +
122 +# phase disabled by RESTRICT
123 +# src_test() {
124 +# emake check || die "emake check failed"
125 +# }
126 +
127 +src_install() {
128 + default
129 +
130 + if use doc; then
131 + emake -j1 DESTDIR="${D}" install-docs || die "emake install-docs failed"
132 + fi
133 +
134 + diropts -g kannel -m0750
135 + dodir /etc/kannel
136 + insinto /etc/kannel
137 + newins doc/examples/kannel.conf kannel.conf.sample
138 +
139 + local f
140 + for f in bearerbox smsbox wapbox; do
141 + newinitd "${FILESDIR}/kannel-$f.initd" kannel-$f
142 + done
143 +
144 + diropts -g kannel -m0770
145 + keepdir /var/log/kannel
146 +}
147 +
148 +pkg_postinst() {
149 + if use ssl; then
150 + elog "SSL certificate can be created by running"
151 + elog " emerge --config =${CATEGORY}/${PF}"
152 + fi
153 +}
154 +
155 +pkg_config() {
156 + if use ssl; then
157 + if install_cert /etc/ssl/kannel; then
158 + chown kannel "${ROOT}"etc/ssl/kannel.{pem,key}
159 + einfo "For using this certificate, you have to add following line to your kannel.conf:"
160 + einfo ' ssl-client-certkey-file = "/etc/ssl/kannel.pem"'
161 + einfo ' ssl-server-cert-file = "/etc/ssl/kannel.crt"'
162 + einfo ' ssl-server-key-file = "/etc/ssl/kannel.key"'
163 + fi
164 + else
165 + eerror "This phase exists only for creating kannel SSL certificate"
166 + eerror "and ssl USE flag is disabled for this package!"
167 + fi
168 +}