Mike Meyer
2007-11-13 23:46:12 UTC
Hi all,
I'm trying to build an rpm from a python application for a client to
run on both RHEL4 and RHEL5.
rpmbuild has the rather nasty habit of runing
/usr/lib/rpm/brp-python-byteompile, which goes through all the files
to be installed by the rpm, and compiling any .py files it finds into
.pyo files.
The first problem is that, while the resulting rpm claims to be
noarch, I can't find anything from the Python folks promising that
.pyo (and .pyc) files are architecture-dependent, so this would seem
to be an error even in the general case, but that's not really my
problem.
My issues is that the resulting .pyo are just so much wasted space.
They don't work on one of the two platforms we're going to deploy to,
because the two pythons are different (2.3 vs. 2.4), and use different
versions of the byte code.
That this all happens after the install scripts run means I can't use
the rpm build process to clean up after it. The best I've been able to
do is use a post-install script to delete the garbage files it
installs - which means the rpm carries them around, we install them,
and then delete them, which is just ugly, and seems error-prone as
well.
Ideally, there's a knob somewhere I can twist to disable
brp-python-bytecompile at rpm build time, and I can then fix the
install scripts to byte-compile the things I need.
Failing that, is there someplace I can hook a script in to clean these
files up *before* the rpm gets built from them, but after
brp-python-bytecompile runs?
thanks,
<mike
I'm trying to build an rpm from a python application for a client to
run on both RHEL4 and RHEL5.
rpmbuild has the rather nasty habit of runing
/usr/lib/rpm/brp-python-byteompile, which goes through all the files
to be installed by the rpm, and compiling any .py files it finds into
.pyo files.
The first problem is that, while the resulting rpm claims to be
noarch, I can't find anything from the Python folks promising that
.pyo (and .pyc) files are architecture-dependent, so this would seem
to be an error even in the general case, but that's not really my
problem.
My issues is that the resulting .pyo are just so much wasted space.
They don't work on one of the two platforms we're going to deploy to,
because the two pythons are different (2.3 vs. 2.4), and use different
versions of the byte code.
That this all happens after the install scripts run means I can't use
the rpm build process to clean up after it. The best I've been able to
do is use a post-install script to delete the garbage files it
installs - which means the rpm carries them around, we install them,
and then delete them, which is just ugly, and seems error-prone as
well.
Ideally, there's a knob somewhere I can twist to disable
brp-python-bytecompile at rpm build time, and I can then fix the
install scripts to byte-compile the things I need.
Failing that, is there someplace I can hook a script in to clean these
files up *before* the rpm gets built from them, but after
brp-python-bytecompile runs?
thanks,
<mike
--
Mike Meyer <***@mired.org> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
Mike Meyer <***@mired.org> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.