Gentoo Archives: gentoo-commits

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