File deltarpm.spec of Package deltarpm

# spec file for package deltarpm
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           deltarpm
Version:        3.5.git
Release:        0
Summary:        Tools to Create and Apply deltarpms
License:        BSD-3-Clause
Group:          System/Packages
Source:         deltarpm-3.5.git.tar.bz2
Patch0:         patch.sles8
BuildRequires:  libbz2-devel
BuildRequires:  python-devel
BuildRequires:  rpm-devel
BuildRequires:  xz-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# we need to build against recent rpm, so avoid the new payload
%define _binary_payload w9.bzdio

This package contains tools to create and apply deltarpms. A deltarpm
contains the difference between an old and a new version of an RPM,
which makes it possible to recreate the new RPM from the deltarpm and
the old one. You do not need to have a copy of the old RPM, because
deltarpms can also work with installed RPMs.

%package -n python-deltarpm
Summary:        Tools to Create and Apply deltarpms
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%description -n python-deltarpm
Python bindings for deltarpm

%setup -q
%if 0%{?suse_version} < 900

make CC="gcc" CFLAGS="%{optflags}" rpmdumpheader="/usr/lib/rpm/rpmdumpheader" %{?_smp_mflags}
make CC="gcc" CFLAGS="%{optflags}" rpmdumpheader="/usr/lib/rpm/rpmdumpheader" %{?_smp_mflags} python

mkdir -p %{buildroot}%{_prefix}/lib/rpm
make DESTDIR=%{buildroot} prefix="%{_prefix}" libdir="%{_libdir}" mandir="%{_mandir}" rpmdumpheader="/usr/lib/rpm/rpmdumpheader" install
rm -rf %{buildroot}%{_libdir}/python/site-packages/{,} # Remove wrongly installed Python module
mv %{buildroot}%{python_sitearch}/_deltarpm{module,}.so # Fix binary Python module name


%files -n python-deltarpm