#1141 closed enhancement (fixed)
setup.py does not produce valid rpm on Fedora core 3
Reported by: | Owned by: | daniel | |
---|---|---|---|
Priority: | normal | Milestone: | 0.9 |
Component: | project | Version: | 0.8 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
setup.py bdist_rpm
when run on Fedora (FC3 - looks like this will apply to other versions too) does not produce an rpm due to problems in the generated spec file.
Man Page Filenames
The specific problem is that Fedora (and RH distributions in general) compress man pages as part of an automatically run rpm script (this could be turned off but would make the generated rpm rather out of step with others on the system).
I currently fix this up in a hack by changing the %install and %files section to this:-
%install rm -rf %{buildroot} python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES # fix up file list slightly... # basically man page fixup sed -e 's/\.[0-9]$/&\*/' <INSTALLED_FILES >INSTALLED_FILES2 %files -f INSTALLED_FILES2 %defattr(-,root,root)
The references to INSTALLED_FILES2
are the changes - which wildcard the lines refering to the man pages ie /usr/share/man/man1/tracd.1
→ /usr/share/man/man1/tracd.1*
Dependancies
The following dependancies should be added:-
BuildRequires: python >= 2.1 BuildRequires: python-devel BuildRequires: PyXML BuildRequires: python-sqlite BuildRequires: python-clearsilver BuildRequires: subversion Requires: PyXML Requires: python-sqlite Requires: python-clearsilver Requires: subversion
This full set should allow the package to be built within a specific build environment - for example mach.
Contrib
The contrib scripts should be packaged within the rpm - I would suggest they should be bundled into /usr/share/trac/contrib
This would allow nice neat handling of subversion hook scripts without having to go round these manually.
NB This applies to the Suse rpm stuff as well.
Attachments (1)
Change History (7)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
Here's a new patch for trunk. I've tested it on fc3, suse90 and suse91.
Index: setup.py =================================================================== --- setup.py (Revision 1342) +++ setup.py (Arbeitskopie) @@ -158,6 +158,7 @@ self.packager = "Edgewall Software <info@edgewall.com>" for x in rpm_distros[self.distro].keys(): setattr(self, x, rpm_distros[self.distro][x]) + self.install_script = "rpm-install.sh" def run(self): bdist_rpm.run(self) Index: MANIFEST.in =================================================================== --- MANIFEST.in (Revision 1342) +++ MANIFEST.in (Arbeitskopie) @@ -1,4 +1,4 @@ -include AUTHORS ChangeLog COPYING INSTALL MANIFEST.in README README.tracd RELEASE setup.cfg THANKS UPGRADE +include AUTHORS ChangeLog COPYING INSTALL MANIFEST.in README README.tracd RELEASE setup.cfg THANKS UPGRADE rpm-install.sh include scripts/trac-admin include scripts/tracd include scripts/tracdb2env Index: rpm-install.sh =================================================================== --- rpm-install.sh (Revision 0) +++ rpm-install.sh (Revision 0) @@ -0,0 +1,16 @@ +#! /bin/sh +# +# this file is *inserted* into the %install section of the generated +# spec file +# + +# this is, what dist.py normally does +./setup.py install --root=${RPM_BUILD_ROOT} --record="INSTALLED_FILES" + +# catch compressed man pages +sed -i -e 's@\(.\+/man/man[[:digit:]]/.\+\.[[:digit:]]\)$@\1*@' "INSTALLED_FILES" + +# catch any compiled python files (.pyc, .pyo), but don't list them twice +sed -i -e 's@\(.\+\)\.py$@\1.py*@' \ + -e '/.\+\.pyc$/d' \ + "INSTALLED_FILES"
comment:3 by , 19 years ago
Milestone: | → 0.9 |
---|
Setting Milestone from none to 0.9.
The patch above is almost identical to the earlier ones, but additionally adds scripts/trac-postinstall.py to MANIFEST.in. The postinstall script is needed for Windows only, but when it's missing in the manifest, bdist_rpm fails early.
comment:5 by , 19 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
python setup.py bdist_rpm dies with:
building RPMs error: line 37: second %install error: query of specfile build/bdist.linux-i686/rpm/SPECS/trac.spec failed, can't parse error: Failed to execute: "rpm -q --qf '%{name}-%{version}-%{release}.src.rpm %{arch}/%{name}-%{version}-%{release}.%{arch}.rpm\\n' --specfile 'build/bdist.linux-i686/rpm/SPECS/trac.spec'"
on FC3 and FC4 here (but works on FC2).
The following allows the rpms to be built:
--- scripts/rpm-install.sh (revision 2100) +++ scripts/rpm-install.sh (working copy) @@ -1,6 +1,6 @@ #! /bin/sh # -# this file is *inserted* into the %install section of the generated +# this file is *inserted* into the install section of the generated # spec file #
It looks like the problem lies with rpm itself, it shouldn't be trying to parse %install inside a comment.
comment:6 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I've removed the "%install" occurance from rpm-install.sh. I'm unable to test this myself so please reopen if it's still broken.
Here's a patch to fix the problem with compressed manpages (tested on SuSE 9.0):
The basic idea is grabbed from a comment to Python bug 644744.