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/anope/
Date: Mon, 12 Oct 2020 20:05:45
Message-Id: 1602533134.4bf674c6b01a14cb375cbdbb495822f3aa2a0a7f.sam@gentoo
1 commit: 4bf674c6b01a14cb375cbdbb495822f3aa2a0a7f
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 12 20:05:34 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 12 20:05:34 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bf674c6
7
8 net-irc/anope: bump to 2.0.8
9
10 Package-Manager: Portage-3.0.8, Repoman-3.0.1
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 net-irc/anope/Manifest | 1 +
14 net-irc/anope/anope-2.0.8.ebuild | 152 +++++++++++++++++++++++++++++++++++++++
15 2 files changed, 153 insertions(+)
16
17 diff --git a/net-irc/anope/Manifest b/net-irc/anope/Manifest
18 index 335593c6ec6..7f9843c097e 100644
19 --- a/net-irc/anope/Manifest
20 +++ b/net-irc/anope/Manifest
21 @@ -1 +1,2 @@
22 DIST anope-2.0.7-source.tar.gz 1817484 BLAKE2B 13a4628db8cb885d4636ab1897aab322f7846740e4a3fccd02a417d84a8eb3c942aebf5e0a51f8ca1108f455b44b4e280e7386b42e03f640c9b0e68943252814 SHA512 22a9f3e0d9fe7f68304062829a19b693a3414f94c90f8da601ab98995cbff7310dc22ca40749d50d6722dfb4649817d2f4b1dbe4afa3254b28980f03a491de65
23 +DIST anope-2.0.8.tar.gz 1808747 BLAKE2B f4413fdd151498c7521df175b88cc693a00de8ee3960962f79affd8cb821d428f12145dcc444c75e5940ea80ea22591048c313d7cda32570ed7a941e37e27334 SHA512 ddb42a453d72327d2256e5963f720bb310a7524c01661a0a136f18c539813649889e9fb764077c86e0854de8e3da095ebabb1ba53a0538d679bd42ea6403823b
24
25 diff --git a/net-irc/anope/anope-2.0.8.ebuild b/net-irc/anope/anope-2.0.8.ebuild
26 new file mode 100644
27 index 00000000000..d7c7c0caf69
28 --- /dev/null
29 +++ b/net-irc/anope/anope-2.0.8.ebuild
30 @@ -0,0 +1,152 @@
31 +# Copyright 1999-2020 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +inherit cmake
37 +
38 +DESCRIPTION="Anope IRC Services"
39 +HOMEPAGE="https://anope.org/ https://github.com/anope/anope/"
40 +SRC_URI="https://github.com/anope/anope/archive/${PV}.tar.gz -> ${P}.tar.gz"
41 +
42 +LICENSE="GPL-2"
43 +SLOT="0"
44 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
45 +IUSE="gnutls ldap mysql pcre sql sqlite ssl tre"
46 +REQUIRED_USE="sql? ( || ( mysql sqlite ) )"
47 +
48 +BDEPEND="sys-devel/gettext"
49 +DEPEND="
50 + acct-group/anope
51 + acct-user/anope
52 + mysql? ( dev-db/mysql-connector-c:0= )
53 + ssl? ( dev-libs/openssl:0= )
54 + gnutls? (
55 + net-libs/gnutls:0=
56 + dev-libs/libgcrypt:0=
57 + )
58 + ldap? ( net-nds/openldap )
59 + pcre? ( dev-libs/libpcre )
60 + sqlite? ( dev-db/sqlite:3 )
61 + tre? ( dev-libs/tre )
62 + virtual/libintl
63 +"
64 +RDEPEND="${DEPEND}"
65 +
66 +PATCHES=(
67 + "${FILESDIR}/${PN}-2.0.6-example.conf-pid-path.patch"
68 + "${FILESDIR}/${PN}-2.0.7-example.conf-user.patch"
69 +)
70 +
71 +src_prepare() {
72 + anope_enable_mod() {
73 + local modulefile=${1}
74 + ln -s "extra/${modulefile}" "modules/" || \
75 + die "Failed to use ${modulefile}"
76 + }
77 +
78 + # These all require MySQL specifically
79 + if use mysql ; then
80 + anope_enable_mod "m_mysql.cpp"
81 + anope_enable_mod "stats/irc2sql/irc2sql.cpp"
82 + anope_enable_mod "stats/irc2sql/irc2sql.h"
83 + anope_enable_mod "stats/irc2sql/tables.cpp"
84 + anope_enable_mod "stats/irc2sql/utils.cpp"
85 + anope_enable_mod "stats/m_chanstats.cpp"
86 + anope_enable_mod "stats/cs_fantasy_top.cpp"
87 + anope_enable_mod "stats/cs_fantasy_stats.cpp"
88 + anope_enable_mod "m_sql_log.cpp"
89 + anope_enable_mod "m_sql_oper.cpp"
90 + fi
91 +
92 + use sqlite && anope_enable_mod "m_sqlite.cpp"
93 +
94 + # Any SQL implementation
95 + if use sql ; then
96 + anope_enable_mod "m_sql_authentication.cpp"
97 + fi
98 +
99 + if use ldap ; then
100 + anope_enable_mod "m_ldap.cpp"
101 + anope_enable_mod "m_ldap_authentication.cpp"
102 + anope_enable_mod "m_ldap_oper.cpp"
103 + fi
104 +
105 + use gnutls && anope_enable_mod "m_ssl_gnutls.cpp"
106 + use pcre && anope_enable_mod "m_regex_pcre.cpp"
107 + use ssl && anope_enable_mod "m_ssl_openssl.cpp"
108 + use tre && anope_enable_mod "m_regex_tre.cpp"
109 +
110 + # Unconditional modules
111 + anope_enable_mod "m_regex_posix.cpp"
112 +
113 + # Avoid a silly sandbox error - tries to delete /usr/lib/modules
114 + sed -i '/install.*REMOVE_RECURSE.*/d' CMakeLists.txt || die
115 +
116 + # Copy anope.conf for fixup to comply w/ prefix
117 + cp "${FILESDIR}/anope-conf.d-v2" "${T}" || die
118 +
119 + # Look in the right place for modules
120 + sed -i "s~%LIBDIR%~${EPREFIX}/usr/$(get_libdir)/anope/~" \
121 + "${T}/anope-conf.d-v2" || die
122 +
123 + cmake_src_prepare
124 +}
125 +
126 +src_configure() {
127 + local mycmakeargs=(
128 + -DBIN_DIR="libexec/anope"
129 + -DDB_DIR="../var/lib/anope"
130 + -DDOC_DIR="share/doc/${PF}"
131 + -DLIB_DIR="$(get_libdir)/anope"
132 + -DLOCALE_DIR="share/locale"
133 + -DCONF_DIR="/etc/anope"
134 + -DLOGS_DIR="../var/log/anope/"
135 + )
136 +
137 + cmake_src_configure
138 +}
139 +
140 +src_install() {
141 + cmake_src_install
142 +
143 + newinitd "${FILESDIR}/anope-init.d" "${PN}"
144 + newconfd "${T}/anope-conf.d-v2" "${PN}"
145 +
146 + dosym ../libexec/anope/services /usr/bin/services
147 + dosym ../libexec/anope/anopesmtp /usr/bin/anopesmtp
148 +
149 + keepdir /var/log/anope /var/lib/anope/backups
150 + fowners anope:anope /var/{lib,log}/anope /var/lib/anope/backups
151 +
152 + dodoc -r docs/* data/example.conf
153 +
154 + insinto /etc/anope
155 + newins data/example.conf services.conf
156 +
157 + fowners anope:anope /var/log/anope
158 + fowners anope:anope /var/lib/anope/backups/
159 +}
160 +
161 +pkg_postinst() {
162 + if [[ -z "${REPLACING_VERSIONS}" ]] ; then
163 + # Only tell them about this on a fresh install.
164 + elog
165 + ewarn "Anope won't run out of the box, you still have to configure it to match your IRCd's configuration."
166 + ewarn "Edit /etc/anope/services.conf to configure Anope."
167 + elog
168 + else
169 + # We're replacing some versions. Find out which.
170 + local ver
171 + for ver in "${REPLACING_VERSIONS}" ; do
172 + if ver_test ${ver} -lt 2.0.7 ; then
173 + # In this version, we introduced correct FHS structure
174 + # We need the users to make some changes to their services.conf
175 + ewarn "Please modify your services.conf to include the following directive:"
176 + ewarn "in options{}, please include user=\"anope\" and group=\"anope\""
177 + ewarn "This is needed because Anope now starts as root and drops down."
178 + ewarn "Reference: https://wiki.anope.org/index.php/2.0/Configuration#Services_Process_Options"
179 + fi
180 + done
181 + fi
182 +}