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: Tue, 30 Apr 2019 10:03:19
Message-Id: 1556618583.42abeeae799ea8fcc411eee08140945e775f9400.kensington@gentoo
1 commit: 42abeeae799ea8fcc411eee08140945e775f9400
2 Author: Michael Palimaka <kensington <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 30 10:00:49 2019 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 30 10:03:03 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42abeeae
7
8 net-irc/unrealircd: version bump 4.2.3
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.3.ebuild | 187 +++++++++++++++++++++++++++++
15 2 files changed, 188 insertions(+)
16
17 diff --git a/net-irc/unrealircd/Manifest b/net-irc/unrealircd/Manifest
18 index ec2aab4b7c4..32b60c6687a 100644
19 --- a/net-irc/unrealircd/Manifest
20 +++ b/net-irc/unrealircd/Manifest
21 @@ -1 +1,2 @@
22 DIST unrealircd-4.2.2.tar.gz 6060272 BLAKE2B f45cae6aa85b478e7f667e379b557314fa509c17f150941f84ee80fb328b01de099235b69d3e2710afef01578f5898ba12f21245d6ce5370e7aa7ffdfa49d1f0 SHA512 961947e2286e10cd6032320d57cf3a99d4354f46ae28ad3142d11a0d423f7a0be915f8c09e8fe7b5816829752e4a03776907bb491366f418afc319fd8efb14ad
23 +DIST unrealircd-4.2.3.tar.gz 6086716 BLAKE2B 26eae482b8b5ce599a3672981c5cf32725f0cf7d9dae16cf48c73dfcabbd4b897d8308be0eb1a6b7b44c657dfb66c42115e67c29eefc791da5fc01fc53e22323 SHA512 d71550d71d24f808141d235248600476167b82de089173f0c1814638df636bf999c931827e5952f0233932b2d5412bf2e26573c62cc8a0720f91bd8723867b0a
24
25 diff --git a/net-irc/unrealircd/unrealircd-4.2.3.ebuild b/net-irc/unrealircd/unrealircd-4.2.3.ebuild
26 new file mode 100644
27 index 00000000000..4fa9c22d637
28 --- /dev/null
29 +++ b/net-irc/unrealircd/unrealircd-4.2.3.ebuild
30 @@ -0,0 +1,187 @@
31 +# Copyright 1999-2019 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 libressl +operoverride operoverride-verify
47 + +prefixaq showlistmodes shunnotices +usermod"
48 +
49 +RDEPEND="
50 + >=app-crypt/argon2-20171227-r1:=
51 + !libressl? ( dev-libs/openssl:0= )
52 + libressl? ( dev-libs/libressl:= )
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 shunnotices) \
124 + $(use_with !operoverride no-operoverride) \
125 + $(use_with operoverride-verify) \
126 + $(use_with !usermod disableusermod) \
127 + $(use_with !extban-stacking disable-extendedban-stacking)
128 +}
129 +
130 +src_install() {
131 + keepdir /var/log/${PN}
132 + keepdir /var/lib/${PN}/tmp
133 +
134 + newbin src/ircd ${PN}
135 +
136 + (
137 + cd src/modules || die
138 + for subdir in $(find . -type d -print); do
139 + if [[ -n $(shopt -s nullglob; echo ${subdir}/*.so) ]]; then
140 + exeinto /usr/$(get_libdir)/${PN}/modules/"${subdir}"
141 + doexe "${subdir}"/*.so
142 + fi
143 + done
144 + )
145 +
146 + insinto /etc/${PN}
147 + # Purposefully omitting the examples/ and ssl/ subdirectories. ssl
148 + # is redundant with app-misc/ca-certificates and examples will all
149 + # be in docs anyway.
150 + doins -r doc/conf/{aliases,help}
151 + doins doc/conf/*.conf
152 + newins doc/conf/examples/example.conf ${PN}.conf
153 + keepdir /etc/${PN}/ssl
154 +
155 + einstalldocs
156 +
157 + newinitd "${FILESDIR}"/${PN}.initd-r2 ${PN}
158 + newconfd "${FILESDIR}"/${PN}.confd-r3 ${PN}
159 +
160 + # config should be read-only
161 + fperms -R 0640 /etc/${PN}
162 + fperms 0750 /etc/${PN}{,/aliases,/help}
163 + fperms 0750 /etc/${PN}/ssl
164 + # state is editable but not owned by unrealircd directly
165 + fperms 0770 /var/log/${PN}
166 + fperms 0770 /var/lib/${PN}{,/tmp}
167 + fowners -R root:unrealircd /{etc,var/{lib,log}}/${PN}
168 +}
169 +
170 +pkg_postinst() {
171 + # Move docert call from src_install() to install_cert in pkg_postinst for
172 + # bug #201682
173 + if [[ ! -f "${EROOT}"etc/${PN}/ssl/server.cert.key ]]; then
174 + if [[ -f "${EROOT}"etc/${PN}/server.cert.key ]]; then
175 + ewarn "The location ${PN} looks for SSL certificates has changed"
176 + ewarn "from ${EROOT}etc/${PN} to ${EROOT}etc/${PN}/ssl."
177 + ewarn "Please move your existing certificates."
178 + else
179 + (
180 + umask 0037
181 + install_cert /etc/${PN}/ssl/server.cert
182 + chown unrealircd "${EROOT}"etc/${PN}/ssl/server.cert.*
183 + ln -snf server.cert.key "${EROOT}"etc/${PN}/ssl/server.key.pem
184 + )
185 + fi
186 + fi
187 +
188 + local unrealircd_conf="${EROOT}"etc/${PN}/${PN}.conf
189 + # Fix up the default cloak keys.
190 + if grep -qe '"and another one";$' "${unrealircd_conf}" && grep -qe '"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";$' "${unrealircd_conf}"; then
191 + ebegin "Generating cloak-keys"
192 + local keys=(
193 + $(su ${PN} -s /bin/sh -c "${PN} -k 2>&1 | tail -n 3")
194 + )
195 + [[ -n ${keys[0]} || -n ${keys[1]} || -n ${keys[2]} ]]
196 + eend $?
197 +
198 + ebegin "Substituting cloak-keys into ${unrealircd_conf}"
199 + sed -i \
200 + -e '/cloak-keys/ {
201 +n
202 +s/"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";/"'"${keys[0]}"'";/
203 +n
204 +s/"and another one";/"'"${keys[1]}"'";/
205 +n
206 +s/"and another one";/"'"${keys[2]}"'";/
207 +}' \
208 + "${unrealircd_conf}"
209 + eend $?
210 + fi
211 +
212 + elog "UnrealIRCd will not run until you've set up /etc/unrealircd/unrealircd.conf"
213 + elog
214 + elog "You can also configure ${PN} start at boot with rc-update(1)."
215 + elog "It is recommended to run unrealircd as an unprivileged user."
216 + elog "The provided init.d script does this for you."
217 +}