From 2f80e3b0d7f5f97141be08ec22cbfc9e986da7c1 Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Thu, 14 Apr 2011 03:45:09 -0500 Subject: main/php-pear-mdb2: moved from testing --- main/php-pear-mdb2/APKBUILD | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 main/php-pear-mdb2/APKBUILD (limited to 'main/php-pear-mdb2') diff --git a/main/php-pear-mdb2/APKBUILD b/main/php-pear-mdb2/APKBUILD new file mode 100644 index 0000000000..06dab5fa3e --- /dev/null +++ b/main/php-pear-mdb2/APKBUILD @@ -0,0 +1,66 @@ +# Contributor: Matt Smith +# Maintainer: Matt Smith +pkgname=php-pear-mdb2 +_pkgname=MDB2 +pkgver=2.5.0b3 +_driver_ver=1.5.0b3 +pkgrel=1 +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-sqlite" 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 +} -- cgit v1.2.3