Alien::Package::Rpm(3pm) | User Contributed Perl Documentation | Alien::Package::Rpm(3pm) |
Alien::Package::Rpm - an object that represents a rpm package
This is an object class that represents a rpm package. It is derived from Alien::Package.
An optional parameter, if passed, can be used to specify the program to use to build the rpm. It defaults to rpmbuild.
When retreiving the version, remove any dashes in it.
When retrieving a value, we have to do some truly sick mangling. Since debian/slackware scripts can be anything -- perl programs or binary files -- and rpm is limited to only shell scripts, we need to encode the files and add a scrap of shell script to make it unextract and run on the fly.
When setting a value, we do some mangling too. Rpm maintainer scripts are typically shell scripts, but often lack the leading shebang line. This can confuse dpkg, so add the shebang if it looks like there is no shebang magic already in place.
Additionally, it's not uncommon for rpm maintainer scripts to contain bashisms, which can be triggered when they are ran on systems where /bin/sh is not bash. To work around this, the shebang line of the scripts is changed to use bash.
Also, if the rpm is relocatable, the script could refer to RPM_INSTALL_PREFIX, which is set by rpm at run time. Deal with this by adding code to the script to set RPM_INSTALL_PREFIX.
Joey Hess <joey@kitenet.net>
2022-05-25 | perl v5.34.0 |