%define real_name rpm %define python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") Summary: Python bindings for apps which will manipulate RPM packages. Name: rpm-python Version: 3.0.5 Release: 1 Group: Development/Libraries Source0: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/%{real_name}-%{version}.tar.gz Source1: %{name}-%{version}-Makefile Patch0: %{name}-%{version}-aix.patch Copyright: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: python-devel >= 2.6.2 BuildRequires: rpm-devel = %{version} Requires: python >= 2.6.2 %description The rpm-python package contains a module which permits applications written in the Python programming language to use the interface supplied by RPM (RPM Package Manager) libraries. This package should be installed if you want to develop Python programs that will manipulate RPM packages and databases. %prep %setup -q -n %{real_name}-%{version} %patch0 cp %{SOURCE1} python/Makefile %build cd python make %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{python_sitearch}/rpm cp python/rpmmodule.so ${RPM_BUILD_ROOT}%{python_sitearch}/rpm/ chmod 0755 ${RPM_BUILD_ROOT}%{python_sitearch}/rpm/rpmmodule.so %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %{python_sitearch}/rpm/rpmmodule.so %changelog * Fri Nov 11 2011 Michael Perzl - 3.0.5-1 - first version for AIX V5.1 and higher