#!/bin/sh

set -e
. ./testsuite/common.sh

testpkg='testsuite/data/pearpkg1'
testpecl='testsuite/data/peclpkg1'

sed -e "s@/usr/share/pkg-php-tools/overrides@${PWD}/share/pkg-php-tools/overrides@" \
    share/pkg-php-tools/scripts/phppkginfo > share/pkg-php-tools/scripts/phppkginfo.test
chmod u+x share/pkg-php-tools/scripts/phppkginfo.test

expect_equal "php share/pkg-php-tools/scripts/phppkginfo.test debian_deps '${testpkg}'" 'Depends: php5-common (>= 5.2.1), php-horde-alarm (>= 2.2.0), php-horde-alarm (<< 3.0.0~alpha1)
Recommends: php5-mysql'
expect_equal "php share/pkg-php-tools/scripts/phppkginfo.test debian_deps '${testpecl}'" "Depends: php5-common (>= 5.2.1), phpapi-$(php-config --phpapi)"

rm share/pkg-php-tools/scripts/phppkginfo.test
