forked from pool/createrepo_c
Accepting request 581016 from system:packagemanager
- [bnc#1075670] changed to provide createrepo as update-alternative because createrepo_c will replace createrepo because of switch to python3 - also provide createrepo-implementation - Disable tests on SLE12 due to the python-nose requirements - Switch to singlespec buidling of python bindings - Make sure to use cmake macros to have it easier to gork what is happending by overriding %__builddir - Sort out with spec-cleaner - Fix embedding of date and time to documentation OBS-URL: https://build.opensuse.org/request/show/581016 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/createrepo_c?expand=0&rev=5
This commit is contained in:
commit
af3103e845
@ -1,3 +1,25 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 21 15:58:06 UTC 2018 - FSchreiner@suse.com
|
||||||
|
|
||||||
|
- [bnc#1075670] changed to provide createrepo as update-alternative
|
||||||
|
because createrepo_c will replace createrepo because of switch to
|
||||||
|
python3
|
||||||
|
- also provide createrepo-implementation
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Feb 13 11:53:58 UTC 2018 - tchvatal@suse.com
|
||||||
|
|
||||||
|
- Disable tests on SLE12 due to the python-nose requirements
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jan 22 11:58:46 UTC 2018 - tchvatal@suse.com
|
||||||
|
|
||||||
|
- Switch to singlespec buidling of python bindings
|
||||||
|
- Make sure to use cmake macros to have it easier to gork what is
|
||||||
|
happending by overriding %__builddir
|
||||||
|
- Sort out with spec-cleaner
|
||||||
|
- Fix embedding of date and time to documentation
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Feb 19 12:57:21 UTC 2017 - ngompa13@gmail.com
|
Sun Feb 19 12:57:21 UTC 2017 - ngompa13@gmail.com
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package createrepo_c
|
# spec file for package createrepo_c
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||||
# Copyright (c) 2015-2017 Neal Gompa <ngompa13@gmail.com>.
|
# Copyright (c) 2015-2017 Neal Gompa <ngompa13@gmail.com>.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
@ -17,41 +17,44 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Enable Python bindings selectively
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
%if (0%{?suse_version} == 1315 && 0%{?is_opensuse}) || 0%{?leap_version} || 0%{?suse_version} >= 1330
|
%if 0%{?is_opensuse} || 0%{?suse_version} >= 1330
|
||||||
# Python bindings are enabled for openSUSE Leap and Tumbleweed
|
|
||||||
%bcond_without python
|
|
||||||
%bcond_without python3
|
%bcond_without python3
|
||||||
|
%bcond_without tests
|
||||||
%else
|
%else
|
||||||
# Python bindings are disabled for older SUSE
|
%define skip_python3 1
|
||||||
%bcond_with python
|
%bcond_with tests
|
||||||
%bcond_with python3
|
%bcond_with python3
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Enable enhanced DeltaRPM support
|
|
||||||
%bcond_with drpm
|
|
||||||
|
|
||||||
%define major 0
|
%define major 0
|
||||||
%define libname lib%{name}%{major}
|
%define libname lib%{name}%{major}
|
||||||
%define devname lib%{name}-devel
|
%define devname lib%{name}-devel
|
||||||
|
|
||||||
%define version_unconverted 0.10.0.git20170131.04828e6
|
%define version_unconverted 0.10.0.git20170131.04828e6
|
||||||
|
# prevent provides from nonstandard paths:
|
||||||
|
%global __provides_exclude ^(%{python_sitearch}/.*\\.so\\|%{python3_sitearch}/.*\\.so)$
|
||||||
|
# Enable Python bindings selectively
|
||||||
|
%bcond_without python2
|
||||||
|
# Enable enhanced DeltaRPM support
|
||||||
|
%bcond_with drpm
|
||||||
Name: createrepo_c
|
Name: createrepo_c
|
||||||
Summary: Creates a common metadata repository
|
|
||||||
License: GPL-2.0+
|
|
||||||
Group: System/Packages
|
|
||||||
Version: 0.10.0.git20170131.04828e6
|
Version: 0.10.0.git20170131.04828e6
|
||||||
Release: 0
|
Release: 0
|
||||||
|
Summary: Creates a common metadata repository
|
||||||
|
License: GPL-2.0-or-later
|
||||||
|
Group: System/Packages
|
||||||
Url: https://github.com/rpm-software-management/createrepo_c
|
Url: https://github.com/rpm-software-management/createrepo_c
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
|
%if 0%{?is_opensuse} || 0%{?suse_version} >= 1330
|
||||||
BuildRequires: bash-completion
|
BuildRequires: %{python_module devel}
|
||||||
|
%else
|
||||||
%if 0%{?suse_version} >= 1330
|
%if %{with python2}
|
||||||
BuildRequires: bash-completion-devel
|
BuildRequires: python-devel
|
||||||
%endif
|
%endif
|
||||||
|
%if %{with python3}
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
BuildRequires: bash-completion
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: doxygen
|
BuildRequires: doxygen
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
@ -63,16 +66,18 @@ BuildRequires: libexpat-devel
|
|||||||
BuildRequires: libxml2-devel
|
BuildRequires: libxml2-devel
|
||||||
BuildRequires: lzma-devel
|
BuildRequires: lzma-devel
|
||||||
BuildRequires: openssl-devel
|
BuildRequires: openssl-devel
|
||||||
|
%if 0%{?is_opensuse} || 0%{?suse_version} >= 1330
|
||||||
|
BuildRequires: python-rpm-macros
|
||||||
|
%endif
|
||||||
BuildRequires: rpm-devel >= 4.9.0
|
BuildRequires: rpm-devel >= 4.9.0
|
||||||
BuildRequires: sqlite3-devel
|
BuildRequires: sqlite3-devel
|
||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
%if %{with python}
|
Requires: %{libname} = %{version}-%{release}
|
||||||
BuildRequires: python-devel
|
%if %{with tests}
|
||||||
BuildRequires: python-nose
|
BuildRequires: %{python_module nose}
|
||||||
%if %{with python3}
|
|
||||||
BuildRequires: python3-devel
|
|
||||||
BuildRequires: python3-nose
|
|
||||||
%endif
|
%endif
|
||||||
|
%if 0%{?suse_version} >= 1330
|
||||||
|
BuildRequires: bash-completion-devel
|
||||||
%endif
|
%endif
|
||||||
%if %{with drpm}
|
%if %{with drpm}
|
||||||
BuildRequires: drpm-devel
|
BuildRequires: drpm-devel
|
||||||
@ -80,6 +85,11 @@ BuildRequires: drpm-devel
|
|||||||
|
|
||||||
Requires: %{libname} = %{version}-%{release}
|
Requires: %{libname} = %{version}-%{release}
|
||||||
|
|
||||||
|
Requires(post): update-alternatives
|
||||||
|
Requires(postun): update-alternatives
|
||||||
|
|
||||||
|
Provides: createrepo-implementation
|
||||||
|
|
||||||
# prevent provides from nonstandard paths:
|
# prevent provides from nonstandard paths:
|
||||||
%global __provides_exclude ^(%{python_sitearch}/.*\\.so\\|%{python3_sitearch}/.*\\.so)$
|
%global __provides_exclude ^(%{python_sitearch}/.*\\.so\\|%{python3_sitearch}/.*\\.so)$
|
||||||
|
|
||||||
@ -103,116 +113,158 @@ for easy manipulation with a repodata.
|
|||||||
%package -n %{devname}
|
%package -n %{devname}
|
||||||
Summary: Library for repodata manipulation
|
Summary: Library for repodata manipulation
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Provides: %{name}-devel = %{version}-%{release}
|
|
||||||
Requires: %{libname} = %{version}-%{release}
|
Requires: %{libname} = %{version}-%{release}
|
||||||
Requires: pkg-config
|
Requires: pkgconfig
|
||||||
|
Provides: %{name}-devel = %{version}-%{release}
|
||||||
|
|
||||||
%description -n %{devname}
|
%description -n %{devname}
|
||||||
This package contains the createrepo_c C library and header files.
|
This package contains the createrepo_c C library and header files.
|
||||||
These development files are for easy manipulation with a repodata.
|
These development files are for easy manipulation with a repodata.
|
||||||
|
|
||||||
%if %{with python}
|
|
||||||
%package -n python2-%{name}
|
%package -n python2-%{name}
|
||||||
Summary: Python 2 bindings for the createrepo_c library
|
Summary: Python 2 bindings for the createrepo_c library
|
||||||
Group: Development/Libraries/Python
|
Group: Development/Libraries/Python
|
||||||
Provides: python-%{name} = %{version}-%{release}
|
|
||||||
Requires: %{libname} = %{version}-%{release}
|
Requires: %{libname} = %{version}-%{release}
|
||||||
|
Provides: python-%{name} = %{version}-%{release}
|
||||||
|
|
||||||
%description -n python2-createrepo_c
|
%description -n python2-createrepo_c
|
||||||
Python 2 bindings for the createrepo_c library.
|
The python 2 bindings for the createrepo_c library.
|
||||||
|
|
||||||
%if %{with python3}
|
|
||||||
%package -n python3-%{name}
|
%package -n python3-%{name}
|
||||||
Summary: Python 3 bindings for the createrepo_c library
|
Summary: Python 3 bindings for the createrepo_c library
|
||||||
Group: Development/Libraries/Python
|
Group: Development/Libraries/Python
|
||||||
Requires: %{libname} = %{version}-%{release}
|
Requires: %{libname} = %{version}-%{release}
|
||||||
|
|
||||||
%description -n python3-createrepo_c
|
%description -n python3-createrepo_c
|
||||||
Python 3 bindings for the createrepo_c library.
|
The python 3 bindings for the createrepo_c library.
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
# do not hardcode date in the docs
|
||||||
%if %{with python3}
|
sed -i -e '/HTML_TIMESTAMP/d' doc/Doxyfile.in.in
|
||||||
rm -rf py3
|
|
||||||
mkdir py3
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake -DENABLE_LEGACY_WEAKTAGS=1 %{!?with_drpm:-DENABLE_DRPM=OFF} %{!?with_python:-DENABLE_PYTHON=OFF}
|
%define __builddir build
|
||||||
|
%cmake \
|
||||||
|
-DENABLE_LEGACY_WEAKTAGS=1 \
|
||||||
|
%{!?with_drpm:-DENABLE_DRPM=OFF} \
|
||||||
|
%{!?with_python2:-DENABLE_PYTHON=OFF}
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
make doc-c
|
make %{?_smp_mflags} doc-c
|
||||||
|
|
||||||
%if %{with python}
|
|
||||||
%if %{with python3}
|
%if %{with python3}
|
||||||
pushd ../py3
|
cd ..
|
||||||
%cmake -DPYTHON_DESIRED:str=3 ../../
|
%define __builddir build-py3
|
||||||
|
%cmake \
|
||||||
|
-DENABLE_LEGACY_WEAKTAGS=1 \
|
||||||
|
%{!?with_drpm:-DENABLE_DRPM=OFF} \
|
||||||
|
%{!?with_python3:-DENABLE_PYTHON=OFF} \
|
||||||
|
-DPYTHON_DESIRED:str=3
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
popd
|
|
||||||
%endif
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
make tests -C build
|
%if %{with tests}
|
||||||
make ARGS="-V" test -C build
|
%define __builddir build
|
||||||
|
%ctest
|
||||||
%if %{with python}
|
|
||||||
%if %{with python3}
|
%if %{with python3}
|
||||||
make tests -C py3/build
|
%define __builddir build-py3
|
||||||
make ARGS="-V" test -C py3/build
|
%ctest
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install -C build
|
%define __builddir build
|
||||||
|
%cmake_install
|
||||||
%if %{with python}
|
|
||||||
%if %{with python3}
|
%if %{with python3}
|
||||||
%make_install -C py3/build
|
%define __builddir build-py3
|
||||||
%endif
|
%cmake_install
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||||
|
for i in createrepo mergerepo modifyrepo sqliterepo;do
|
||||||
|
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
|
||||||
|
done
|
||||||
|
|
||||||
%fdupes %{buildroot}%{_prefix}
|
%fdupes %{buildroot}%{_prefix}
|
||||||
|
%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
|
||||||
|
if [ ! -f %{_bindir}/createrepo_c ];then
|
||||||
|
update-alternatives --remove createrepo %{_bindir}/createrepo_c
|
||||||
|
fi
|
||||||
|
|
||||||
%post -n %{libname} -p /sbin/ldconfig
|
%post -n %{libname} -p /sbin/ldconfig
|
||||||
|
|
||||||
%postun -n %{libname} -p /sbin/ldconfig
|
%postun -n %{libname} -p /sbin/ldconfig
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
%doc README.md COPYING
|
%doc README.md COPYING
|
||||||
%{_mandir}/man8/createrepo_c.8*
|
%{_mandir}/man8/createrepo_c.8*
|
||||||
%{_mandir}/man8/mergerepo_c.8*
|
%{_mandir}/man8/mergerepo_c.8*
|
||||||
%{_mandir}/man8/modifyrepo_c.8*
|
%{_mandir}/man8/modifyrepo_c.8*
|
||||||
%{_mandir}/man8/sqliterepo_c.8*
|
%{_mandir}/man8/sqliterepo_c.8*
|
||||||
|
%{_mandir}/man8/createrepo.8*
|
||||||
|
%{_mandir}/man8/mergerepo.8*
|
||||||
|
%{_mandir}/man8/modifyrepo.8*
|
||||||
|
%{_mandir}/man8/sqliterepo.8*
|
||||||
%{_datadir}/bash-completion/completions/
|
%{_datadir}/bash-completion/completions/
|
||||||
%{_bindir}/createrepo_c
|
%{_bindir}/createrepo_c
|
||||||
%{_bindir}/mergerepo_c
|
%{_bindir}/mergerepo_c
|
||||||
%{_bindir}/modifyrepo_c
|
%{_bindir}/modifyrepo_c
|
||||||
%{_bindir}/sqliterepo_c
|
%{_bindir}/sqliterepo_c
|
||||||
|
%{_bindir}/createrepo
|
||||||
|
%{_bindir}/mergerepo
|
||||||
|
%{_bindir}/modifyrepo
|
||||||
|
%{_bindir}/sqliterepo
|
||||||
|
%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
|
||||||
|
|
||||||
%files -n %{libname}
|
%files -n %{libname}
|
||||||
|
%defattr(-,root,root)
|
||||||
%doc COPYING
|
%doc COPYING
|
||||||
%{_libdir}/libcreaterepo_c.so.%{major}
|
%{_libdir}/libcreaterepo_c.so.%{major}
|
||||||
%{_libdir}/libcreaterepo_c.so.%{major}.*
|
%{_libdir}/libcreaterepo_c.so.%{major}.*
|
||||||
|
|
||||||
%files -n %{devname}
|
%files -n %{devname}
|
||||||
|
%defattr(-,root,root)
|
||||||
%doc build/doc/html COPYING
|
%doc build/doc/html COPYING
|
||||||
%{_libdir}/libcreaterepo_c.so
|
%{_libdir}/libcreaterepo_c.so
|
||||||
%{_libdir}/pkgconfig/createrepo_c.pc
|
%{_libdir}/pkgconfig/createrepo_c.pc
|
||||||
%{_includedir}/createrepo_c/
|
%{_includedir}/createrepo_c/
|
||||||
|
|
||||||
%if %{with python}
|
%if %{with python2}
|
||||||
%files -n python2-%{name}
|
%files -n python2-%{name}
|
||||||
|
%defattr(-,root,root)
|
||||||
%doc COPYING
|
%doc COPYING
|
||||||
%{python_sitearch}/createrepo_c/
|
%{python_sitearch}/createrepo_c/
|
||||||
|
%endif
|
||||||
|
|
||||||
%if %{with python3}
|
%if %{with python3}
|
||||||
%files -n python3-%{name}
|
%files -n python3-%{name}
|
||||||
|
%defattr(-,root,root)
|
||||||
%doc COPYING
|
%doc COPYING
|
||||||
%{python3_sitearch}/createrepo_c/
|
%{python3_sitearch}/createrepo_c/
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user