How to role a trac rpm

4 views
Skip to first unread message

Christopher Taylor

unread,
Apr 27, 2007, 3:27:05 PM4/27/07
to trac...@googlegroups.com
Hello all,

I'd like to roll an rpm for track with a few patches preinstalled.
Any chance ya'll can point me in the direction of how to do that?

I know how to do it with C code and make files ... make rpm .... but
how do I do it with trac ?

Respectfully,
Christopher Taylor

Christopher Taylor

unread,
Apr 27, 2007, 3:54:58 PM4/27/07
to trac...@googlegroups.com
ok ... maybe I should be a little more specific ...

I've figured out how to do "python setup.py bdist_rpm" but the problem
is that I can't get the dependencies to show up to yum:
yum deplist <my_custom_rpm| usual fc trac rpm>
doesn't give me the listing of dependencies that I would expect
i've also tried resolvedep

I tried this both on my own rpm and the one from fc extras ... neither
gave the information I would expect.

I also tried to do a yum localinstall <my_custom_rpm> which should
have gone and retrieved the needed dependencies ... it didn't :(

any help would be appreicated!

Respectfully,
Christopher Taylor

Karl Katzke

unread,
Apr 27, 2007, 3:55:49 PM4/27/07
to trac...@googlegroups.com
Chris, first thing might be to take a look at how Dag Weeirs did his.
His spec files and built versions are available here:

http://dag.wieers.com/rpm/packages/trac/

-Karl

On 4/27/07, Christopher Taylor <chta...@gmail.com> wrote:
>

Christopher Taylor

unread,
Apr 27, 2007, 4:28:35 PM4/27/07
to trac...@googlegroups.com
Karl,

Yes, I edited the spec file and the patches were applied correctly.
The default spec file that comes with the .src.rpm that I was using
has all the proper dependencies listed (please see at the bottom of
this post for the complete spec file):

BuildRequires: sed >= 3.95
BuildRequires: python-devel
Requires: python-clearsilver >= 0.9.3
Requires: subversion >= 1.1
Requires: httpd
Requires: python-sqlite


I executed the following command and everything seemed normal
[user@localhost SPECS] $ rpmbuild -bp trac.spec

When I build the rpm it appears to be taking the requires into consideration:
[user@localhost trac-0.10.3.1] $ python setup.py bdist_rpm

Processing files: trac-0.10.3.1-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /usr/bin/python clearsilver >= 0.9.3 httpd pysqlite >= 0.4.3
python >= 2.3 python(abi) = 2.4 subversion >= 1.0.0
Checking for unpackaged file(s): /usr/lib/rpm/check-files
/var/tmp/trac-0.10.3.1-1-buildroot
Wrote: /home/vrcngtrx/workspace/rpmbuild/BUILD/trac-0.10.3.1/build/bdist.linux-i686/rpm/SRPMS/trac-0.10.3.1-1.src.rpm
Wrote: /home/vrcngtrx/workspace/rpmbuild/BUILD/trac-0.10.3.1/build/bdist.linux-i686/rpm/RPMS/noarch/trac-0.10.3.1-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.11822
+ umask 022
+ cd /home/vrcngtrx/workspace/rpmbuild/BUILD/trac-0.10.3.1/build/bdist.linux-i686/rpm/BUILD
+ cd trac-0.10.3.1
+ rm -rf /var/tmp/trac-0.10.3.1-1-buildroot
+ exit 0
Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.11822
+ umask 022
+ cd /home/vrcngtrx/workspace/rpmbuild/BUILD/trac-0.10.3.1/build/bdist.linux-i686/rpm/BUILD
+ rm -rf trac-0.10.3.1
+ exit 0
moving build/bdist.linux-i686/rpm/SRPMS/trac-0.10.3.1-1.src.rpm -> dist
moving build/bdist.linux-i686/rpm/RPMS/noarch/trac-0.10.3.1-1.noarch.rpm -> dist

then the confusing part:
[user@localhost trac-0.10.3.1] $ cd dist
[user@localhost dist] $ rpm -qR -p trac-0.10.3.1-1fc.noarch.rpm
/usr/bin/python
python(abi) = 2.4
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1

I'm expecting to see:
/usr/bin/python
config(trac) = 0.10.3.1-2.fc5
httpd
python(abi) = 2.4
python-clearsilver >= 0.9.3
python-sqlite
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
subversion >= 1.1


I'm not sure if my problem is in building the rpm or in applying the spec file

Thank you for any assistance you can provide,
Christopher Taylor

trac.spec:
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from
distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name: trac
Version: 0.10.3.1
Release: 2%{?dist}
Summary: Enhanced wiki and issue tracking system
Group: Applications/Internet
License: BSD
URL: http://trac.edgewall.com/
Source0: http://ftp.edgewall.com/pub/trac/%{name}-%{version}.tar.gz
Source1: trac.conf
#CMT 27APR07 added time tracking patch
Patch01: trac-time-tracking-0.10.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: sed >= 3.95
BuildRequires: python-devel
Requires: python-clearsilver >= 0.9.3
Requires: subversion >= 1.1
Requires: httpd
Requires: python-sqlite

%description
Trac is an integrated system for managing software projects, an
enhanced wiki, a flexible web-based issue tracker, and an interface to
the Subversion revision control system. At the core of Trac lies an
integrated wiki and issue/bug database. Using wiki markup, all objects
managed by Trac can directly link to other issues/bug reports, code
changesets, documentation and files. Around the core lies other
modules, providing additional features and tools to make software
development more streamlined and effective.

