2010-10-11

Simple Twisted RPM Spec File

I needed to build twisted for RHEL5 (Really, centos5, but who cares, they’re the same thing with different lawyers).
This is a really simple spec file that lets me build the dratted thing with a minimum of fuss. Twisted tarball is the one from http://twistedmatrix.com/trac/wiki/Downloads.
%define name python-twisted
%define version 10.1.0
%define release 1
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Summary: Event-based framework for internet applications
Name: %{name}
Version: %{version}
Release: %{release}
Source0: Twisted-%{version}.tar.bz2
License: MIT
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: i386
Vendor: Your Name
Url: http://twistedmatrix.com/
BuildRequires: python-devel
Requires: python
Requires: python-zope-interface
Obsoletes: python-twisted-core
%description
See summary.
%prep
%setup -q -c
%build
cd Twisted-10.1.0
%{__python} setup.py build
%install
cd Twisted-10.1.0
%{__python} setup.py install --root=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{python_sitelib}/twisted
%{_bindir}

3 comments:

Anonymous said...

Eeeh nice. Update for this that works on Amazon Linux, python2.7, assuming you have the tarball Twisted-12.1.0.tar.bz2.

%define __python /usr/bin/python2.7
%define name python-twisted
%define python_sitelib %{python_sitearch}
%define version 12.1.0
%define release 1
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Summary: Event-based framework for internet applications
Name: %{name}
Version: %{version}
Release: %{release}
Source0: Twisted-%{version}.tar.bz2
License: MIT
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
Vendor: Your Name
Url: http://twistedmatrix.com/
BuildRequires: python-devel
Requires: python27
Requires: python-zope-interface
%description
See summary.
%prep
%setup -q -n Twisted-12.1.0
%build
%{__python} setup.py build
%install
%{__python} setup.py install --root=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{python_sitelib}/twisted
%{python_sitelib}/Twisted-12.1.0-py2.7.egg-info
%{_bindir}

Leo5 said...

Such A Brilent Information Eeeh nice. Update for this that works on Amazon Linux, python2.7, assuming you have the tarball Twisted-12.1.0.tar.bz2.

Layers Manager

Wondermouse Technologies said...

WonderMouse Technology is a Digital marketing company in delhi. We market brands on the web & make sure that you get bang for your buck by SEO, SEM, PPC, SMO, Email Marketing, etc. Internet business is the present and eventual fate of overall exchange. WonderMouse Technology is the pioneer in making Ecommerce a smooth ordeal and top website designing company in Delhi knows it great. The platforms are designed specifically to enhance the consumer panorama of corporate websites. We offer customized and affordable best seo services in india which are designed to the needs, desires and budget of our clients.