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