2016-07-04 17:02:35 +02:00
|
|
|
#
|
|
|
|
# spec file for package createrepo_c
|
|
|
|
#
|
2019-02-25 13:56:04 +01:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2019-02-25 11:26:48 +01:00
|
|
|
# Copyright (c) 2019 Neal Gompa <ngompa13@gmail.com>.
|
2016-07-04 17:02:35 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-02-25 13:56:04 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-07-04 17:02:35 +02:00
|
|
|
#
|
|
|
|
|
2017-03-02 14:49:48 +01:00
|
|
|
|
2019-02-25 11:26:48 +01:00
|
|
|
# Enable Python and tests selectively
|
2018-02-22 14:45:14 +01:00
|
|
|
%if 0%{?is_opensuse} || 0%{?suse_version} >= 1330
|
2017-03-02 13:43:52 +01:00
|
|
|
%bcond_without python3
|
2018-02-22 14:45:14 +01:00
|
|
|
%bcond_without tests
|
2017-03-02 13:43:52 +01:00
|
|
|
%else
|
2018-02-22 14:45:14 +01:00
|
|
|
%bcond_with tests
|
2017-03-02 13:43:52 +01:00
|
|
|
%bcond_with python3
|
|
|
|
%endif
|
2019-02-25 11:26:48 +01:00
|
|
|
|
2019-02-25 13:56:04 +01:00
|
|
|
%if ( 0%{?sle_version} || 0%{?suse_version} )
|
|
|
|
# Disabled DeltaRPM support for SUSE
|
|
|
|
%bcond_with drpm
|
|
|
|
%else
|
2019-02-25 11:26:48 +01:00
|
|
|
# Enable enhanced DeltaRPM support
|
|
|
|
%bcond_without drpm
|
2019-02-25 13:56:04 +01:00
|
|
|
%endif
|
2019-02-25 11:26:48 +01:00
|
|
|
|
|
|
|
%if (0%{?is_opensuse} && 0%{?sle_version} >= 150100) || 0%{?suse_version} >= 1550
|
|
|
|
%bcond_without zchunk
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%{!?make_build: %global make_build %{__make} %{?_smp_mflags}}
|
|
|
|
|
2016-03-24 10:11:06 +01:00
|
|
|
%define major 0
|
|
|
|
%define libname lib%{name}%{major}
|
|
|
|
%define devname lib%{name}-devel
|
2019-02-25 11:26:48 +01:00
|
|
|
|
2016-03-24 10:11:06 +01:00
|
|
|
Name: createrepo_c
|
2019-02-25 14:37:25 +01:00
|
|
|
Version: 0.12.1
|
2018-02-22 14:45:14 +01:00
|
|
|
Release: 0
|
2016-03-24 10:11:06 +01:00
|
|
|
Summary: Creates a common metadata repository
|
2018-02-22 14:03:44 +01:00
|
|
|
License: GPL-2.0-or-later
|
2016-03-24 10:11:06 +01:00
|
|
|
Group: System/Packages
|
2019-02-25 11:26:48 +01:00
|
|
|
URL: https://github.com/rpm-software-management/createrepo_c
|
|
|
|
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
|
|
|
|
|
|
|
# Backports from upstream
|
|
|
|
Patch0001: 0001-zck_end_chunk-returns-number-of-bytes-written-or-1-f.patch
|
|
|
|
Patch0002: 0002-Add-missing-sentinal.patch
|
|
|
|
Patch0003: 0003-Fix-misc-test.patch
|
|
|
|
|
2018-02-22 14:45:14 +01:00
|
|
|
%if %{with python3}
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
%endif
|
2019-02-25 11:26:48 +01:00
|
|
|
%if 0%{?is_opensuse} || 0%{?suse_version} >= 1330
|
|
|
|
BuildRequires: python-rpm-macros
|
2018-02-22 14:45:14 +01:00
|
|
|
%endif
|
|
|
|
BuildRequires: bash-completion
|
2016-03-24 10:11:06 +01:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: doxygen
|
2016-10-31 14:15:00 +01:00
|
|
|
BuildRequires: fdupes
|
2016-03-24 10:11:06 +01:00
|
|
|
BuildRequires: file-devel
|
|
|
|
BuildRequires: glib2-devel >= 2.22.0
|
2016-07-04 17:02:35 +02:00
|
|
|
BuildRequires: libbz2-devel
|
2016-03-24 10:11:06 +01:00
|
|
|
BuildRequires: libcurl-devel
|
2016-07-04 17:02:35 +02:00
|
|
|
BuildRequires: libexpat-devel
|
2016-03-24 10:11:06 +01:00
|
|
|
BuildRequires: libxml2-devel
|
2016-07-04 17:02:35 +02:00
|
|
|
BuildRequires: lzma-devel
|
2016-03-24 10:11:06 +01:00
|
|
|
BuildRequires: openssl-devel
|
|
|
|
BuildRequires: rpm-devel >= 4.9.0
|
|
|
|
BuildRequires: sqlite3-devel
|
|
|
|
BuildRequires: zlib-devel
|
2019-02-25 11:26:48 +01:00
|
|
|
%if %{with zchunk}
|
|
|
|
BuildRequires: zchunk
|
2019-02-25 13:56:04 +01:00
|
|
|
BuildRequires: zchunk-devel >= 0.9.11
|
2019-02-25 11:26:48 +01:00
|
|
|
%endif
|
|
|
|
Requires: %{libname}%{?_isa} = %{version}-%{release}
|
2018-02-22 14:45:14 +01:00
|
|
|
%if %{with tests}
|
2019-02-25 11:26:48 +01:00
|
|
|
BuildRequires: python3-nose
|
2017-03-02 13:43:52 +01:00
|
|
|
%endif
|
2018-02-22 14:45:14 +01:00
|
|
|
%if 0%{?suse_version} >= 1330
|
|
|
|
BuildRequires: bash-completion-devel
|
2017-03-02 13:43:52 +01:00
|
|
|
%endif
|
|
|
|
%if %{with drpm}
|
|
|
|
BuildRequires: drpm-devel
|
|
|
|
%endif
|
2016-03-24 10:11:06 +01:00
|
|
|
|
|
|
|
Requires: %{libname} = %{version}-%{release}
|
|
|
|
|
2018-02-22 14:03:44 +01:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
|
|
|
|
|
|
|
Provides: createrepo-implementation
|
|
|
|
|
2016-03-24 10:11:06 +01:00
|
|
|
# prevent provides from nonstandard paths:
|
2019-02-25 11:26:48 +01:00
|
|
|
%global __provides_exclude ^(%{python3_sitearch}/.*\\.so)$
|
2016-03-24 10:11:06 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
C implementation of Createrepo.
|
|
|
|
A set of utilities (createrepo_c, mergerepo_c, modifyrepo_c)
|
|
|
|
for generating a common metadata repository from a directory of
|
|
|
|
rpm packages and maintaining it.
|
|
|
|
|
|
|
|
%package -n %{libname}
|
2016-07-04 17:02:35 +02:00
|
|
|
Summary: Library for repodata manipulation
|
2016-03-24 10:11:06 +01:00
|
|
|
# The function to create DeltaRPMs calls /usr/bin/makedeltarpm,
|
|
|
|
# which is part of the 'deltarpm' package
|
2019-02-25 13:56:04 +01:00
|
|
|
Group: System/Libraries
|
2016-07-04 17:02:35 +02:00
|
|
|
Requires: deltarpm
|
2016-03-24 10:11:06 +01:00
|
|
|
|
|
|
|
%description -n %{libname}
|
|
|
|
Libraries for applications using the createrepo_c library
|
|
|
|
for easy manipulation with a repodata.
|
|
|
|
|
|
|
|
%package -n %{devname}
|
2016-07-04 17:02:35 +02:00
|
|
|
Summary: Library for repodata manipulation
|
|
|
|
Group: Development/Libraries/C and C++
|
2019-02-25 11:26:48 +01:00
|
|
|
Requires: %{libname}%{?_isa} = %{version}-%{release}
|
2018-02-22 14:45:14 +01:00
|
|
|
Requires: pkgconfig
|
|
|
|
Provides: %{name}-devel = %{version}-%{release}
|
2016-03-24 10:11:06 +01:00
|
|
|
|
|
|
|
%description -n %{devname}
|
|
|
|
This package contains the createrepo_c C library and header files.
|
|
|
|
These development files are for easy manipulation with a repodata.
|
|
|
|
|
2017-03-02 13:43:52 +01:00
|
|
|
%package -n python3-%{name}
|
2017-03-02 14:49:48 +01:00
|
|
|
Summary: Python 3 bindings for the createrepo_c library
|
|
|
|
Group: Development/Libraries/Python
|
2019-02-25 11:26:48 +01:00
|
|
|
Requires: %{libname}%{?_isa} = %{version}-%{release}
|
|
|
|
# Python 2 subpackage is fully dropped
|
|
|
|
Obsoletes: python2-%{name} < 0.12.0
|
2017-03-02 13:43:52 +01:00
|
|
|
|
2019-02-25 11:26:48 +01:00
|
|
|
%description -n python3-%{name}
|
|
|
|
The Python 3 bindings for the createrepo_c library.
|
2017-03-02 13:43:52 +01:00
|
|
|
|
2016-03-24 10:11:06 +01:00
|
|
|
%prep
|
2019-02-25 11:26:48 +01:00
|
|
|
%autosetup -p1
|
|
|
|
|
2018-02-22 14:45:14 +01:00
|
|
|
# do not hardcode date in the docs
|
|
|
|
sed -i -e '/HTML_TIMESTAMP/d' doc/Doxyfile.in.in
|
2016-03-24 10:11:06 +01:00
|
|
|
|
|
|
|
%build
|
2018-02-22 14:45:14 +01:00
|
|
|
%define __builddir build
|
|
|
|
%cmake \
|
2019-02-25 11:26:48 +01:00
|
|
|
%{!?with_zchunk:-DWITH_ZCHUNK=OFF} \
|
2018-02-22 14:45:14 +01:00
|
|
|
%{!?with_drpm:-DENABLE_DRPM=OFF} \
|
|
|
|
%{!?with_python3:-DENABLE_PYTHON=OFF} \
|
|
|
|
-DPYTHON_DESIRED:str=3
|
2017-03-02 13:43:52 +01:00
|
|
|
|
2019-02-25 11:26:48 +01:00
|
|
|
%make_build
|
|
|
|
%make_build doc-c
|
|
|
|
|
2018-02-22 14:45:14 +01:00
|
|
|
%if %{with tests}
|
2019-02-25 11:26:48 +01:00
|
|
|
%check
|
2018-02-22 14:45:14 +01:00
|
|
|
%define __builddir build
|
|
|
|
%ctest
|
2017-03-02 13:43:52 +01:00
|
|
|
%endif
|
2016-03-24 10:11:06 +01:00
|
|
|
|
|
|
|
%install
|
2018-02-22 14:45:14 +01:00
|
|
|
%define __builddir build
|
|
|
|
%cmake_install
|
2019-02-25 11:26:48 +01:00
|
|
|
|
2018-02-22 14:03:44 +01:00
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
2018-02-28 16:16:41 +01:00
|
|
|
for i in createrepo mergerepo modifyrepo sqliterepo;do
|
2018-02-28 17:03:51 +01:00
|
|
|
ln -s %{_bindir}/$i\_c %{buildroot}%{_sysconfdir}/alternatives/$i
|
|
|
|
ln -s %{_sysconfdir}/alternatives/$i %{buildroot}%{_bindir}/$i
|
|
|
|
ln -s %{_mandir}/man8/$i\_c.8.gz %{buildroot}%{_sysconfdir}/alternatives/$i\.8.gz
|
|
|
|
ln -s %{_sysconfdir}/alternatives/$i\.8.gz %{buildroot}%{_mandir}/man8/$i\.8.gz
|
2018-02-28 16:16:41 +01:00
|
|
|
done
|
2017-03-02 13:43:52 +01:00
|
|
|
|
|
|
|
%fdupes %{buildroot}%{_prefix}
|
2018-02-22 14:03:44 +01:00
|
|
|
%fdupes build/doc/html
|
|
|
|
|
|
|
|
%post
|
|
|
|
update-alternatives --install \
|
|
|
|
%{_bindir}/createrepo createrepo %{_bindir}/createrepo_c 20 \
|
|
|
|
--slave %{_bindir}/mergerepo mergerepo %{_bindir}/mergerepo_c \
|
|
|
|
--slave %{_bindir}/modifyrepo modifyrepo %{_bindir}/modifyrepo_c \
|
|
|
|
--slave %{_bindir}/sqliterepo sqliterepo %{_bindir}/sqliterepo_c \
|
|
|
|
--slave %{_mandir}/man8/createrepo.8.gz createrepo.8.gz %{_mandir}/man8/createrepo_c.8.gz \
|
|
|
|
--slave %{_mandir}/man8/mergerepo.8.gz mergerepo.8.gz %{_mandir}/man8/mergerepo_c.8.gz \
|
|
|
|
--slave %{_mandir}/man8/modifyrepo.8.gz modifyrepo.8.gz %{_mandir}/man8/modifyrepo_c.8.gz \
|
|
|
|
--slave %{_mandir}/man8/sqliterepo.8.gz sqliterepo.8.gz %{_mandir}/man8/sqliterepo_c.8.gz
|
|
|
|
|
|
|
|
%postun
|
2019-02-25 11:26:48 +01:00
|
|
|
if [ ! -f %{_bindir}/createrepo_c ]; then
|
2018-02-22 14:03:44 +01:00
|
|
|
update-alternatives --remove createrepo %{_bindir}/createrepo_c
|
|
|
|
fi
|
2016-03-24 10:11:06 +01:00
|
|
|
|
|
|
|
%post -n %{libname} -p /sbin/ldconfig
|
|
|
|
%postun -n %{libname} -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%files
|
2019-02-25 11:26:48 +01:00
|
|
|
%doc README.md
|
|
|
|
%license COPYING
|
2017-03-02 13:43:52 +01:00
|
|
|
%{_mandir}/man8/createrepo_c.8*
|
|
|
|
%{_mandir}/man8/mergerepo_c.8*
|
|
|
|
%{_mandir}/man8/modifyrepo_c.8*
|
|
|
|
%{_mandir}/man8/sqliterepo_c.8*
|
2018-02-28 16:46:43 +01:00
|
|
|
%{_mandir}/man8/createrepo.8*
|
|
|
|
%{_mandir}/man8/mergerepo.8*
|
|
|
|
%{_mandir}/man8/modifyrepo.8*
|
|
|
|
%{_mandir}/man8/sqliterepo.8*
|
2016-03-24 10:11:06 +01:00
|
|
|
%{_datadir}/bash-completion/completions/
|
|
|
|
%{_bindir}/createrepo_c
|
|
|
|
%{_bindir}/mergerepo_c
|
|
|
|
%{_bindir}/modifyrepo_c
|
|
|
|
%{_bindir}/sqliterepo_c
|
2018-02-28 16:46:43 +01:00
|
|
|
%{_bindir}/createrepo
|
|
|
|
%{_bindir}/mergerepo
|
|
|
|
%{_bindir}/modifyrepo
|
|
|
|
%{_bindir}/sqliterepo
|
2018-02-22 14:03:44 +01:00
|
|
|
%ghost %_sysconfdir/alternatives/createrepo
|
|
|
|
%ghost %_sysconfdir/alternatives/mergerepo
|
|
|
|
%ghost %_sysconfdir/alternatives/modifyrepo
|
|
|
|
%ghost %_sysconfdir/alternatives/sqliterepo
|
|
|
|
%ghost %_sysconfdir/alternatives/createrepo.8.gz
|
|
|
|
%ghost %_sysconfdir/alternatives/mergerepo.8.gz
|
|
|
|
%ghost %_sysconfdir/alternatives/modifyrepo.8.gz
|
|
|
|
%ghost %_sysconfdir/alternatives/sqliterepo.8.gz
|
2016-03-24 10:11:06 +01:00
|
|
|
|
|
|
|
%files -n %{libname}
|
2019-02-25 11:26:48 +01:00
|
|
|
%license COPYING
|
2016-03-24 10:11:06 +01:00
|
|
|
%{_libdir}/libcreaterepo_c.so.%{major}
|
|
|
|
%{_libdir}/libcreaterepo_c.so.%{major}.*
|
|
|
|
|
|
|
|
%files -n %{devname}
|
2019-02-25 11:26:48 +01:00
|
|
|
%doc build/doc/html
|
|
|
|
%license COPYING
|
2016-03-24 10:11:06 +01:00
|
|
|
%{_libdir}/libcreaterepo_c.so
|
|
|
|
%{_libdir}/pkgconfig/createrepo_c.pc
|
|
|
|
%{_includedir}/createrepo_c/
|
2017-03-02 13:43:52 +01:00
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
%files -n python3-%{name}
|
2019-02-25 11:26:48 +01:00
|
|
|
%license COPYING
|
2017-03-02 13:43:52 +01:00
|
|
|
%{python3_sitearch}/createrepo_c/
|
|
|
|
%endif
|
2016-03-24 10:11:06 +01:00
|
|
|
|
|
|
|
%changelog
|