#24166 [Opn->Fbk]: pear makerpm is broken

From: Date: Mon, 16 Jun 2003 08:31:39 +0000
Subject: #24166 [Opn->Fbk]: pear makerpm is broken
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17505@lists.php.net to get a copy of this message
ID: 24166 Updated by: cox@php.net Reported By: jmcastagnetto@php.net -Status: Open +Status: Feedback Bug Type: PEAR related Operating System: Suse Linux 8.2 PHP Version: 4.3.2 Assigned To: cox New Comment: Finally read some Maximum RPM, and commited a patch. You'll need to cvs update php4/pear/PEAR/Installer.php and php4/pear/template.spec. Please test it. Thanks. Previous Comments: ------------------------------------------------------------------------ [2003-06-16 00:19:07] jmcastagnetto@php.net The latest patches generate a spec file, but there is a problem with the building. My local config points to /home/server/php as the root for PHP installation, which is messing up the asumed /usr/local/ (see below). Perhaps we should use the 'Prefix:' tag in the RPM spec to allow for relocatable RPMs? I agree that if would be best to let 'pear' to figure out the appropriate places, and use the RPM as a delivery format to put the stuff in a temp place that 'pear' can use. My experience w/ RPM is limited. Found some good info at: http://www.rpm.org/max-rpm/index.html Example of error while creating the rpm: $ rpm -bb PEAR\:\:Math_TrigOp-1.0.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.64345 + umask 022 + cd /usr/src/packages/BUILD + cd /usr/src/packages/BUILD + /bin/gzip -dc /usr/src/packages/SOURCES/Math_TrigOp-1.0.tgz + tar -xf - + STATUS=0 + '[' 0 -ne 0 ']' + cd Math_TrigOp-1.0 ++ /usr/bin/id -u + '[' 500 = 0 ']' ++ /usr/bin/id -u + '[' 500 = 0 ']' + /bin/chmod -Rf a+rX,g-w,o-w . + mv ../package.xml . + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.64345 + umask 022 + cd /usr/src/packages/BUILD + cd Math_TrigOp-1.0 + echo BuildRoot=/var/tmp/PEAR::Math_TrigOp-root BuildRoot=/var/tmp/PEAR::Math_TrigOp-root + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.64345 + umask 022 + cd /usr/src/packages/BUILD + cd Math_TrigOp-1.0 + rm -rf /var/tmp/PEAR::Math_TrigOp-root/home /var/tmp/PEAR::Math_TrigOp-root/var + pear -q install -R /var/tmp/PEAR::Math_TrigOp-root -n package.xml + mkdir -p /var/tmp/PEAR::Math_TrigOp-root/var/lib/pear + cp -p package.xml /var/tmp/PEAR::Math_TrigOp-root/var/lib/pear/Math_TrigOp.xml + RPM_BUILD_ROOT=/var/tmp/PEAR::Math_TrigOp-root + export RPM_BUILD_ROOT + test -x /usr/sbin/Check -a 500 = 0 -o -x /usr/sbin/Check -a '!' -z /var/tmp/PEAR::Math_TrigOp-root + echo 'I call /usr/sbin/Check...' I call /usr/sbin/Check... + /usr/sbin/Check + /usr/lib/rpm/brp-compress Processing files: PEAR::Math_TrigOp-1.0-1 File not found: /var/tmp/PEAR::Math_TrigOp-root/usr/lib/php/pear/TrigOp.php PreReq: /bin/sh ------------------------------------------------------------------------ [2003-06-15 23:41:13] cox@php.net I'll change the way to unpack/install files. Let me some time to test it better. ------------------------------------------------------------------------ [2003-06-15 11:32:08] cox@php.net Sorry, I commited a wrong version of my original patch, was a casuality to have a package.xml in my current dir, that's why it worked for me :-/ Btw, I've made a new file list, using the RPM vars. I haven't built rpms since many time, perhaps it's not correct. Could you test it? Thanks! ------------------------------------------------------------------------ [2003-06-15 01:10:47] jmcastagnetto@php.net The patch did not work. The one below does: --- Package.php-orig 2003-06-14 18:27:24.000000000 -0700 +++ Package.php 2003-06-14 18:26:37.000000000 -0700 @@ -585,7 +585,7 @@ $pkgdir = "$info[package]-$info[version]"; $info['rpm_xml_dir'] = '/var/lib/pear'; $this->config->set('verbose', $tmp); - if (!$tar->extractList("$pkgdir/package.xml", $instroot, $pkgdir)) { + if (!$tar->extractList("package.xml", $instroot)) { return $this->raiseError("failed to extract $params[0]"); } if (!file_exists("$instroot/package.xml")) { Also, the spec file might need some more work. The files end up being installed on a place highly dependent on the config of the person generating the RPM, For example. I have PHP installed in '/home/server/php', but most people have it in '/usr/local'. The postinstall part does not seem to be working. No matter what the local config is (tried on a machine where PHP is installed in /usr/local), and the RPM still tried to install it in '/home/server/php'. That is not the correct behaviour. Re-openning as this command still generates something the is (albeit indirectly) broken. I think that the '@doc_dir@' and '@files@' vars in the 'template.spec' might need to be reworked to generate a good non-pacakager-system dependent RPM. ------------------------------------------------------------------------ [2003-06-14 11:58:16] cox@php.net Oops, there was a conflict with my patch that I overpassed, it's commited now. The affected file is php4/pear/PEAR/Command/Package.php Thanks again :-) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/24166 -- Edit this bug report at http://bugs.php.net/?id=24166&edit=1

« previous php.pear.dev (#17505) next »