Building Tx RPMs

Spent a good part of the day working on building RPMs for Tx. It was not so hard but until I got the gist of the process it took me some time.

At the end of the day it’s quite simple actually. Step 1 is to setup an RPM dev environment …


$ rpmdev-setuptree

… step 2 is to set things up in the ~rpmbuild directory:


$ ls -1
BUILD
BUILDROOT
RPMS
SOURCES
SPECS
SRPMS
transifex.spec
$ ls -1 SOURCES/
transifex-0.3.2.tar.gz
$ cat transifex.spec
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}


Name: transifex
Version: 0.3.2
Release: 1%{?dist}
Summary: A system for distributed translation submissions

Group: Applications/Internet
License: GPLv2
URL: http://transifex.org/
Source0: transifex-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch

BuildRequires: python-setuptools Django
Requires: Django python-pygments mercurial patch logrotate

%description
Transifex is a web-system that facilitates the process of submitting
translations in remote and disparate version control systems (VCS).

%prep
%setup -q

%build

%install
rm -rf $RPM_BUILD_ROOT
# make install DESTDIR=$RPM_BUILD_ROOT
#make DESTDIR=$RPM_BUILD_ROOT install
# std place fedora-infrastructure deployes tg code
mkdir -p $RPM_BUILD_ROOT/%{python_sitelib}
find * | cpio -p -dum $RPM_BUILD_ROOT/%{python_sitelib}/%{name}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
/%{python_sitelib}/%{name}/*

%changelog

… step 3 is to build the RPMs …


$rpmbuild -ba transifex.spec

… ??? …
… profit 🙂


$ sudo rpm -Uvh /home/mperedim/rpmbuild/RPMS/noarch/transifex-0.3.2-1.fc10.noarch.rpm

Advertisements

2 Responses to “Building Tx RPMs”

  1. Markos Fragkakis Says:

    We need a deb too!

  2. mperedim Says:

    You’ll probably have to wait a little 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: