dh-php throws PHP_DEFAULT_VERSION cannot be empty
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dh-php (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
While trying to compile php-mongodb-1.15.1, the dpkg-buildpackage stage keeps failing with:
#12 1.337 dpkg-buildpackage: info: host architecture amd64
#12 2.192 fakeroot debian/rules clean
#12 2.966 PHP_DEFAULT_
#12 2.992 PHP_DEFAULT_
#12 2.992 AVAILABLE_
#12 2.992 /usr/share/
#12 2.997 dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2
This appears to be related to the changes made in dh-php 4.9. These changes might work fine on Debian, but since the output of `php-config --version` is quite different between Debian and Ubuntu, the matching seems to fail in pkg-pecl.mk.
Debian:
# php-config --version | sed -E -e 's,\.[^.]*$$,,'
7.4
# /usr/sbin/phpquery -V
7.4
Ubuntu:
# php-config --version | sed -E -e 's,\.[^.]*$$,,'
8.1.2-1ubuntu2
# /usr/sbin/phpquery -V
8.1
Environment:
Ubuntu 22.04
dh-php 4.9
I run this bug too. The sed regex is wrong:
If you install main release php8.1-dev package:
# dpkg -l|grep php8.1-dev
ii php8.1-dev 8.1.2-1ubuntu2 amd64 Files for PHP8.1 module development
It works good:
# php-config --version
8.1.2
# php-config --version | sed -e 's,\.[^.]*$,,'
8.1
If you install the security package:
# dpkg -l|grep php8.1-dev
ii php8.1-dev 8.1.2-1ubuntu2.11 amd64 Files for PHP8.1 module development
It's not good:
# php-config --version
8.1.2-1ubuntu2.11
# php-config --version | sed -e 's,\.[^.]*$,,'
8.1.2-1ubuntu2