classification
Title: bdist_rpm fails when installing man pages
Type: behavior Stage:
Components: Distutils Versions: Python 3.2, Python 3.1, Python 2.7, Python 2.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: a.badger, akitada, calvin, jjulian, tarek, thomasvs (6)
Priority: normal Keywords patch

Created on 2002-11-27 14:30 by calvin, last changed 2010-01-09 03:24 by jjulian.

Files
File name Uploaded Description Edit Remove
rpm_patch_for_setup_py calvin, 2002-11-27 14:30 patch for setup.py to enable man pages with bdist_rpm
install-rpm.sh calvin, 2004-09-10 12:10
distutils.bdist_rpm.patch thomasvs, 2009-11-23 09:42
Messages (9)
msg13472 - (view) Author: Bastian Kleineidam (calvin) Date: 2002-11-27 14:30
When a man page is in data_files, the rpm installer
compresses it with gzip (done by the brp-compress
script). I attached a little hack for
install_data command to add a ".gz" to such man pages.
Then it works for me.

Of course, the proper fix would be to detect if
brp-compress is run and what files were compressed by
the script. But I am not an rpm guru, so its up to you
how you want to fix it.

I am using a Debian Linux unstable boxen with Python
2.2.2-2, and rpm 4.0.4-11
msg13473 - (view) Author: Bastian Kleineidam (calvin) Date: 2004-09-10 12:10
Logged In: YES 
user_id=9205

Finally I got around to investigate this a little more. What
essentially happens is this:
1) bdist_rpm generates a .spec file with the following
install command:
python setup.py install --root=$RPM_BUILD_ROOT
--record=INSTALLED_FILES
.. and the following files section
%files -f INSTALLED_FILES

2) if the setup.py installed any man pages, then after
%install and before %files rpm runs brp-compress (usually
found in /usr/lib/rpm/brp-compress) which compresses all man
pages with gzip.

3) Now the man pages have a '.gz' suffix, but the
INSTALLED_FILES file lists them still without the suffix.
The %files section of the rpm .spec file will fail.

The solution in my case was to use a custom rpm-install
script configured with setup.cfg:
[bdist_rpm]
install_script = install-rpm.sh
The install-rpm.sh file is attached.

The solution is not very generic - brp-compress compresses a
lot more files than the install-rpm.sh detects. But at least
there should be a documentation somewhere about the
brp-compress pitfall.
msg81561 - (view) Author: Akira Kitada (akitada) Date: 2009-02-10 16:49
Duplicate of issue1169193
msg95616 - (view) Author: Thomas Vander Stichele (thomasvs) Date: 2009-11-23 09:42
Attaching a reworked patch of the patch attached in
http://bugs.python.org/issue1169193

This worked for me on f-11, with python 2.6
msg95619 - (view) Author: Tarek Ziadé (tarek) Date: 2009-11-23 11:53
I'd rather see sed called from within Distutils. But I am not sure how
to handle it after install has been called.

Do you know if sed is *always* present on a fresh Fedora ?

(I am nosying Toshio as well)
msg95643 - (view) Author: Toshio Kuratomi (a.badger) Date: 2009-11-23 18:42
sed is one of the programs we assume is always present when we build
packages in Fedora which is probably also what is wanted here.  (A
default install of Fedora will include sed but someone might be able to
create a minimal install that did not include it.) Note that within
Fedora we usually use a wildcard with man pages.  For example::

  %{_mandir}/man1/foo.1*

I'd suggest doing this rather than hardcoding ".gz".  Automatic
compression of manpages could be disabled on other distros, set to
bzip2, compress, or xz instead.  Wildcarding the suffix will catch all
of these cases and be more future-proof.
msg95648 - (view) Author: Thomas Vander Stichele (thomasvs) Date: 2009-11-23 19:25
Hi Toshio,

I'd probably also go for the wildcarding, but you'd still need to
'change' the INSTALLED_FILES file to do so, so you'd still use the same
mechanism.
msg95654 - (view) Author: Toshio Kuratomi (a.badger) Date: 2009-11-23 20:12
Agreed.  The substitution is still needed.
msg95795 - (view) Author: Thomas Vander Stichele (thomasvs) Date: 2009-11-28 17:01
Ok, so this patch can go in as is except for changing .gz to * ?
History
Date User Action Args
2010-01-09 03:24:00jjuliansetnosy: + jjulian
2009-11-28 17:01:33thomasvssetmessages: + msg95795
2009-11-23 20:12:16a.badgersetmessages: + msg95654
2009-11-23 19:25:43thomasvssetmessages: + msg95648
2009-11-23 18:42:32a.badgersetmessages: + msg95643
2009-11-23 11:53:40tareksetnosy: + a.badger
versions: + Python 2.6, Python 3.1, Python 2.7, Python 3.2
messages: + msg95619

assignee: tarek
type: behavior
2009-11-23 09:42:42thomasvssetfiles: + distutils.bdist_rpm.patch

nosy: + thomasvs
messages: + msg95616

keywords: + patch
2009-04-05 18:41:36georg.brandllinkissue1169193 superseder
2009-02-10 16:49:13akitadasetnosy: + akitada, tarek
messages: + msg81561
2002-11-27 14:30:55calvincreate