DH_PHPPEAR(1)

๐Ÿ“ฆ
version 1.49build1 ยท 4 versions
, in ubuntu resolute, ubuntu stonking

๐Ÿ’– DH_PHPPEAR โ€” the dh_phppear era ๐Ÿ’–

okay bestie, gather round, because we're talking about dh_phppear from the Debhelper family, and she is booked and busy calculating PHP PEAR substvars โœจ


โœจ NAME โœจ

dh_phppear โ€” she calculates your PHP PEAR substvars, no cap ๐Ÿงฎ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

dh_phppear [debhelper options] [options]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so dh_phppear is a debhelper program, and her whole job โ€” her main character moment โ€” is generating the ${phppear:*} substitutions and dropping them into substvars files. that's it. that's the gig ๐Ÿซถ

first up, she peeks at package.xml (or package2.xml if that's the vibe) inside the package, and uses that info to generate:

  • ${phppear:summary}, ${phppear:description} and ${phppear:channel}
  • ${phppear:Debian-Depends}, ${phppear:Debian-Recommends}, ${phppear:Debian-Suggests} and ${phppear:Debian-Breaks}
Deprecated: the <pear-channels> package should be used (and updated) instead of introducing a new standalone channel package. ok so this is the old way, and we don't do the old way anymore ๐Ÿ’€

next, she looks at channel.xml in the package and uses that info to generate:

  • ${phppear:channel-name}, ${phppear:channel-summary} and ${phppear:channel-alias}
  • ${phppear:channel-common-description}

and then all of those variables get substituted into the package's control file wherever the token ${phppear:*} is placed. like, wherever you put the little placeholder, she fills it in. iconic behavior honestly ๐Ÿ‘‘


๐Ÿ’… OPTIONS ๐Ÿ’…

  • --sourcedirectory=directory โ€” assume the original package source tree lives at the specified directory instead of the top level directory of the Debian source package tree. lowkey a glow-up for your layout ๐ŸŒˆ
this feature requires pkg-php-tools (>= 1.14~). don't forget it bestie, she will not work without it ๐Ÿ˜ญ

๐ŸŽ€ FILES ๐ŸŽ€

  • debian/pkg-php-tools-overrides โ€” packages that don't wanna follow the automatic PEAR-package-name โ†’ Debian-package-name conversion can override that conversion by creating this file. yes, you get to have opinions โœจ

it can be installed in /usr/share/pkg-php-tools/overrides/package.

this feature requires pkg-php-tools (>= 1~).

the format is a set of lines, with each line having the following fields:

  • channel_url โ€” the channel URL as found in package.xml (example: pear.phpunit.de).
  • pear_package_name โ€” the PEAR package name (example: phpunit).
  • debian_package_name โ€” the resulting Debian package name (example: phpunit).
    • Use builtin if the package is compiled from the php source package.
    • Use none if the PEAR package can't be simply translated to Debian name.
  • version_override โ€” optional, for composer packages only, can be none if the version constraint from the original package should not be used for the replacement. useful when a package is being replaced by a PHP extension that doesn't follow the same versioning scheme. we love a special case ๐Ÿ’œ

๐Ÿ”ฅ ADVANCED USAGE ๐Ÿ”ฅ

๐Ÿงš Building a PECL package

a PECL package is a PEAR package which is compiled. so extra steps are needed, bestie:

  • adding php-dev, pkg-php-tools (>= 1.6~) and dh-php to Build-Depends.
  • adding ${shlibs:Depends} and ${misc:Depends} to Depends.
  • adding --with php to the dh line in debian/rules.

๐Ÿ“ Patching

dh_phppear will remove md5sums and sha1sums to ease patching. so you can patch as usual, no stress ๐Ÿซถ

๐ŸŒˆ Removing some files from the upstream tarball

if some files are removed from the upstream tarball, the package will be incomplete unless they are stripped from the package.xml file in the PEAR package subdir. this can be done after the dh_auto_configure step. example:

override_dh_auto_configure:
      dh_auto_configure -O--buildsystem=phppear
      # Remove references of JsMin
      sed -i '/JsMin\.php/d' */package.xml
this feature requires pkg-php-tools (>= 1.1~).

๐Ÿ‘‘ Building a channel package (DEPRECATED)

Deprecated: the pear-channels package should be used (and updated) instead of introducing a new standalone channel package. we said what we said ๐Ÿ’€

simply put the channel.xml file downloaded from the PEAR channel in the root of the package source and use a debian/rules similar to a PEAR package.

this feature requires pkg-php-tools (>= 1.3~).

โญ CONFORMING TO โญ

  • Debian policy, version 3.9.6.
  • PHP PEAR policy, version yet-to-be-written. (girl same, still a work in progress ๐Ÿ™ˆ)

๐Ÿ’œ SEE ALSO ๐Ÿ’œ

debhelper(7), pkg-php-tools(7), /usr/share/doc/pkg-php-tools/README.PEAR


๐ŸŒธ AUTHOR ๐ŸŒธ

Mathieu Parent <sathieu@debian.org> โ€” the real one, the legend, the icon ๐Ÿซถ


and that's the whole page bestie!! this was version 1.49build1, dated 2025-12-06, brought to you by Debhelper. mwah, go slay your packaging ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from