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 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
#SLES11 specific patch. Revent back default behavior to use sha1 as default checksum type.
Patch6:         createrepo-0.9.9-keep_sha1_default.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
#SLES11 specific patch. Revent back default behavior to not generate database files and use simple filenames. Can be changed via cmd line
Patch10:        createrepo-0.9.9-by_default_no_database.patch
# Pass checksum option to workers, taken from upstream. See BNC#802001
Patch11:        createrepo-0.9.9-pass_checksum_to_workers.patch
# SLES11 specific patch. Allows us to keep createrepo noarch even on old pythong without correct sitelib
Patch12:        createrepo-0.9.9-noarch.patch
# Upstream patch to clean up tmp files (BNC#812071)
Patch13:        createrepo-0.9.9-clean_tmp_files.patch
Patch14:        createrepo-0.9.9-worker-clog_limit.patch
# Upstream patch to write timestamps in seconds (BNC#823652)
Patch15:        createrepo-0.9.9-use_integer_timestamps.patch
Patch16:        createrepo-0.9.9-fix_unique_filenames.patch
Patch17:        createrepo-0.9.9-modifyrepo.patch
Patch18:        createrepo-0.9.9-splitworkers.patch
BuildRequires:  python-devel
Requires:       python-deltarpm
%if 0%{?suse_version} >= 1220
Requires:       python-libxml2
%else
Requires:       libxml2-python
%endif
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
BuildArch:      noarch

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

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

%build

%install
# Change install path to be still noarch package on SLE11
sed -i -e 's|PKGDIR = $(PYLIBDIR)/site-packages/$(PKGNAME)|PKGDIR = %{_datadir}/%{name}/$(PKGNAME)|g' createrepo/Makefile
%makeinstall sysconfdir=%{_sysconfdir}

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

%changelog
openSUSE Build Service is sponsored by