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