%prep
%setup -q
chmod -x contrib/*
sed -i -e 's|/var/svn/test|/srv/svn|' trac/scripts/admin.py
chmod -x htdocs/js/wikitoolbar.js
sed -i -e 's/tracd 1/tracd 8/' scripts/tracd.1
rm trac/test.py
#CMT 17APR07 apply the patch
%patch01 -p0

%build
%{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT

# --skip-build causes bad stuff in siteconfig.py as of 0.8.4
%{__python} setup.py install -O1 --root $RPM_BUILD_ROOT

install -dm 755 $RPM_BUILD_ROOT%{_var}/www/cgi-bin
mv $RPM_BUILD_ROOT%{_datadir}/trac/cgi-bin/trac.*cgi \
$RPM_BUILD_ROOT%{_var}/www/cgi-bin
rm -r $RPM_BUILD_ROOT%{_datadir}/trac/cgi-bin

install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/conf.d/trac.conf
install -dm 755 $RPM_BUILD_ROOT%{_sbindir}
mv $RPM_BUILD_ROOT{%{_bindir}/tracd,%{_sbindir}/tracd}
install -dm 755 $RPM_BUILD_ROOT%{_mandir}/man8
mv $RPM_BUILD_ROOT%{_mandir}/{man1/tracd.1,man8/tracd.8}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING INSTALL README* RELEASE THANKS UPGRADE contrib/
%{_bindir}/trac-admin
%{_sbindir}/tracd
%dir %{python_sitelib}/trac/
%{python_sitelib}/trac/*.py
%{python_sitelib}/trac/*.pyc
%{python_sitelib}/trac/*.pyo
%dir %{python_sitelib}/trac/mimeview/
%{python_sitelib}/trac/mimeview/*.py
%{python_sitelib}/trac/mimeview/*.pyc
%{python_sitelib}/trac/mimeview/*.pyo
%dir %{python_sitelib}/trac/scripts/
%{python_sitelib}/trac/scripts/*.py
%{python_sitelib}/trac/scripts/*.pyc
%{python_sitelib}/trac/scripts/*.pyo
%dir %{python_sitelib}/trac/ticket/
%{python_sitelib}/trac/ticket/*.py
%{python_sitelib}/trac/ticket/*.pyc
%{python_sitelib}/trac/ticket/*.pyo
%dir %{python_sitelib}/trac/upgrades/
%{python_sitelib}/trac/upgrades/*.py
%{python_sitelib}/trac/upgrades/*.pyc
%{python_sitelib}/trac/upgrades/*.pyo
%dir %{python_sitelib}/trac/versioncontrol/
%{python_sitelib}/trac/versioncontrol/*.py
%{python_sitelib}/trac/versioncontrol/*.pyc
%{python_sitelib}/trac/versioncontrol/*.pyo
%dir %{python_sitelib}/trac/versioncontrol/web_ui/
%{python_sitelib}/trac/versioncontrol/web_ui/*.py
%{python_sitelib}/trac/versioncontrol/web_ui/*.pyc
%{python_sitelib}/trac/versioncontrol/web_ui/*.pyo
%dir %{python_sitelib}/trac/web/
%{python_sitelib}/trac/web/*.py
%{python_sitelib}/trac/web/*.pyc
%{python_sitelib}/trac/web/*.pyo
%dir %{python_sitelib}/trac/wiki/
%{python_sitelib}/trac/wiki/*.py
%{python_sitelib}/trac/wiki/*.pyc
%{python_sitelib}/trac/wiki/*.pyo
%dir %{python_sitelib}/trac/db
%{python_sitelib}/trac/db/*.py
%{python_sitelib}/trac/db/*.pyc
%{python_sitelib}/trac/db/*.pyo
%dir %{python_sitelib}/trac/util
%{python_sitelib}/trac/util/*.py
%{python_sitelib}/trac/util/*.pyc
%{python_sitelib}/trac/util/*.pyo

%config(noreplace) /etc/httpd/conf.d/trac.conf
%{_datadir}/trac/
%{_var}/www/cgi-bin/trac.cgi
%{_var}/www/cgi-bin/trac.fcgi
%{_mandir}/man1/trac-admin.1*
%{_mandir}/man8/tracd.8*

Karl Katzke

unread,
Apr 27, 2007, 4:44:10 PM4/27/07
to trac...@googlegroups.com
Chris, sorry, you've exhausted the limits of my knowledge about
packaging stuff up. I can make it works when it works right, but when
it doesn't...

And -- if Dag reads this, apologies for misspelling Wieers...!

-Karl

On 4/27/07, Christopher Taylor <chta...@gmail.com> wrote:
>

Christopher Taylor

unread,
Apr 27, 2007, 5:02:39 PM4/27/07
to trac...@googlegroups.com
Ahhhh ... found it .....

it's lines 156 to line 166 of setup.py:

rpm_distros = {
'suse_options': { 'version_suffix': 'SuSE',
'requires': """python >= 2.3
subversion >= 1.0.0
pysqlite >= 0.4.3
clearsilver >= 0.9.3
httpd""" },

'fedora_options': { 'version_suffix': 'fc'}
}

I'm not sure how this all works ... but shouldn't these be taken from
the .spec file and not overwritten by the setup.py ? In any event ...
I think the dependencies need to be listed for the fedora_options as
well .... or is there a reason for them not being in there?

Respectfully,
Christopher Taylor

Reply all
Reply to author
Forward
0 new messages