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