File createrepo.spec of Package createrepo

#
# spec file for package createrepo
#
# Copyright (c) 2011 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/
#

# norootforbuild


Name:           createrepo
BuildRequires:  python
Version:        0.9.8
Release:        9
License:        GPLv2+
Summary:        Creates a Common Metadata Repository
Group:          System/Packages
Source:         %{name}-%{version}.tar.bz2
Source1:        createrepo-rpmlintrc
Patch0:         createrepo-0.9.8-disable-deltarpm-1.patch
Patch1:         createrepo-0.9.8-disable-deltarpm-2.patch
Patch2:         createrepo-0.9.8-cache_utime.patch
Patch3:         createrepo-0.9.8-cachefix.patch
Patch4:         createrepo-0.9.8-license-to-confirm.patch
Patch5:         createrepo-0.9.8-sort-packages-before-writing-repodata.patch
Patch6:         createrepo-0.9.8-add-lzma-option-to-generate-primary.xml.lzma.patch
Patch7:         createrepo-0.9.8-generate-gzip-headers.patch
Patch8:         createrepo-0.9.8-disable-symlinks.patch
Patch9:         createrepo-0.9.8-workaround-umask-reset.patch
Url:            http://linux.duke.edu/metadata/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#BuildArch:      noarch
Requires:       yum-common >= 3.2.25
Requires:       rpm >= 4.1.1
Requires:       rpm-python
Requires:       libxml2-python
Requires:       python-urlgrabber
Requires:       python-lxml
%if %{suse_version} > 910
Requires:       yum-metadata-parser
%endif
%py_requires

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



Authors:
--------
    Seth Vidal <skvidal@phy.duke.edu>

%prep
%setup -q
%patch0
%patch1
%patch2
%patch3
%patch4
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8
%patch9

%build

%install

# fix the install paths
cp createrepo/Makefile createrepo/Makefile.old
sed -e 's,PYLIBDIR = $(PYSYSDIR)/lib/python$(PYVER),PYLIBDIR = %{py_libdir},g' createrepo/Makefile.old > createrepo/Makefile
cp createrepo/Makefile createrepo/Makefile.old
sed -e 's,PKGDIR = $(PYLIBDIR)/site-packages/$(PKGNAME),PKGDIR = %{py_sitedir}/%{name},g' createrepo/Makefile.old > createrepo/Makefile
rm createrepo/Makefile.old

%if %{suse_version} <= 1010
sed -e "s,rpm.RPMTAG_ENHANCESNAME,1159," \
    -e "s,rpm.RPMTAG_ENHANCESFLAGS,1161," \
    -e "s,rpm.RPMTAG_ENHANCESVERSION,1160," \
    -e "s,rpm.RPMTAG_SUGGESTSNAME,1156," \
    -e "s,rpm.RPMTAG_SUGGESTSFLAGS,1158," \
    -e "s,rpm.RPMTAG_SUGGESTSVERSION,1157," \
    -e "s,rpm.RPMSENSE_STRONG,0x8000000," \
    dumpMetadata.py > dumpMetadata.py.patched
mv dumpMetadata.py.patched dumpMetadata.py
%endif
make install DESTDIR=$RPM_BUILD_ROOT sysconfdir=/etc

%clean
rm -rf $RPM_BUILD_ROOT

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

%changelog
openSUSE Build Service is sponsored by