File createrepo.spec of Package createrepo

# spec file for package createrepo
# Copyright (c) 2014 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:           createrepo
Version:        0.10.3
Release:        0
Summary:        Creates a Common Metadata Repository
License:        GPL-2.0+
Group:          System/Packages
Patch1:         createrepo-0.9.9-cache_utime.patch
Patch2:         createrepo-0.9.9-cachefix.patch
Patch3:         createrepo-0.9.9-license-to-confirm.patch
Patch4:         createrepo-0.9.9-sort-packages-before-writing-repodata.patch
Patch5:         createrepo-0.9.9-disable-symlinks.patch
Patch6:         createrepo-0.9.9-by_default_no_database.patch
Patch7:         createrepo-0.10.3-modifyrepo-sha.patch
Patch8:         createrepo-0.10.3-fix_MetaDataGenerator.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

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

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


# Fix the install paths:
sed -i -e 's|PYLIBDIR = $(PYSYSDIR)/lib/python$(PYVER)|PYLIBDIR = %{py_libdir}|g' \
%if %{suse_version} < 1120
       -e 's|PKGDIR = $(PYLIBDIR)/site-packages/$(PKGNAME)|PKGDIR = %{_datadir}/%{name}/$(PKGNAME)|g' \
       -e 's|PKGDIR = $(PYLIBDIR)/site-packages/$(PKGNAME)|PKGDIR = %{python_sitearch}/%{name}|g' \
%makeinstall sysconfdir=%{_sysconfdir}
mv $RPM_BUILD_ROOT/%{_sysconfdir}/bash_completion.d/createrepo $RPM_BUILD_ROOT/%{_sysconfdir}/bash_completion.d/
for i in mergerepo modifyrepo ; do rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/bash_completion.d/$i ; done

%config %{_sysconfdir}/bash_completion.d/
%if %{suse_version} >= 1120

openSUSE Build Service is sponsored by