diff --git a/.gitignore b/.gitignore index fd88eda..6d178d8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /libbytesize-0.6.tar.gz /libbytesize-0.7.tar.gz /libbytesize-0.8.tar.gz +/libbytesize-0.9.tar.gz diff --git a/libbytesize.spec b/libbytesize.spec index 37d3519..a8a60b0 100644 --- a/libbytesize.spec +++ b/libbytesize.spec @@ -1,20 +1,34 @@ +%define realname bytesize +%define with_python3 1 +%define with_gtk_doc 1 + +%define is_rhel 0%{?rhel} != 0 + +# python3 is not available on RHEL +%if %{is_rhel} +%define with_python3 0 +%define configure_opts --without-python3 +%endif + Name: libbytesize -Version: 0.8 -Release: 2%{?dist} +Version: 0.9 +Release: 1%{?dist} Summary: A library for working with sizes in bytes License: LGPLv2+ URL: https://github.com/rhinstaller/libbytesize Source0: https://github.com/rhinstaller/libbytesize/archive/%{name}-%{version}.tar.gz -%define realname bytesize - BuildRequires: gmp-devel BuildRequires: mpfr-devel BuildRequires: pcre-devel BuildRequires: gettext-devel BuildRequires: python-devel +%if %{with_python3} BuildRequires: python3-devel +%endif +%if %{with_gtk_doc} BuildRequires: gtk-doc +%endif %description The libbytesize is a C library that facilitates work with sizes in @@ -40,6 +54,7 @@ Requires: python-six This package contains Python 2 bindings for libbytesize making the use of the library from Python 2 easier and more convenient. +%if %{with_python3} %package -n python3-%{realname} Summary: Python 3 bindings for libbytesize Requires: %{name}%{?_isa} = %{version}-%{release} @@ -48,12 +63,13 @@ Requires: python3-six %description -n python3-%{realname} This package contains Python 3 bindings for libbytesize making the use of the library from Python 3 easier and more convenient. +%endif %prep %setup -q -n %{name}-%{version} %build -%configure +%configure %{?configure_opts} %{__make} %{?_smp_mflags} %install @@ -77,18 +93,33 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm} %dir %{_includedir}/bytesize %{_includedir}/bytesize/bs_size.h %{_libdir}/pkgconfig/bytesize.pc +%if %{with_gtk_doc} %{_datadir}/gtk-doc/html/libbytesize +%endif %files -n python-%{realname} %dir %{python2_sitearch}/bytesize %{python2_sitearch}/bytesize/* +%if %{with_python3} %files -n python3-%{realname} %dir %{python3_sitearch}/bytesize %{python3_sitearch}/bytesize/* %{python3_sitearch}/bytesize/__pycache__/* +%endif %changelog +* Wed Jan 11 2017 Vratislav Podzimek - 0.9-1 +- Allow the Size python class to be easily imported (vpodzime) +- Make sure pyexecdir is defined (vpodzime) +- Do not run Python 3 tests without python3 (vpodzime) +- Disable python3 on RHEL (vpodzime) +- Reflect the configuration in the spec file template (vpodzime) +- Make documentation generation conditional (vpodzime) +- Make python3 support conditional (vpodzime) +- Require lower version of libpcre (vpodzime) +- Sync the spec file with downstream (vpodzime) + * Wed Dec 21 2016 Adam Williamson - 0.8-2 - Rebuild for Python 3.6, again diff --git a/sources b/sources index 31a2939..5775427 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libbytesize-0.8.tar.gz) = 93d4d7105f512073462c2ff0d01e975aca70e577c7f644bdc87841959513bc83c207590be6baf7dbf3e049c08ff9aaddc99c71bb94f665e79a60415f1a65dcd7 +SHA512 (libbytesize-0.9.tar.gz) = af8542af90db58624a90b2e1fa2a2474fd2fdca4988f4e3fbe497df93fea7fe34d43c1f8114d27ce154df001aacaf8680c99f7ba3c2fca734bcb44d03601485e