SHA256
1
0
forked from pool/createrepo_c

Accepting request 579021 from home:M0ses:branches:system:packagemanager

- 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/579021
OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/createrepo_c?expand=0&rev=19
This commit is contained in:
Frank Schreiner 2018-02-22 13:45:14 +00:00 committed by Git OBS Bridge
parent 3833179bb2
commit beadcff91a
2 changed files with 77 additions and 63 deletions

View File

@ -4,6 +4,20 @@ Wed Feb 21 15:58:06 UTC 2018 - FSchreiner@suse.com
- changed to provide createrepo as update-alternatives [bnc#1075670]
- 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

View File

@ -17,41 +17,44 @@
#
# Enable Python bindings selectively
%if (0%{?suse_version} == 1315 && 0%{?is_opensuse}) || 0%{?leap_version} || 0%{?suse_version} >= 1330
# Python bindings are enabled for openSUSE Leap and Tumbleweed
%bcond_without python
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%if 0%{?is_opensuse} || 0%{?suse_version} >= 1330
%bcond_without python3
%bcond_without tests
%else
# Python bindings are disabled for older SUSE
%bcond_with python
%define skip_python3 1
%bcond_with tests
%bcond_with python3
%endif
# Enable enhanced DeltaRPM support
%bcond_with drpm
%define major 0
%define libname lib%{name}%{major}
%define devname lib%{name}-devel
%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
Version: 0.10.0.git20170131.04828e6
Release: 0
Summary: Creates a common metadata repository
License: GPL-2.0-or-later
Group: System/Packages
Version: 0.10.0.git20170131.04828e6
Release: 0
Url: https://github.com/rpm-software-management/createrepo_c
Source0: %{name}-%{version}.tar.gz
BuildRequires: bash-completion
%if 0%{?suse_version} >= 1330
BuildRequires: bash-completion-devel
%if 0%{?is_opensuse} || 0%{?suse_version} >= 1330
BuildRequires: %{python_module devel}
%else
%if %{with python2}
BuildRequires: python-devel
%endif
%if %{with python3}
BuildRequires: python3-devel
%endif
%endif
BuildRequires: bash-completion
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: fdupes
@ -63,16 +66,18 @@ BuildRequires: libexpat-devel
BuildRequires: libxml2-devel
BuildRequires: lzma-devel
BuildRequires: openssl-devel
%if 0%{?is_opensuse} || 0%{?suse_version} >= 1330
BuildRequires: python-rpm-macros
%endif
BuildRequires: rpm-devel >= 4.9.0
BuildRequires: sqlite3-devel
BuildRequires: zlib-devel
%if %{with python}
BuildRequires: python-devel
BuildRequires: python-nose
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-nose
Requires: %{libname} = %{version}-%{release}
%if %{with tests}
BuildRequires: %{python_module nose}
%endif
%if 0%{?suse_version} >= 1330
BuildRequires: bash-completion-devel
%endif
%if %{with drpm}
BuildRequires: drpm-devel
@ -108,25 +113,23 @@ for easy manipulation with a repodata.
%package -n %{devname}
Summary: Library for repodata manipulation
Group: Development/Libraries/C and C++
Provides: %{name}-devel = %{version}-%{release}
Requires: %{libname} = %{version}-%{release}
Requires: pkg-config
Requires: pkgconfig
Provides: %{name}-devel = %{version}-%{release}
%description -n %{devname}
This package contains the createrepo_c C library and header files.
These development files are for easy manipulation with a repodata.
%if %{with python}
%package -n python2-%{name}
Summary: Python 2 bindings for the createrepo_c library
Group: Development/Libraries/Python
Provides: python-%{name} = %{version}-%{release}
Requires: %{libname} = %{version}-%{release}
Provides: python-%{name} = %{version}-%{release}
%description -n python2-createrepo_c
Python 2 bindings for the createrepo_c library.
%if %{with python3}
%package -n python3-%{name}
Summary: Python 3 bindings for the createrepo_c library
Group: Development/Libraries/Python
@ -134,44 +137,50 @@ Requires: %{libname} = %{version}-%{release}
%description -n python3-createrepo_c
Python 3 bindings for the createrepo_c library.
%endif
%endif
%prep
%setup -q
%if %{with python3}
rm -rf py3
mkdir py3
%endif
# do not hardcode date in the docs
sed -i -e '/HTML_TIMESTAMP/d' doc/Doxyfile.in.in
%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 doc-c
make %{?_smp_mflags} doc-c
%if %{with python}
%if %{with python3}
pushd ../py3
%cmake -DPYTHON_DESIRED:str=3 ../../
cd ..
%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}
popd
%endif
%endif
%check
make tests -C build
make ARGS="-V" test -C build
%if %{with python}
%if %{with tests}
%define __builddir build
%ctest
%if %{with python3}
make tests -C py3/build
make ARGS="-V" test -C py3/build
%define __builddir build-py3
%ctest
%endif
%endif
%install
%make_install -C build
%define __builddir build
%cmake_install
%if %{with python3}
%define __builddir build-py3
%cmake_install
%endif
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -s -f %{_sysconfdir}/alternatives/createrepo %{buildroot}%{_bindir}/createrepo
ln -s -f %{_sysconfdir}/alternatives/mergerepo %{buildroot}%{_bindir}/mergerepo
@ -182,16 +191,8 @@ ln -s -f %{_sysconfdir}/alternatives/mergerepo.8.gz %{buildroot}%{_mandir}/man8
ln -s -f %{_sysconfdir}/alternatives/modifyrepo.8.gz %{buildroot}%{_mandir}/man8/modifyrepo.8.gz
ln -s -f %{_sysconfdir}/alternatives/sqliterepo.8.gz %{buildroot}%{_mandir}/man8/sqliterepo.8.gz
%if %{with python}
%if %{with python3}
%make_install -C py3/build
%endif
%endif
%fdupes %{buildroot}%{_prefix}
%fdupes build/doc/html
%clean
exit 0
%post
update-alternatives --install \
@ -210,7 +211,6 @@ if [ ! -f %{_bindir}/createrepo_c ];then
fi
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
@ -255,11 +255,12 @@ fi
%{_libdir}/pkgconfig/createrepo_c.pc
%{_includedir}/createrepo_c/
%if %{with python}
%if %{with python2}
%files -n python2-%{name}
%defattr(-,root,root)
%doc COPYING
%{python_sitearch}/createrepo_c/
%endif
%if %{with python3}
%files -n python3-%{name}
@ -267,6 +268,5 @@ fi
%doc COPYING
%{python3_sitearch}/createrepo_c/
%endif
%endif
%changelog