Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-irc/anope/files/, net-irc/anope/
Date: Wed, 06 Feb 2019 21:03:03
Message-Id: 1549486268.1eb2b264d55d3f76f745ff36ef065c08458933fd.grknight@gentoo
1 commit: 1eb2b264d55d3f76f745ff36ef065c08458933fd
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 6 20:51:08 2019 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 6 20:51:08 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1eb2b264
7
8 net-irc/anope: Version bump
9
10 Non-maintainer commit
11
12 Based heavily off of Palme's ebuild in the bug
13
14 Closes: https://bugs.gentoo.org/420613
15 Package-Manager: Portage-2.3.59, Repoman-2.3.12
16 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
17
18 net-irc/anope/Manifest | 1 +
19 net-irc/anope/anope-2.0.6.ebuild | 157 ++++++++++++++++++++++++++++++++++++
20 net-irc/anope/files/anope-conf.d-v2 | 9 +++
21 net-irc/anope/metadata.xml | 15 ++++
22 4 files changed, 182 insertions(+)
23
24 diff --git a/net-irc/anope/Manifest b/net-irc/anope/Manifest
25 index c166c738a00..3a36b042078 100644
26 --- a/net-irc/anope/Manifest
27 +++ b/net-irc/anope/Manifest
28 @@ -1 +1,2 @@
29 DIST anope-1.8.7.tar.gz 1586164 BLAKE2B 1efc6c9e719bca6698760d4181e2b96fa9aef5999a27af1c9452aea8ae39a5be7009efc14e5e7ad22426b95eb35952724b737d9de911830f3f69f822ebcc914f SHA512 3fb67f73b8f4dbdfbb9b4ac41a20e3b5c46d54cf5abb303f4a25d3a5863ef860ba5bdffc67439e5f1435675f80f86b2c283932c1a05edde2ae49612947fbd074
30 +DIST anope-2.0.6-source.tar.gz 1792912 BLAKE2B 00c70723c887821d2dda065f9fdb4c4fc79a1534217dd567c2247c3ae9d0b3c1c07a9e1e9d87bfdf5f7f9be212af5139e29710224e02e80154290dd6d4b5ee7c SHA512 c100758d6159023832bc7a4dceb7d554a9b3cd9120b033efc9a93c7ff28e76a086d0594b66b9cd2946b231421217674990f2a3ebaa8a6598c2a25e2dafd1b65b
31
32 diff --git a/net-irc/anope/anope-2.0.6.ebuild b/net-irc/anope/anope-2.0.6.ebuild
33 new file mode 100644
34 index 00000000000..aad039abb9b
35 --- /dev/null
36 +++ b/net-irc/anope/anope-2.0.6.ebuild
37 @@ -0,0 +1,157 @@
38 +# Copyright 1999-2019 Gentoo Authors
39 +# Distributed under the terms of the GNU General Public License v2
40 +
41 +EAPI=7
42 +
43 +inherit cmake-utils user
44 +
45 +DESCRIPTION="Anope IRC Services"
46 +HOMEPAGE="https://anope.org"
47 +SRC_URI="https://github.com/anope/anope/releases/download/${PV}/${P}-source.tar.gz"
48 +
49 +LICENSE="GPL-2"
50 +SLOT="0"
51 +KEYWORDS="~amd64 ~x86"
52 +IUSE="mysql sqlite pcre posix gnutls ssl tre ldap anope_modules_sql_auth
53 + anope_modules_sql_log anope_modules_sql_oper anope_modules_ldap_auth
54 + anope_modules_ldap_oper anope_modules_irc2sql anope_modules_chanstats
55 + anope_modules_cs_fantasy_stats anope_modules_cs_fantasy_top"
56 +
57 +REQUIRED_USE="
58 + anope_modules_sql_auth? ( || ( mysql sqlite ) )
59 + anope_modules_sql_oper? ( mysql )
60 + anope_modules_sql_log? ( mysql )
61 + anope_modules_cs_fantasy_stats? ( anope_modules_chanstats mysql )
62 + anope_modules_cs_fantasy_top? ( anope_modules_chanstats mysql )
63 + anope_modules_chanstats? ( mysql )
64 + anope_modules_irc2sql? ( mysql )
65 + anope_modules_ldap_auth? ( ldap )
66 + anope_modules_ldap_oper? ( ldap )"
67 +
68 +BDEPEND="sys-devel/gettext"
69 +DEPEND="${BDEPEND}
70 + mysql? ( dev-db/mysql-connector-c:0= )
71 + ssl? ( dev-libs/openssl:0= )
72 + gnutls? ( net-libs/gnutls:0= dev-libs/libgcrypt:0= )
73 + ldap? ( net-nds/openldap )
74 + pcre? ( dev-libs/libpcre )
75 + sqlite? ( dev-db/sqlite:3 )
76 + tre? ( dev-libs/tre )"
77 +RDEPEND="${DEPEND}"
78 +
79 +S="${WORKDIR}/${P}-source"
80 +
81 +pkg_pretend() {
82 + local replaced_version
83 + for replaced_version in ${REPLACING_VERSIONS} ; do
84 + if ver_test ${replaced_version} -lt 1.8.7 && [[ -f ${ROOT}/opt/anope/data/nick.db ]]; then
85 + eerror "It looks like you have an older version of Anope installed."
86 + eerror "To upgrade, shut down Anope and copy your databases to"
87 + eerror "${ROOT}/var/lib/anope and your configuration to ${ROOT}/etc/anope"
88 + eerror "You can do this by:"
89 + eerror "# mkdir -p ${ROOT}/var/lib/anope ${ROOT}/etc/anope"
90 + eerror "# chown anope:anope ${ROOT}/var/lib/anope"
91 + eerror "# mv ${ROOT}/opt/anope/data/*.db ${ROOT}var/lib/anope"
92 + eerror "# mv ${ROOT}/opt/anope/data/services.conf ${ROOT}etc/anope"
93 + die "Please move your anope database files from /opt/anope/data"
94 + fi
95 + done
96 +}
97 +
98 +pkg_setup() {
99 + enewgroup anope
100 + enewuser anope -1 -1 -1 anope
101 +}
102 +
103 +src_prepare() {
104 + anope_use_extra() {
105 + local useflag=$1
106 + local modulefile=$2
107 + if use $useflag; then
108 + ln -s "extra/${modulefile}" "modules/" || \
109 + die "Failed to use ${modulefile}"
110 + fi
111 + }
112 +
113 + anope_use_extra mysql "m_mysql.cpp"
114 + anope_use_extra sqlite "m_sqlite.cpp"
115 + anope_use_extra ssl "m_ssl_openssl.cpp"
116 + anope_use_extra gnutls "m_ssl_gnutls.cpp"
117 + anope_use_extra posix "m_regex_posix.cpp"
118 + anope_use_extra pcre "m_regex_pcre.cpp"
119 + anope_use_extra tre "m_regex_tre.cpp"
120 + anope_use_extra ldap "m_ldap.cpp"
121 + anope_use_extra anope_modules_sql_auth "m_sql_authentication.cpp"
122 + anope_use_extra anope_modules_sql_log "m_sql_log.cpp"
123 + anope_use_extra anope_modules_sql_oper "m_sql_oper.cpp"
124 + anope_use_extra anope_modules_ldap_auth "m_ldap_authentication.cpp"
125 + anope_use_extra anope_modules_ldap_oper "m_ldap_oper.cpp"
126 + anope_use_extra anope_modules_chanstats "stats/m_chanstats.cpp"
127 + anope_use_extra anope_modules_cs_fantasy_top "stats/cs_fantasy_top.cpp"
128 + anope_use_extra anope_modules_cs_fantasy_stats "stats/cs_fantasy_stats.cpp"
129 + anope_use_extra anope_modules_irc2sql "stats/irc2sql/irc2sql.cpp"
130 + anope_use_extra anope_modules_irc2sql "stats/irc2sql/irc2sql.h"
131 + anope_use_extra anope_modules_irc2sql "stats/irc2sql/tables.cpp"
132 + anope_use_extra anope_modules_irc2sql "stats/irc2sql/utils.cpp"
133 +
134 + # Avoid a silly sandbox error - tries to delete /usr/lib/modules
135 + sed -i '/install.*REMOVE_RECURSE.*/d' CMakeLists.txt || die
136 +
137 + cmake-utils_src_prepare
138 +}
139 +
140 +src_configure() {
141 + local mycmakeargs=(
142 + -DBIN_DIR="libexec/anope"
143 + -DDB_DIR="../var/lib/anope"
144 + -DDOC_DIR="share/doc/${PF}"
145 + -DLIB_DIR="$(get_libdir)/anope"
146 + -DLOCALE_DIR="share/locale"
147 + -DCONF_DIR="/etc/anope"
148 + -DLOGS_DIR="../var/log/anope/"
149 + )
150 + cmake-utils_src_configure
151 +}
152 +
153 +src_install() {
154 + cmake-utils_src_install
155 + newinitd "${FILESDIR}/anope-init.d" "${PN}"
156 + cp "${FILESDIR}/anope-conf.d-v2" "${T}" || die
157 + sed -i "s~%LIBDIR%~${EPREFIX}/usr/$(get_libdir)/anope/~" \
158 + "${T}/anope-conf.d-v2" || die
159 + newconfd "${T}/anope-conf.d-v2" "${PN}"
160 + dosym ../libexec/anope/services /usr/bin/services
161 + dosym ../libexec/anope/anopesmtp /usr/bin/anopesmtp
162 + keepdir /var/log/anope /var/lib/anope/backups
163 + fowners anope:anope /var/{lib,log}/anope /var/lib/anope/backups
164 + dodoc -r docs/* data/example.conf
165 + insinto /etc/anope
166 + newins data/example.conf services.conf
167 + fowners -R anope:anope /etc/anope
168 + fperms -R 0700 /etc/anope
169 + fperms 0755 /var/log/anope
170 + fperms -R 0750 /var/lib/anope
171 +}
172 +
173 +pkg_preinst() {
174 + if [[ -n ${REPLACING_VERSIONS} ]] ; then
175 + local directory
176 + directory="${ROOT}"/var/lib/anope/pre-update
177 + elog "Making a backup of your databases to ${directory}"
178 + if [ ! -d "${directory}" ]; then
179 + mkdir -p "${directory}" || die "failed to create backup directory"
180 + chown anope:anope "${directory}"/../ || die "failed to chown data directory"
181 + fi
182 + # don't die otherwise merge will fail if there are no existing databases
183 + cp "${ROOT}"/var/lib/anope/*.db "${directory}"
184 + fi
185 +}
186 +
187 +pkg_postinst() {
188 + if [[ -z ${REPLACING_VERSIONS} ]] ; then
189 + elog
190 + ewarn "Anope won't run out of the box, you still have to configure it to match your IRCD's configuration."
191 + ewarn "Edit /etc/anope/services.conf to configure Anope."
192 + elog
193 + fi
194 +}
195
196 diff --git a/net-irc/anope/files/anope-conf.d-v2 b/net-irc/anope/files/anope-conf.d-v2
197 new file mode 100644
198 index 00000000000..fbe7c3c5017
199 --- /dev/null
200 +++ b/net-irc/anope/files/anope-conf.d-v2
201 @@ -0,0 +1,9 @@
202 +# Copyright 1999-2019 Gentoo Authors
203 +# Distributed under the terms of the GNU General Public License v2
204 +
205 +# user to run ultimate-ircd as
206 +ANOPE_USER="anope"
207 +
208 +# Additional commandline parameters
209 +ANOPE_OPTS="--confdir=/etc/anope --logdir=/var/log/anope --dbdir=/var/lib/anope"
210 +ANOPE_OPTS="${ANOPE_OPTS} --localedir=/usr/share/locale --modulesdir=%LIBDIR%"
211
212 diff --git a/net-irc/anope/metadata.xml b/net-irc/anope/metadata.xml
213 index 52f9787ecc7..7a4bd9256ef 100644
214 --- a/net-irc/anope/metadata.xml
215 +++ b/net-irc/anope/metadata.xml
216 @@ -4,5 +4,20 @@
217 <longdescription>Anope IRC Services</longdescription>
218 <upstream>
219 <remote-id type="sourceforge">anope</remote-id>
220 + <remote-id type="github">anope/anope</remote-id>
221 </upstream>
222 + <use>
223 + <flag name="anope_modules_sql_auth">Authorize through SQL</flag>
224 + <flag name="anope_modules_sql_log">Additional log target in SQL</flag>
225 + <flag name="anope_modules_sql_oper">Allows granting users services operator privileges from SQL</flag>
226 + <flag name="anope_modules_ldap_auth">Authorize through LDAP</flag>
227 + <flag name="anope_modules_ldap_oper">Dynamically ties users to Anope opertypes via LDAP</flag>
228 + <flag name="anope_modules_irc2sql">Stores channel statistics in a mysql database</flag>
229 + <flag name="anope_modules_chanstats">Channel Statistics</flag>
230 + <flag name="anope_modules_cs_fantasy_stats">Enables the STATS and GSTATS commands</flag>
231 + <flag name="anope_modules_cs_fantasy_top">Enables the (G)TOP and (G)TOP10 commands</flag>
232 + <flag name="posix">Add support for POSIX Compatible Regular Expressions</flag>
233 + <flag name="ssl">Provide SSL services using OpenSSL</flag>
234 + <flag name="tre">Use <pkg>dev-libs/tre</pkg> for regular expressions</flag>
235 + </use>
236 </pkgmetadata>