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