summaryrefslogtreecommitdiff
path: root/dev-php/maxmind-db-reader/maxmind-db-reader-1.4.1.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-06-08 09:04:53 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-06-08 09:04:53 +0100
commit73c318acdaf6f8309d68bd266051e6dd1f1bd787 (patch)
tree2878053f3e7faed19a1f82c733d3bd29df69991e /dev-php/maxmind-db-reader/maxmind-db-reader-1.4.1.ebuild
parent2018227e9344edb9da15fc6a4a8298086cc2aa77 (diff)
gentoo resync : 08.06.2019
Diffstat (limited to 'dev-php/maxmind-db-reader/maxmind-db-reader-1.4.1.ebuild')
-rw-r--r--dev-php/maxmind-db-reader/maxmind-db-reader-1.4.1.ebuild77
1 files changed, 77 insertions, 0 deletions
diff --git a/dev-php/maxmind-db-reader/maxmind-db-reader-1.4.1.ebuild b/dev-php/maxmind-db-reader/maxmind-db-reader-1.4.1.ebuild
new file mode 100644
index 000000000000..e5bac06988f7
--- /dev/null
+++ b/dev-php/maxmind-db-reader/maxmind-db-reader-1.4.1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+MY_PN="MaxMind-DB-Reader-php"
+MY_P="${MY_PN}-${PV}"
+S="${WORKDIR}/${MY_P}"
+PHP_EXT_S="${S}/ext"
+PHP_EXT_NAME="maxminddb"
+PHP_EXT_OPTIONAL_USE="extension"
+
+USE_PHP="php5-6 php7-0 php7-1 php7-2 php7-3"
+
+inherit php-ext-source-r3
+
+DESCRIPTION="PHP reader for the MaxMind database format"
+HOMEPAGE="https://github.com/maxmind/${MY_PN}"
+SRC_URI="${HOMEPAGE}/archive/v${PV}.tar.gz -> ${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="extension test"
+
+DEPEND="extension? ( dev-libs/libmaxminddb )"
+RDEPEND="${DEPEND}"
+
+src_prepare(){
+ # We need to call eapply_user ourselves, because it may be skipped
+ # if either the "extension" USE flag is not set, or if the user's
+ # PHP_TARGETS is essentially empty. In the latter case, the eclass
+ # src_prepare does nothing. We only call the eclass phase conditionally
+ # because the correct version of e.g. "phpize" may not be there
+ # unless USE=extension is set.
+ if use extension ; then
+ php-ext-source-r3_src_prepare
+ else
+ default
+ fi
+}
+
+src_configure() {
+ # The eclass phase will try to run the ./configure script even if it
+ # doesn't exist (in contrast to the default src_configure), so we
+ # need to skip it if the eclass src_prepare (that creates said
+ # script) is not run.
+ use extension && php-ext-source-r3_src_configure
+}
+
+src_compile() {
+ # Avoids the same problem as in src_configure.
+ use extension && php-ext-source-r3_src_compile
+}
+
+src_install() {
+ dodoc CHANGELOG.md README.md
+ insinto /usr/share/php
+ doins -r src/MaxMind
+ insinto /usr/share/php/MaxMind/Db
+ doins autoload.php
+
+ use extension && php-ext-source-r3_src_install
+}
+
+src_test() {
+ # The PHP API has its own set of tests that isn't shipped with the
+ # release tarballs at the moment (github issues 55).
+ use extension && php-ext-source-r3_src_test
+}
+
+pkg_postinst(){
+ elog "${PN} has been installed in /usr/share/php/MaxMind/Db/."
+ elog "To use it in a script, require('MaxMind/Db/autoload.php'),"
+ elog "and then most of the examples in the documentation should"
+ elog "work without further modification."
+}