Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-irc/unrealircd/
Date: Sat, 17 Nov 2018 07:43:46
Message-Id: 1542440607.6281dc11303b8c14979e3994f6cc2f2fd9e89062.kensington@gentoo
1 commit: 6281dc11303b8c14979e3994f6cc2f2fd9e89062
2 Author: Michael Palimaka <kensington <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 17 07:43:14 2018 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 17 07:43:27 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6281dc11
7
8 net-irc/unrealircd: version bump 4.2.0
9
10 Package-Manager: Portage-2.3.51, Repoman-2.3.12
11 Signed-off-by: Michael Palimaka <kensington <AT> gentoo.org>
12
13 net-irc/unrealircd/Manifest | 1 +
14 net-irc/unrealircd/unrealircd-4.2.0.ebuild | 184 +++++++++++++++++++++++++++++
15 2 files changed, 185 insertions(+)
16
17 diff --git a/net-irc/unrealircd/Manifest b/net-irc/unrealircd/Manifest
18 index 79557586c05..f796d1e7b80 100644
19 --- a/net-irc/unrealircd/Manifest
20 +++ b/net-irc/unrealircd/Manifest
21 @@ -1 +1,2 @@
22 DIST unrealircd-4.0.18.tar.gz 5317767 BLAKE2B cb71144ce0fce7f719b3081f2da9f85c997dbc372492dfa57354eb51aee122f0e42fdba9e0aca997cd118ed9c75fb6f197ca13e371931fe45709d6b64651336d SHA512 b9541ea83c24963187931938eadbba746175ec1d9449631e799df038bb062625e4b508c2d0d4e9e69a6401158cc23a855cbfbda3d28a4b971fbb249f074d26d3
23 +DIST unrealircd-4.2.0.tar.gz 5340752 BLAKE2B 12d1ada1d439c6acd692a04dd4ed7ed03ea91c897f9522c0fec853239ba9a21098bddb78c6f5159ed59f1b88cf88f0ecaa774d70aba226b3ac749c935bc18ff5 SHA512 2ee7955c3c6c9af2b74cb68cfa94f8500dddf640f0222888b230f0f46dd0a52fba2c68d795eff00c59a3025affb2becb1dd67ebac037c7f75e77a3a728239750
24
25 diff --git a/net-irc/unrealircd/unrealircd-4.2.0.ebuild b/net-irc/unrealircd/unrealircd-4.2.0.ebuild
26 new file mode 100644
27 index 00000000000..59861f9667f
28 --- /dev/null
29 +++ b/net-irc/unrealircd/unrealircd-4.2.0.ebuild
30 @@ -0,0 +1,184 @@
31 +# Copyright 1999-2018 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=6
35 +
36 +SSL_CERT_MANDATORY=1
37 +inherit eapi7-ver ssl-cert user
38 +
39 +DESCRIPTION="An advanced Internet Relay Chat daemon"
40 +HOMEPAGE="https://www.unrealircd.org/"
41 +SRC_URI="https://www.unrealircd.org/${PN}$(ver_cut 1)/${P}.tar.gz"
42 +
43 +LICENSE="GPL-2"
44 +SLOT="0"
45 +KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd ~amd64-linux"
46 +IUSE="class-nofakelag curl +extban-stacking +operoverride operoverride-verify +prefixaq
47 + showlistmodes shunnotices topicisnuhost +usermod"
48 +
49 +RDEPEND="
50 + dev-libs/openssl:0=
51 + dev-libs/libpcre2
52 + dev-libs/tre
53 + >=net-dns/c-ares-1.7:=
54 + sys-libs/zlib
55 + curl? ( net-misc/curl[adns] )
56 +"
57 +DEPEND="${RDEPEND}
58 + virtual/pkgconfig
59 +"
60 +
61 +DOCS=( doc/{Authors,Donation,RELEASE-NOTES{,.old},tao.of.irc,technical/,translations.txt} )
62 +
63 +pkg_pretend() {
64 + local v
65 + for v in ${REPLACING_VERSIONS}; do
66 + ver_test "${v}" -ge 4 && continue
67 + ewarn "The configuration file format has changed since ${v}."
68 + ewarn "Please be prepared to manually update them and visit:"
69 + ewarn "https://www.unrealircd.org/docs/Upgrading_from_3.2.x"
70 + break
71 + done
72 +}
73 +
74 +pkg_setup() {
75 + enewuser unrealircd
76 +}
77 +
78 +src_prepare() {
79 + # QA check against bundled pkgs
80 + rm -r extras || die
81 +
82 + if use class-nofakelag; then
83 + sed -i -e 's:#undef\( FAKELAG_CONFIGURABLE\):#define\1:' include/config.h || die
84 + fi
85 +
86 + # By default looks in /etc/unrealircd/ssl/curl-ca-bundle.crt. Fix
87 + # that to look for ca-certificates-provided file instead. %s is
88 + # CONFDIR. #618066
89 + sed -i -e 's:%s/ssl/curl-ca-bundle.crt:%s/../ssl/certs/ca-certificates.crt:' src/s_conf.c || die
90 +
91 + eapply_user
92 +}
93 +
94 +src_configure() {
95 + # Default value for privatelibdir adds a build path to -Wl,-rpath.
96 + econf \
97 + --with-bindir="${EPREFIX}"/usr/bin \
98 + --with-cachedir="${EPREFIX}"/var/lib/${PN} \
99 + --with-confdir="${EPREFIX}"/etc/${PN} \
100 + --with-datadir="${EPREFIX}"/var/lib/${PN} \
101 + --with-docdir="${EPREFIX}"/usr/share/doc/${PF} \
102 + --with-logdir="${EPREFIX}"/var/log/${PN} \
103 + --with-modulesdir="${EPREFIX}"/usr/"$(get_libdir)"/${PN}/modules \
104 + --without-privatelibdir \
105 + --with-pidfile="${EPREFIX}"/run/${PN}/ircd.pid \
106 + --with-tmpdir="${EPREFIX}"/var/lib/${PN}/tmp \
107 + --with-nick-history=2000 \
108 + --with-sendq=3000000 \
109 + --with-permissions=0640 \
110 + --with-fd-setsize=1024 \
111 + --with-system-cares \
112 + --with-system-pcre2 \
113 + --with-system-tre \
114 + --enable-dynamic-linking \
115 + --enable-ssl="${EPREFIX}"/usr \
116 + $(use_enable curl libcurl "${EPREFIX}"/usr) \
117 + $(use_enable prefixaq) \
118 + $(use_with showlistmodes) \
119 + $(use_with topicisnuhost) \
120 + $(use_with shunnotices) \
121 + $(use_with !operoverride no-operoverride) \
122 + $(use_with operoverride-verify) \
123 + $(use_with !usermod disableusermod) \
124 + $(use_with !extban-stacking disable-extendedban-stacking)
125 +}
126 +
127 +src_install() {
128 + keepdir /var/log/${PN}
129 + keepdir /var/lib/${PN}/tmp
130 +
131 + newbin src/ircd ${PN}
132 +
133 + (
134 + cd src/modules || die
135 + for subdir in $(find . -type d -print); do
136 + if [[ -n $(shopt -s nullglob; echo ${subdir}/*.so) ]]; then
137 + exeinto /usr/$(get_libdir)/${PN}/modules/"${subdir}"
138 + doexe "${subdir}"/*.so
139 + fi
140 + done
141 + )
142 +
143 + insinto /etc/${PN}
144 + # Purposefully omitting the examples/ and ssl/ subdirectories. ssl
145 + # is redundant with app-misc/ca-certificates and examples will all
146 + # be in docs anyway.
147 + doins -r doc/conf/{aliases,help}
148 + doins doc/conf/*.conf
149 + newins doc/conf/examples/example.conf ${PN}.conf
150 + keepdir /etc/${PN}/ssl
151 +
152 + einstalldocs
153 +
154 + newinitd "${FILESDIR}"/${PN}.initd-r2 ${PN}
155 + newconfd "${FILESDIR}"/${PN}.confd-r3 ${PN}
156 +
157 + # config should be read-only
158 + fperms -R 0640 /etc/${PN}
159 + fperms 0750 /etc/${PN}{,/aliases,/help}
160 + fperms 0750 /etc/${PN}/ssl
161 + # state is editable but not owned by unrealircd directly
162 + fperms 0770 /var/log/${PN}
163 + fperms 0770 /var/lib/${PN}{,/tmp}
164 + fowners -R root:unrealircd /{etc,var/{lib,log}}/${PN}
165 +}
166 +
167 +pkg_postinst() {
168 + # Move docert call from src_install() to install_cert in pkg_postinst for
169 + # bug #201682
170 + if [[ ! -f "${EROOT}"etc/${PN}/ssl/server.cert.key ]]; then
171 + if [[ -f "${EROOT}"etc/${PN}/server.cert.key ]]; then
172 + ewarn "The location ${PN} looks for SSL certificates has changed"
173 + ewarn "from ${EROOT}etc/${PN} to ${EROOT}etc/${PN}/ssl."
174 + ewarn "Please move your existing certificates."
175 + else
176 + (
177 + umask 0037
178 + install_cert /etc/${PN}/ssl/server.cert
179 + chown unrealircd "${EROOT}"etc/${PN}/ssl/server.cert.*
180 + ln -snf server.cert.key "${EROOT}"etc/${PN}/ssl/server.key.pem
181 + )
182 + fi
183 + fi
184 +
185 + local unrealircd_conf="${EROOT}"etc/${PN}/${PN}.conf
186 + # Fix up the default cloak keys.
187 + if grep -qe '"and another one";$' "${unrealircd_conf}" && grep -qe '"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";$' "${unrealircd_conf}"; then
188 + ebegin "Generating cloak-keys"
189 + local keys=(
190 + $(su ${PN} -s /bin/sh -c "${PN} -k 2>&1 | tail -n 3")
191 + )
192 + [[ -n ${keys[0]} || -n ${keys[1]} || -n ${keys[2]} ]]
193 + eend $?
194 +
195 + ebegin "Substituting cloak-keys into ${unrealircd_conf}"
196 + sed -i \
197 + -e '/cloak-keys/ {
198 +n
199 +s/"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";/"'"${keys[0]}"'";/
200 +n
201 +s/"and another one";/"'"${keys[1]}"'";/
202 +n
203 +s/"and another one";/"'"${keys[2]}"'";/
204 +}' \
205 + "${unrealircd_conf}"
206 + eend $?
207 + fi
208 +
209 + elog "UnrealIRCd will not run until you've set up /etc/unrealircd/unrealircd.conf"
210 + elog
211 + elog "You can also configure ${PN} start at boot with rc-update(1)."
212 + elog "It is recommended to run unrealircd as an unprivileged user."
213 + elog "The provided init.d script does this for you."
214 +}