#!/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}/lib/overrides@" \
    lib/scripts/phppkginfo > lib/scripts/phppkginfo.test
chmod u+x lib/scripts/phppkginfo.test

expect_equal "php lib/scripts/phppkginfo.test debian_deps '${testpkg}'" 'Depends: php5-common (>= 5.2.1), php-pear (>= 1.8.0)
Recommends: php5-mysql'
expect_equal "php lib/scripts/phppkginfo.test debian_deps '${testpecl}'" "Depends: php5-common (>= 5.2.1), php-pear (>= 1.8.0), phpapi-$(php-config --phpapi)"

rm lib/scripts/phppkginfo.test
