diff options
author | Matt Smith <mcs@darkregion.net> | 2011-04-09 00:19:21 -0500 |
---|---|---|
committer | Matt Smith <mcs@darkregion.net> | 2011-04-09 00:20:25 -0500 |
commit | 6160ad4d5fe726898fd78d81401fcb74210eb863 (patch) | |
tree | ce7bc3259bd5e5deae69f56f23da2ac3715b1817 /testing | |
parent | 349f1088905bee1d6d019764326213102198890f (diff) | |
download | aports-6160ad4d5fe726898fd78d81401fcb74210eb863.tar.bz2 aports-6160ad4d5fe726898fd78d81401fcb74210eb863.tar.xz |
testing/php-pear-mdb2: new aport
PEAR MDB2 Database Abstraction Layer
http://pear.php.net/package/MDB2/
Diffstat (limited to 'testing')
-rw-r--r-- | testing/php-pear-mdb2/APKBUILD | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/testing/php-pear-mdb2/APKBUILD b/testing/php-pear-mdb2/APKBUILD new file mode 100644 index 000000000..16c558fd4 --- /dev/null +++ b/testing/php-pear-mdb2/APKBUILD @@ -0,0 +1,61 @@ +# Contributor: Matt Smith <mcs@darkregion.net> +# Maintainer: Matt Smith <mcs@darkregion.net> +pkgname=php-pear-mdb2 +_pkgname=MDB2 +pkgver=2.5.0b3 +_driver_ver=1.5.0b3 +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-mysql $pkgname-mysqli $pkgname-pgsql $pkgname-sqlite" +source="" + +build() { return 0; } +package() { _pear_install $_pkgname-$pkgver "$pkgdir" || return 1; } +mysql() { _do_driver mysql "mysql php-mysql" noarch; } +mysqli() { _do_driver mysqli "mysql php-mysqli" noarch; } +pgsql() { _do_driver pgsql "postgresql php-pgsql" noarch; } +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 +} |