aboutsummaryrefslogtreecommitdiffstats
path: root/main/php5-pear-mdb2
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-05-05 11:59:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2016-05-05 15:43:07 +0000
commit750c752ce950bd96145d2acefa4adc4a93a96c01 (patch)
tree26065b86442b0f1872f275975575a3f0c6d8ee71 /main/php5-pear-mdb2
parente3067c006d9cae85310f4a8b90eae5e80e7f16c1 (diff)
downloadaports-750c752ce950bd96145d2acefa4adc4a93a96c01.tar.bz2
aports-750c752ce950bd96145d2acefa4adc4a93a96c01.tar.xz
main/php5-pear-mdb2: rename php to php5
Diffstat (limited to 'main/php5-pear-mdb2')
-rw-r--r--main/php5-pear-mdb2/APKBUILD67
1 files changed, 67 insertions, 0 deletions
diff --git a/main/php5-pear-mdb2/APKBUILD b/main/php5-pear-mdb2/APKBUILD
new file mode 100644
index 0000000000..6cf66f153a
--- /dev/null
+++ b/main/php5-pear-mdb2/APKBUILD
@@ -0,0 +1,67 @@
+# Contributor: Matt Smith <mcs@darkregion.net>
+# Maintainer: Matt Smith <mcs@darkregion.net>
+_php=php5
+pkgname=${_php}-pear-mdb2
+_pkgname=MDB2
+pkgver=2.5.0b5
+_driver_ver=1.5.0b4
+pkgrel=0
+pkgdesc="PEAR MDB2 Database Abstraction Layer"
+url="http://pear.php.net/package/MDB2/"
+arch="noarch"
+license="BSD"
+depends="${_php}-pear"
+depends_dev=
+makedepends="$depends_dev ${_php}-pear"
+install=""
+subpackages="
+ $pkgname-driver-mysql:driver_mysql
+ $pkgname-driver-mysqli:driver_mysqli
+ $pkgname-driver-pgsql:driver_pgsql
+ $pkgname-driver-sqlite:driver_sqlite
+ "
+source=""
+
+build() { return 0; }
+package() { _pear_install $_pkgname-$pkgver "$pkgdir" || return 1; }
+driver_mysql() { _do_driver mysql "mysql ${_php}-mysql" noarch; }
+driver_mysqli() { _do_driver mysqli "mysql ${_php}-mysqli" noarch; }
+driver_pgsql() { _do_driver pgsql "postgresql ${_php}-pgsql" noarch; }
+driver_sqlite() { _do_driver sqlite "${_php}-sqlite3" noarch; }
+
+
+_pear_install() {
+ local _pear_pkg=$1
+ local _pear_pkg_dir=$2
+
+ pear install --nodeps --packagingroot="$_pear_pkg_dir" $_pear_pkg \
+ || return 1
+
+ _cleanpaths="
+ usr/share/pear/.channels/
+ usr/share/pear/.depdb
+ usr/share/pear/.depdblock
+ usr/share/pear/.filemap
+ usr/share/pear/.lock
+ usr/share/pear/.registry/.channel.__uri/
+ usr/share/pear/.registry/.channel.doc.php.net/
+ usr/share/pear/.registry/.channel.pecl.php.net/
+ "
+ for _cleanpath in $_cleanpaths; do
+ rm -rf "$_pear_pkg_dir"/$_cleanpath || return 1
+ done
+}
+
+_do_driver() {
+ local _driver_name=$1
+
+ # driver dependencies
+ if [ -n "${2-}" ]; then
+ depends="${2-}"
+ fi
+ depends="${pkgname} ${depends}"
+ arch="${3-noarch}"
+
+ _pear_install ${_pkgname}_Driver_${_driver_name}-${_driver_ver} \
+ "$subpkgdir" || return 1
+}