Red Hat Bugzilla – Bug 173270
"pear makerpm" generates flawed RPMs
Last modified: 2007-11-30 17:11:17 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Description of problem:
There are (at least) three problems with the RPMs generated by "pear makerpm".
First, the %postun script tries to rely on the -r option to pear uninstall, and that doesn't work (see bug #173261), although I don't think the -r option is actually needed in this case.
Second, the %postun script should instead read
if [ "$1" = "0" ] ; then
pear uninstall --nodeps -r <package-name>
to avoid unregistering/uninstalling the package on an upgrade.
Third, php-pear is not listed as a prereq.
Fourth, the %post script should probably include a "--force" flag, otherwise pear will refuse to register a module on an upgrade. (I haven't tested this extensively.)
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Download the source to a PEAR module and put it in your SOURCES directory.
2. cd to your SPECS directory
3. Run pear makerpm ../SOURCES/pear-source-module-name.tgz
Actual Results: Generates an RPM spec file containing several errors.
Expected Results: Generates an RPM spec file containing fewer errors.
Coincidental with this bug, I filed a separate bug upstream including a proposed
patch to the 'post/postun' issue which has been accepted upstream:
http://pear.php.net/bugs/bug.php?id=5959 . Works for me but any review by anyone
An additional problem with "pear makerpm" (file naming conventions) is
documented in bug #173802
I am currently hacking around with PEAR wrt RPM compatibility and have filed a
number of other related issues:
bug #173804 - php core rpm does not have Provides
bug #173806 - php-pear does not have Provides:
bug #173808 - php-pear has too much bundled in it
bug #173810 - php-pear should be built separately to main PHP package
Created attachment 121298 [details]
patch for template.spec that fixes post/postun problem
applies to php-pear-5.0.4-10.5
Another problem (from upstream, not FC/RH specific) with "pear makerpm" (at
least versions included with current stable PHP) is lack of generation of
dependencies on other PEAR packages. See bug #173814 for more info and fix.
Patch for post/postun issue is in PEAR 1.4.5 upstream.
Since this bug is already turning into a meta-bug for "all the things that are
wrong with PEAR and RPMs" (perhaps we should actually turn it into a proper meta
bug, or create one?), here's another: bug #173980 - RPM errors when packaging
doc files in some packages.
All the issues listed in this particular bug are fixed in php-pear-1.4.5-3.
There are still some outstanding issues related to PHP/PEAR RPM packaging as
mentioned in bugs referenced above, but I think this bug can be closed.
Great. Thanks a lot for pushing this stuff upstream!