summaryrefslogtreecommitdiff
path: root/net-irc/unrealircd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
commitd934827bf44b7cfcf6711964418148fa60877668 (patch)
tree0625f358789b5e015e49db139cc1dbc9be00428f /net-irc/unrealircd
parent2e34d110f164bf74d55fced27fe0000201b3eec5 (diff)
gentoo resync : 25.11.2020
Diffstat (limited to 'net-irc/unrealircd')
-rw-r--r--net-irc/unrealircd/Manifest4
-rw-r--r--net-irc/unrealircd/unrealircd-5.0.7-r1.ebuild173
-rw-r--r--net-irc/unrealircd/unrealircd-5.0.7-r2.ebuild172
-rw-r--r--net-irc/unrealircd/unrealircd-5.0.7.ebuild173
4 files changed, 522 insertions, 0 deletions
diff --git a/net-irc/unrealircd/Manifest b/net-irc/unrealircd/Manifest
index 99d41c29d00b..19421e96c639 100644
--- a/net-irc/unrealircd/Manifest
+++ b/net-irc/unrealircd/Manifest
@@ -3,6 +3,10 @@ AUX unrealircd.initd-r2 1162 BLAKE2B f4b073662d6428122b91e89350bca346daa71af0070
AUX unrealircd.service 177 BLAKE2B 9a58ce4e7785a66beac53afa2ecd276dd6f8e9927de8dfc3e9eab968008ad681a8b9f353bff4951bba8023d5c04affda6b58fde5db8232d0f1f9ae3e470424f0 SHA512 99163776104f2f27a585332004221fac16a9fbf9c8930b0603b5f33aca4c5ac13bdded4d5917143796b3893a19d2f709b0c4d4d635d85bd681f643b3b59131f5
DIST unrealircd-4.2.4.1.tar.gz 6090725 BLAKE2B 817a7c2a13a495944676d08ed90b36f6795fe43ee171efc6661980e6da9a8cc8d98c4fb0eb8221ac6af85ab1a9b5578a2e992d7b41696434430e58918bc30145 SHA512 752573c4af1f92a10739bb2b0cdaade1948207b46d28ae5177e1dfd6b0663044bc22dce5ffe8549882cd70325e3ef7e3296182fffbb84e08d59dbbdd6551a686
DIST unrealircd-5.0.6.tar.gz 4975195 BLAKE2B 3ba459e0ec932e9f240825ba9f1fa40e300fe7958f999de86d5653f2e6e4940be8b8da9c885c97bd738abefef601d61da6c4e6c7199c7052d29a74fcf5048828 SHA512 7532e9ab2e039f21796ae813881aec9d34b502ab64efc4323c938232c8901ce882dbcce497ad93df270e4b5fa2e9633c0971f2a6b3213ad458756aea92aa1612
+DIST unrealircd-5.0.7.tar.gz 4995220 BLAKE2B a2996f62b3fe943f9af2cd570866101a501d24f7966378d8e651cf84b9b9d0981fad441b785c6293f4a0668a914cdf191dec52cc6b1e86aac2a51640ca32dbfe SHA512 0b851af26da2ea5d3a04d2ef324d7bd3d3fc820f24d7dfd7e975d6bf1f3954884eb98dc348d291a118d98a214922d3ca1132800381e6f025264856aa06498779
EBUILD unrealircd-4.2.4.1.ebuild 5452 BLAKE2B 356dfc371b2c8757cd710ba93401f4a34e069b545cc77573b9942ac1672e0a4367be3fb1a47fdf9ef7cdee3a1ba40bc57d0ae0366c16262665a03cdc63fae242 SHA512 b875c731c0712ab570b1d18fe0ca30abe5ed235d24a3beafa169f98d94cc6f52130d935d21ba732bbf74b368adfd9754283e61688339b1a2599523fd3e3d3d98
EBUILD unrealircd-5.0.6.ebuild 5087 BLAKE2B 82341a54c9c04c7a1e91a53d14979520ce02b0b3824fe7e3bc124a4bff054a43e1124c5b9205c776ff7961a10ab88461c4fc11e28008a19dc32996bc92edc7e3 SHA512 c97b8b352b8f927ab9ada81f75903a0bb47f3882da8630a3bfd55cfc4a66b4e518418bbffef2b011535a47795d2d9024cf6619d446be55bcb146c1ea7ca66625
+EBUILD unrealircd-5.0.7-r1.ebuild 5174 BLAKE2B 94854576a6ae38be7c2568babd85dc37bd1dab4f5934aab626c3969da56c4f22434b305297d9ab774b19b05835a1cd59e322472ee542c9371d3a0f57bafb550a SHA512 e8808c6bf41df9161fb33877cc759c4b25fd234d549e3d6d09fb6f04933966f4101ca39921b7ab721ff1e2ff6643f46abdd47ffeed5229506fa70a14fa785635
+EBUILD unrealircd-5.0.7-r2.ebuild 5145 BLAKE2B dc8ae03291fc7c0074ea0c145144a202e855f0c59f0eb75a2ab6657c19b7e9c06cad6aed431719588510451603486e51d4a12943482b07ec015466c5d568e4fb SHA512 7bc2414949d06f35cc14dec06d18b46747c68851319be26e2d33e24811f2828cd81c58f69410c67d1975b2a7edd49e94df653c85ca3b14b04d78faa6dfcd99ec
+EBUILD unrealircd-5.0.7.ebuild 5171 BLAKE2B 2dfd5fbbcee70f11ebd9bd36b9a74b068d06512c042f7abae6d22302c7f16daf440896000b315c5183834dd6da08f6e50a9a1fe424ea8dbede5990c246a27279 SHA512 e614737149ea7a6ad3128ced1716d841c0f0996a6eb7ed9d644afdb7cd0b837344bdf89d1f9f22eb152f34815844721cd5be74da1dd48478599455e8de99a696
MISC metadata.xml 1048 BLAKE2B 23fc4e5fd19084a8cb4157d14318d00952b61914d1d26137ee93ee866b394ac8bc0471110903806bb94f60141ef5a12c436816ce1cac55ab2e84db30ebdb1a36 SHA512 6f87be3568418355d74b9f8839f5640fe6299e8ee2b1de2ea0f83ac1a93ec9ab150b437e327d8543a815761389773dd8e8149cba023395893c9313d8b3d46102
diff --git a/net-irc/unrealircd/unrealircd-5.0.7-r1.ebuild b/net-irc/unrealircd/unrealircd-5.0.7-r1.ebuild
new file mode 100644
index 000000000000..4807b6d11438
--- /dev/null
+++ b/net-irc/unrealircd/unrealircd-5.0.7-r1.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+SSL_CERT_MANDATORY=1
+inherit ssl-cert systemd
+
+DESCRIPTION="An advanced Internet Relay Chat daemon"
+HOMEPAGE="https://www.unrealircd.org/"
+SRC_URI="https://www.unrealircd.org/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux"
+IUSE="class-nofakelag curl libressl +operoverride operoverride-verify +prefixaq showlistmodes"
+
+RDEPEND="
+ acct-group/unrealircd
+ acct-user/unrealircd
+ >=app-crypt/argon2-20171227-r1:=
+ dev-libs/libpcre2
+ >=net-dns/c-ares-1.7:=
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:= )
+ curl? ( net-misc/curl[adns] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+DOCS=( doc/{Authors,Donation,RELEASE-NOTES.md,tao.of.irc,technical/,translations.txt} )
+
+src_prepare() {
+ # QA check against bundled pkgs
+ rm -r extras || die
+
+ # building third-party modules (which we don't do) cause a sandbox violation
+ # bug 704444
+ echo "" > src/buildmod || die
+
+ sed -e 's/$(MODULEFLAGS)/$(LDFLAGS) &/' -i src/modules/{,*/}Makefile.in || die
+
+ if use class-nofakelag; then
+ sed -i -e 's:^//#undef\( FAKELAG_CONFIGURABLE\):#define\1:' include/config.h || die
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ # Default value for privatelibdir adds a build path to -Wl,-rpath.
+ econf \
+ --with-bindir="${EPREFIX}"/usr/bin \
+ --with-cachedir="${EPREFIX}"/var/lib/${PN} \
+ --with-confdir="${EPREFIX}"/etc/${PN} \
+ --with-datadir="${EPREFIX}"/var/lib/${PN} \
+ --with-docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ --with-logdir="${EPREFIX}"/var/log/${PN} \
+ --with-modulesdir="${EPREFIX}"/usr/"$(get_libdir)"/${PN}/modules \
+ --without-privatelibdir \
+ --with-pidfile="${EPREFIX}"/run/${PN}/ircd.pid \
+ --with-tmpdir="${EPREFIX}"/var/lib/${PN}/tmp \
+ --with-maxconnections=1024 \
+ --with-nick-history=2000 \
+ --with-permissions=0640 \
+ --with-system-argon2 \
+ --with-system-cares \
+ --with-system-pcre2 \
+ --enable-dynamic-linking \
+ --enable-ssl="${EPREFIX}"/usr \
+ $(use_enable curl libcurl "${EPREFIX}"/usr) \
+ $(use_enable prefixaq) \
+ $(use_with showlistmodes) \
+ $(use_with !operoverride no-operoverride) \
+ $(use_with operoverride-verify)
+}
+
+src_install() {
+ keepdir /var/log/${PN}
+ keepdir /var/lib/${PN}/tmp
+
+ newbin src/ircd ${PN}
+
+ (
+ cd src/modules || die
+ for subdir in $(find . -type d -print); do
+ if [[ -n $(shopt -s nullglob; echo ${subdir}/*.so) ]]; then
+ exeinto /usr/$(get_libdir)/${PN}/modules/"${subdir}"
+ doexe "${subdir}"/*.so
+ fi
+ done
+ )
+
+ insinto /etc/${PN}
+ # Purposefully omitting the examples/ and ssl/ subdirectories. ssl
+ # is redundant with app-misc/ca-certificates and examples will all
+ # be in docs anyway.
+ doins -r doc/conf/{aliases,help}
+ doins doc/conf/*.conf
+ newins doc/conf/examples/example.conf ${PN}.conf
+ keepdir /etc/${PN}/tls
+
+ einstalldocs
+
+ newinitd "${FILESDIR}"/${PN}.initd-r2 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd-r3 ${PN}
+
+ # config should be read-only
+ fperms -R 0640 /etc/${PN}
+ fperms 0750 /etc/${PN}{,/aliases,/help}
+ fperms 0750 /etc/${PN}/tls
+ # state is editable but not owned by unrealircd directly
+ fperms 0770 /var/log/${PN}
+ fperms 0770 /var/lib/${PN}{,/tmp}
+ fowners -R root:unrealircd /{etc,var/{lib,log}}/${PN}
+
+ # By default looks in /etc/unrealircd/ssl/curl-ca-bundle.crt. Fix
+ # that to look for ca-certificates-provided file instead. %s is
+ # CONFDIR. #618066
+ dosym ../../ssl/certs/ca-certificates.crt /etc/${PN}/tls/curl-ca-bundle.crt
+
+ insinto $(systemd_get_systemunitdir)
+ doins "${FILESDIR}"/${PN}.service
+}
+
+pkg_postinst() {
+ # Move docert call from src_install() to install_cert in pkg_postinst for
+ # bug #201682
+ if [[ ! -f "${EROOT}"/etc/${PN}/tls/server.cert.key ]]; then
+ if [[ -f "${EROOT}"/etc/${PN}/ssl/server.cert.key ]]; then
+ ewarn "The location ${PN} looks for SSL certificates has changed"
+ ewarn "from ${EROOT}/etc/${PN}/ssl to ${EROOT}/etc/${PN}/tls."
+ ewarn "Please move your existing certificates."
+ else
+ (
+ umask 0037
+ install_cert /etc/${PN}/tls/server.cert
+ chown unrealircd "${EROOT}"/etc/${PN}/tls/server.cert.*
+ ln -snf server.cert.key "${EROOT}"/etc/${PN}/tls/server.key.pem
+ )
+ fi
+ fi
+
+ local unrealircd_conf="${EROOT}"/etc/${PN}/${PN}.conf
+ # Fix up the default cloak keys.
+ if grep -qe '"and another one";$' "${unrealircd_conf}" && grep -qe '"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";$' "${unrealircd_conf}"; then
+ ebegin "Generating cloak-keys"
+ local keys=(
+ $(su ${PN} -s /bin/sh -c "${PN} -k 2>&1 | tail -n 3")
+ )
+ [[ -n ${keys[0]} || -n ${keys[1]} || -n ${keys[2]} ]]
+ eend $?
+
+ ebegin "Substituting cloak-keys into ${unrealircd_conf}"
+ sed -i \
+ -e '/cloak-keys/ {
+n
+s/"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";/"'"${keys[0]}"'";/
+n
+s/"and another one";/"'"${keys[1]}"'";/
+n
+s/"and another one";/"'"${keys[2]}"'";/
+}' \
+ "${unrealircd_conf}"
+ eend $?
+ fi
+
+ elog "UnrealIRCd will not run until you've set up /etc/unrealircd/unrealircd.conf"
+ elog
+ elog "You can also configure ${PN} start at boot with rc-update(1)."
+ elog "It is recommended to run unrealircd as an unprivileged user."
+ elog "The provided init.d script does this for you."
+}
diff --git a/net-irc/unrealircd/unrealircd-5.0.7-r2.ebuild b/net-irc/unrealircd/unrealircd-5.0.7-r2.ebuild
new file mode 100644
index 000000000000..df06523b4325
--- /dev/null
+++ b/net-irc/unrealircd/unrealircd-5.0.7-r2.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+SSL_CERT_MANDATORY=1
+inherit ssl-cert systemd
+
+DESCRIPTION="An advanced Internet Relay Chat daemon"
+HOMEPAGE="https://www.unrealircd.org/"
+SRC_URI="https://www.unrealircd.org/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux"
+IUSE="class-nofakelag curl libressl +operoverride operoverride-verify +prefixaq showlistmodes"
+
+RDEPEND="
+ acct-group/unrealircd
+ acct-user/unrealircd
+ >=app-crypt/argon2-20171227-r1:=
+ dev-libs/libpcre2
+ >=net-dns/c-ares-1.7:=
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:= )
+ curl? ( net-misc/curl[adns] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+DOCS=( doc/{Authors,Donation,RELEASE-NOTES.md,tao.of.irc,technical/,translations.txt} )
+
+src_prepare() {
+ # QA check against bundled pkgs
+ rm -r extras || die
+
+ # building third-party modules (which we don't do) cause a sandbox violation
+ # bug 704444
+ echo "" > src/buildmod || die
+
+ sed -e 's/$(MODULEFLAGS)/$(LDFLAGS) &/' -i src/modules/{,*/}Makefile.in || die
+
+ if use class-nofakelag; then
+ sed -i -e 's:^//#undef\( FAKELAG_CONFIGURABLE\):#define\1:' include/config.h || die
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ # Default value for privatelibdir adds a build path to -Wl,-rpath.
+ econf \
+ --with-bindir="${EPREFIX}"/usr/bin \
+ --with-cachedir="${EPREFIX}"/var/lib/${PN} \
+ --with-confdir="${EPREFIX}"/etc/${PN} \
+ --with-datadir="${EPREFIX}"/var/lib/${PN} \
+ --with-docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ --with-logdir="${EPREFIX}"/var/log/${PN} \
+ --with-modulesdir="${EPREFIX}"/usr/"$(get_libdir)"/${PN}/modules \
+ --without-privatelibdir \
+ --with-pidfile="${EPREFIX}"/run/${PN}/ircd.pid \
+ --with-tmpdir="${EPREFIX}"/var/lib/${PN}/tmp \
+ --with-maxconnections=1024 \
+ --with-nick-history=2000 \
+ --with-permissions=0640 \
+ --with-system-argon2 \
+ --with-system-cares \
+ --with-system-pcre2 \
+ --enable-dynamic-linking \
+ --enable-ssl="${EPREFIX}"/usr \
+ $(use_enable curl libcurl "${EPREFIX}"/usr) \
+ $(use_enable prefixaq) \
+ $(use_with showlistmodes) \
+ $(use_with !operoverride no-operoverride) \
+ $(use_with operoverride-verify)
+}
+
+src_install() {
+ keepdir /var/log/${PN}
+ keepdir /var/lib/${PN}/tmp
+
+ newbin src/ircd ${PN}
+
+ (
+ cd src/modules || die
+ for subdir in $(find . -type d -print); do
+ if [[ -n $(shopt -s nullglob; echo ${subdir}/*.so) ]]; then
+ exeinto /usr/$(get_libdir)/${PN}/modules/"${subdir}"
+ doexe "${subdir}"/*.so
+ fi
+ done
+ )
+
+ insinto /etc/${PN}
+ # Purposefully omitting the examples/ and ssl/ subdirectories. ssl
+ # is redundant with app-misc/ca-certificates and examples will all
+ # be in docs anyway.
+ doins -r doc/conf/{aliases,help}
+ doins doc/conf/*.conf
+ newins doc/conf/examples/example.conf ${PN}.conf
+ keepdir /etc/${PN}/tls
+
+ einstalldocs
+
+ newinitd "${FILESDIR}"/${PN}.initd-r2 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd-r3 ${PN}
+
+ # config should be read-only
+ fperms -R 0640 /etc/${PN}
+ fperms 0750 /etc/${PN}{,/aliases,/help}
+ fperms 0750 /etc/${PN}/tls
+ # state is editable but not owned by unrealircd directly
+ fperms 0770 /var/log/${PN}
+ fperms 0770 /var/lib/${PN}{,/tmp}
+ fowners -R root:unrealircd /{etc,var/{lib,log}}/${PN}
+
+ # By default looks in /etc/unrealircd/ssl/curl-ca-bundle.crt. Fix
+ # that to look for ca-certificates-provided file instead. %s is
+ # CONFDIR. #618066
+ dosym ../../ssl/certs/ca-certificates.crt /etc/${PN}/tls/curl-ca-bundle.crt
+
+ systemd_dounit "${FILESDIR}"/${PN}.service
+}
+
+pkg_postinst() {
+ # Move docert call from src_install() to install_cert in pkg_postinst for
+ # bug #201682
+ if [[ ! -f "${EROOT}"/etc/${PN}/tls/server.cert.key ]]; then
+ if [[ -f "${EROOT}"/etc/${PN}/ssl/server.cert.key ]]; then
+ ewarn "The location ${PN} looks for SSL certificates has changed"
+ ewarn "from ${EROOT}/etc/${PN}/ssl to ${EROOT}/etc/${PN}/tls."
+ ewarn "Please move your existing certificates."
+ else
+ (
+ umask 0037
+ install_cert /etc/${PN}/tls/server.cert
+ chown unrealircd "${EROOT}"/etc/${PN}/tls/server.cert.*
+ ln -snf server.cert.key "${EROOT}"/etc/${PN}/tls/server.key.pem
+ )
+ fi
+ fi
+
+ local unrealircd_conf="${EROOT}"/etc/${PN}/${PN}.conf
+ # Fix up the default cloak keys.
+ if grep -qe '"and another one";$' "${unrealircd_conf}" && grep -qe '"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";$' "${unrealircd_conf}"; then
+ ebegin "Generating cloak-keys"
+ local keys=(
+ $(su ${PN} -s /bin/sh -c "${PN} -k 2>&1 | tail -n 3")
+ )
+ [[ -n ${keys[0]} || -n ${keys[1]} || -n ${keys[2]} ]]
+ eend $?
+
+ ebegin "Substituting cloak-keys into ${unrealircd_conf}"
+ sed -i \
+ -e '/cloak-keys/ {
+n
+s/"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";/"'"${keys[0]}"'";/
+n
+s/"and another one";/"'"${keys[1]}"'";/
+n
+s/"and another one";/"'"${keys[2]}"'";/
+}' \
+ "${unrealircd_conf}"
+ eend $?
+ fi
+
+ elog "UnrealIRCd will not run until you've set up /etc/unrealircd/unrealircd.conf"
+ elog
+ elog "You can also configure ${PN} start at boot with rc-update(1)."
+ elog "It is recommended to run unrealircd as an unprivileged user."
+ elog "The provided init.d script does this for you."
+}
diff --git a/net-irc/unrealircd/unrealircd-5.0.7.ebuild b/net-irc/unrealircd/unrealircd-5.0.7.ebuild
new file mode 100644
index 000000000000..438a6541a211
--- /dev/null
+++ b/net-irc/unrealircd/unrealircd-5.0.7.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+SSL_CERT_MANDATORY=1
+inherit ssl-cert systemd
+
+DESCRIPTION="An advanced Internet Relay Chat daemon"
+HOMEPAGE="https://www.unrealircd.org/"
+SRC_URI="https://www.unrealircd.org/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux"
+IUSE="class-nofakelag curl libressl +operoverride operoverride-verify +prefixaq showlistmodes"
+
+RDEPEND="
+ acct-group/unrealircd
+ acct-user/unrealircd
+ >=app-crypt/argon2-20171227-r1:=
+ dev-libs/libpcre2
+ >=net-dns/c-ares-1.7:=
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:= )
+ curl? ( net-misc/curl[adns] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+DOCS=( doc/{Authors,Donation,RELEASE-NOTES.md,tao.of.irc,technical/,translations.txt} )
+
+src_prepare() {
+ # QA check against bundled pkgs
+ rm -r extras || die
+
+ # building third-party modules (which we don't do) cause a sandbox violation
+ # bug 704444
+ echo "" > src/buildmod || die
+
+ sed -e 's/$(MODULEFLAGS)/$(LDFLAGS) &/' -i src/modules/{,*/}Makefile.in || die
+
+ if use class-nofakelag; then
+ sed -i -e 's:#undef\( FAKELAG_CONFIGURABLE\):#define\1:' include/config.h || die
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ # Default value for privatelibdir adds a build path to -Wl,-rpath.
+ econf \
+ --with-bindir="${EPREFIX}"/usr/bin \
+ --with-cachedir="${EPREFIX}"/var/lib/${PN} \
+ --with-confdir="${EPREFIX}"/etc/${PN} \
+ --with-datadir="${EPREFIX}"/var/lib/${PN} \
+ --with-docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ --with-logdir="${EPREFIX}"/var/log/${PN} \
+ --with-modulesdir="${EPREFIX}"/usr/"$(get_libdir)"/${PN}/modules \
+ --without-privatelibdir \
+ --with-pidfile="${EPREFIX}"/run/${PN}/ircd.pid \
+ --with-tmpdir="${EPREFIX}"/var/lib/${PN}/tmp \
+ --with-maxconnections=1024 \
+ --with-nick-history=2000 \
+ --with-permissions=0640 \
+ --with-system-argon2 \
+ --with-system-cares \
+ --with-system-pcre2 \
+ --enable-dynamic-linking \
+ --enable-ssl="${EPREFIX}"/usr \
+ $(use_enable curl libcurl "${EPREFIX}"/usr) \
+ $(use_enable prefixaq) \
+ $(use_with showlistmodes) \
+ $(use_with !operoverride no-operoverride) \
+ $(use_with operoverride-verify)
+}
+
+src_install() {
+ keepdir /var/log/${PN}
+ keepdir /var/lib/${PN}/tmp
+
+ newbin src/ircd ${PN}
+
+ (
+ cd src/modules || die
+ for subdir in $(find . -type d -print); do
+ if [[ -n $(shopt -s nullglob; echo ${subdir}/*.so) ]]; then
+ exeinto /usr/$(get_libdir)/${PN}/modules/"${subdir}"
+ doexe "${subdir}"/*.so
+ fi
+ done
+ )
+
+ insinto /etc/${PN}
+ # Purposefully omitting the examples/ and ssl/ subdirectories. ssl
+ # is redundant with app-misc/ca-certificates and examples will all
+ # be in docs anyway.
+ doins -r doc/conf/{aliases,help}
+ doins doc/conf/*.conf
+ newins doc/conf/examples/example.conf ${PN}.conf
+ keepdir /etc/${PN}/tls
+
+ einstalldocs
+
+ newinitd "${FILESDIR}"/${PN}.initd-r2 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd-r3 ${PN}
+
+ # config should be read-only
+ fperms -R 0640 /etc/${PN}
+ fperms 0750 /etc/${PN}{,/aliases,/help}
+ fperms 0750 /etc/${PN}/tls
+ # state is editable but not owned by unrealircd directly
+ fperms 0770 /var/log/${PN}
+ fperms 0770 /var/lib/${PN}{,/tmp}
+ fowners -R root:unrealircd /{etc,var/{lib,log}}/${PN}
+
+ # By default looks in /etc/unrealircd/ssl/curl-ca-bundle.crt. Fix
+ # that to look for ca-certificates-provided file instead. %s is
+ # CONFDIR. #618066
+ dosym ../../ssl/certs/ca-certificates.crt /etc/${PN}/tls/curl-ca-bundle.crt
+
+ insinto $(systemd_get_systemunitdir)
+ doins "${FILESDIR}"/${PN}.service
+}
+
+pkg_postinst() {
+ # Move docert call from src_install() to install_cert in pkg_postinst for
+ # bug #201682
+ if [[ ! -f "${EROOT}"/etc/${PN}/tls/server.cert.key ]]; then
+ if [[ -f "${EROOT}"/etc/${PN}/ssl/server.cert.key ]]; then
+ ewarn "The location ${PN} looks for SSL certificates has changed"
+ ewarn "from ${EROOT}/etc/${PN}/ssl to ${EROOT}/etc/${PN}/tls."
+ ewarn "Please move your existing certificates."
+ else
+ (
+ umask 0037
+ install_cert /etc/${PN}/tls/server.cert
+ chown unrealircd "${EROOT}"/etc/${PN}/tls/server.cert.*
+ ln -snf server.cert.key "${EROOT}"/etc/${PN}/tls/server.key.pem
+ )
+ fi
+ fi
+
+ local unrealircd_conf="${EROOT}"/etc/${PN}/${PN}.conf
+ # Fix up the default cloak keys.
+ if grep -qe '"and another one";$' "${unrealircd_conf}" && grep -qe '"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";$' "${unrealircd_conf}"; then
+ ebegin "Generating cloak-keys"
+ local keys=(
+ $(su ${PN} -s /bin/sh -c "${PN} -k 2>&1 | tail -n 3")
+ )
+ [[ -n ${keys[0]} || -n ${keys[1]} || -n ${keys[2]} ]]
+ eend $?
+
+ ebegin "Substituting cloak-keys into ${unrealircd_conf}"
+ sed -i \
+ -e '/cloak-keys/ {
+n
+s/"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";/"'"${keys[0]}"'";/
+n
+s/"and another one";/"'"${keys[1]}"'";/
+n
+s/"and another one";/"'"${keys[2]}"'";/
+}' \
+ "${unrealircd_conf}"
+ eend $?
+ fi
+
+ elog "UnrealIRCd will not run until you've set up /etc/unrealircd/unrealircd.conf"
+ elog
+ elog "You can also configure ${PN} start at boot with rc-update(1)."
+ elog "It is recommended to run unrealircd as an unprivileged user."
+ elog "The provided init.d script does this for you."
+}