File createrepo.spec of Package createrepo

#
# spec file for package createrepo
#
# 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 http://bugs.opensuse.org/
#

Name:           createrepo
Version:        0.9.9
Release:        0
Summary:        Creates a Common Metadata Repository
License:        GPL-2.0+
Group:          System/Packages
Url:            http://linux.duke.edu/metadata/
Source:         http://createrepo.baseurl.org/download/%{name}-%{version}.tar.gz
Patch2:         createrepo-0.9.9-cache_utime.patch
Patch3:         createrepo-0.9.9-cachefix.patch
Patch4:         createrepo-0.9.9-license-to-confirm.patch
Patch5:         createrepo-0.9.9-sort-packages-before-writing-repodata.patch
Patch6:         createrepo-0.9.9-add-lzma-option-to-generate-primary.xml.lzma.patch
Patch7:         createrepo-0.9.9-generate-gzip-headers.patch
Patch8:         createrepo-0.9.9-disable-symlinks.patch
Patch9:         createrepo-0.9.8-workaround-umask-reset.patch
BuildRequires:  python-devel
Requires:       python-deltarpm
Requires:       python-lxml
Requires:       python-urlgrabber
Requires:       rpm >= 4.1.1
Requires:       rpm-python
Requires:       yum-common >= 3.2.25
Requires:       yum-metadata-parser
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif

%description
This utility generates a common metadata repository from a directory of
RPM packages.

%prep
%setup -q
%patch2
%patch3
%patch4
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9
sed -i "1d" createrepo/{readMetadata,yumbased,utils,deltarpms,merge}.py # Fix non-executable scripts (remove she-bang line)

%build
%install
# Fix the install paths:
sed -i -e 's|PYLIBDIR = $(PYSYSDIR)/lib/python$(PYVER)|PYLIBDIR = %{py_libdir}|g' \
       -e 's|PKGDIR = $(PYLIBDIR)/site-packages/$(PKGNAME)|PKGDIR = %{python_sitearch}/%{name}|g' createrepo/Makefile
%make_install sysconfdir=%{_sysconfdir}

%files
%defattr(-,root,root)
%doc ChangeLog COPYING COPYING.lib README
%{_bindir}/*
%{_mandir}/*/*
%config %{_sysconfdir}/bash_completion.d/createrepo.bash
%{_datadir}/%{name}/
%{python_sitearch}/*

%changelog