Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/maxmind-db-reader/
Date: Fri, 21 Feb 2020 18:01:10
Message-Id: 1582307942.1a6f847f29b1a626a25c8d531f9bd1a0ac8a67c2.grknight@gentoo
1 commit: 1a6f847f29b1a626a25c8d531f9bd1a0ac8a67c2
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 21 17:59:02 2020 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 21 17:59:02 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a6f847f
7
8 dev-php/maxmind-db-reader: Version bump for 1.6.0
9
10 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
11
12 dev-php/maxmind-db-reader/Manifest | 1 +
13 .../maxmind-db-reader-1.6.0.ebuild | 78 ++++++++++++++++++++++
14 2 files changed, 79 insertions(+)
15
16 diff --git a/dev-php/maxmind-db-reader/Manifest b/dev-php/maxmind-db-reader/Manifest
17 index 668eacd1cc9..48e10f9afd7 100644
18 --- a/dev-php/maxmind-db-reader/Manifest
19 +++ b/dev-php/maxmind-db-reader/Manifest
20 @@ -1 +1,2 @@
21 DIST MaxMind-DB-Reader-php-1.4.1.tar.gz 19667 BLAKE2B b397eb1bb7fa00c3382c7ee7c019c401d390c88d9bccd7742873445e95cb87d780ac17affe5cd1ec98e6f60d16660784dc5fdb188f8e4d2956df816397a9c251 SHA512 2407f3d1af10830078c9f5ba93ee74761084b06e630242eff0f707b98bdb78e6e87dabc999c36b29780ba9c8c38aec0225700005b66d95b3707bdc06875c6dd5
22 +DIST MaxMind-DB-Reader-php-1.6.0.tar.gz 20898 BLAKE2B cf6922bbd5b2c76fcb9b7a97299f0a73232686bf8facce39355f8a4cc55e98a4d8e64a51eae8427b5f14d6905d4cd85956effa5299cc493bd63708cf52ab30d0 SHA512 e8c0ccf2cfcedf7527b4e3f858d2ed0e70add60692fff4a65f08e5cb885516b7c2a3ceaa3c21713369cd8ffca2b671d764063236de1d729cfc5173f7d5dd4607
23
24 diff --git a/dev-php/maxmind-db-reader/maxmind-db-reader-1.6.0.ebuild b/dev-php/maxmind-db-reader/maxmind-db-reader-1.6.0.ebuild
25 new file mode 100644
26 index 00000000000..20d90c48bb6
27 --- /dev/null
28 +++ b/dev-php/maxmind-db-reader/maxmind-db-reader-1.6.0.ebuild
29 @@ -0,0 +1,78 @@
30 +# Copyright 1999-2020 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI="7"
34 +
35 +MY_PN="MaxMind-DB-Reader-php"
36 +MY_P="${MY_PN}-${PV}"
37 +S="${WORKDIR}/${MY_P}"
38 +PHP_EXT_S="${S}/ext"
39 +PHP_EXT_NAME="maxminddb"
40 +PHP_EXT_OPTIONAL_USE="extension"
41 +
42 +USE_PHP="php7-2 php7-3 php7-4"
43 +
44 +inherit php-ext-source-r3
45 +
46 +DESCRIPTION="PHP reader for the MaxMind database format"
47 +HOMEPAGE="https://github.com/maxmind/MaxMind-DB-Reader-php"
48 +SRC_URI="https://github.com/maxmind/${MY_PN}/archive/v${PV}.tar.gz -> ${MY_P}.tar.gz"
49 +
50 +LICENSE="Apache-2.0"
51 +SLOT="0"
52 +KEYWORDS="~amd64"
53 +IUSE="extension test"
54 +RESTRICT="!test? ( test )"
55 +
56 +DEPEND="extension? ( dev-libs/libmaxminddb )"
57 +RDEPEND="${DEPEND}"
58 +
59 +src_prepare(){
60 + # We need to call eapply_user ourselves, because it may be skipped
61 + # if either the "extension" USE flag is not set, or if the user's
62 + # PHP_TARGETS is essentially empty. In the latter case, the eclass
63 + # src_prepare does nothing. We only call the eclass phase conditionally
64 + # because the correct version of e.g. "phpize" may not be there
65 + # unless USE=extension is set.
66 + if use extension ; then
67 + php-ext-source-r3_src_prepare
68 + else
69 + default
70 + fi
71 +}
72 +
73 +src_configure() {
74 + # The eclass phase will try to run the ./configure script even if it
75 + # doesn't exist (in contrast to the default src_configure), so we
76 + # need to skip it if the eclass src_prepare (that creates said
77 + # script) is not run.
78 + use extension && php-ext-source-r3_src_configure
79 +}
80 +
81 +src_compile() {
82 + # Avoids the same problem as in src_configure.
83 + use extension && php-ext-source-r3_src_compile
84 +}
85 +
86 +src_install() {
87 + dodoc CHANGELOG.md README.md
88 + insinto /usr/share/php
89 + doins -r src/MaxMind
90 + insinto /usr/share/php/MaxMind/Db
91 + doins autoload.php
92 +
93 + use extension && php-ext-source-r3_src_install
94 +}
95 +
96 +src_test() {
97 + # The PHP API has its own set of tests that isn't shipped with the
98 + # release tarballs at the moment (github issues 55).
99 + use extension && php-ext-source-r3_src_test
100 +}
101 +
102 +pkg_postinst(){
103 + elog "${PN} has been installed in /usr/share/php/MaxMind/Db/."
104 + elog "To use it in a script, require('MaxMind/Db/autoload.php'),"
105 + elog "and then most of the examples in the documentation should"
106 + elog "work without further modification."
107 +}