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