--- /dev/null
+Partially reverts 895baa3bdc50689736bd3bff110bca6e389829ee: [PATCH] Remove Python 2 support
+--- libbytesize-2.0/configure.ac.orig 2019-06-08 16:31:47.643606410 +0200
++++ libbytesize-2.0/configure.ac 2019-06-08 16:31:52.663579214 +0200
+@@ -52,6 +52,22 @@
+ [LIBBYTESIZE_SOFT_FAILURE([Header file $ac_header not found.])],
+ [])
+
++AC_ARG_WITH([python2],
++ AS_HELP_STRING([--with-python2], [support python2 @<:@default=check@:>@]),
++ [],
++ [with_python2=check])
++
++AC_SUBST(WITH_PYTHON2, 0)
++if test "x$with_python2" != "xno"; then
++ AC_PATH_PROG([python2], [python2], [no])
++ AS_IF([test "x$python2" == "xno"],
++ [if test "x$with_python2" = "xyes"; then
++ LIBBYTESIZE_SOFT_FAILURE([Python2 support requested, but python2 is not available])
++ fi],
++ [AC_SUBST(WITH_PYTHON2, 1)])
++fi
++AM_CONDITIONAL(WITH_PYTHON2, test "x$with_python2" != "xno" -a "x$python2" != "xno")
++
+ AC_ARG_WITH([python3],
+ AS_HELP_STRING([--with-python3], [support python3 @<:@default=check@:>@]),
+ [],
+--- libbytesize-2.0/src/python/Makefile.am.orig 2019-03-20 10:10:37.000000000 +0100
++++ libbytesize-2.0/src/python/Makefile.am 2019-06-08 16:37:02.788565790 +0200
+@@ -1,7 +1,14 @@
++if WITH_PYTHON2
++pylibdir = $(shell python -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='${exec_prefix}'))")
++
++pybytesizedir = $(pylibdir)/bytesize
++dist_pybytesize_DATA = bytesize.py __init__.py
++endif
++
+ if WITH_PYTHON3
+ py3libdir = $(shell python3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='${exec_prefix}'))")
+ py3bytesizedir = $(py3libdir)/bytesize
+-dist_py3bytesize_DATA = bytesize.py __init__.py
++nodist_py3bytesize_DATA = bytesize.py __init__.py
+ endif
+
+ MAINTAINERCLEANFILES = Makefile.in
Summary: A library for working with sizes in bytes
Summary(pl.UTF-8): Biblioteka do pracy z rozmiarami w bajtach
Name: libbytesize
-Version: 1.4
+Version: 2.0
Release: 1
License: LGPL v2+
Group: Libraries
#Source0Download: https://github.com/storaged-project/libbytesize/releases
Source0: https://github.com/storaged-project/libbytesize/releases/download/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: aa9bd5a04546873714da2adbaaa9f283
+# Source0-md5: d47369556cd92aad4d8bc8ba10aebbed
+Patch0: %{name}-python2.patch
URL: https://github.com/storaged-project/libbytesize
BuildRequires: autoconf >= 2.50
BuildRequires: automake
BuildRequires: gtk-doc
BuildRequires: libtool >= 2:2
BuildRequires: mpfr-devel
-BuildRequires: pcre-devel >= 8.32
+BuildRequires: pcre2-8-devel
BuildRequires: pkgconfig
%{?with_python2:BuildRequires: python-devel >= 2}
%{?with_python3:BuildRequires: python3-devel >= 1:3.2}
%prep
%setup -q
+%patch0 -p1
%build
%{__libtoolize}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+%if %{with python2}
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_postclean
+%endif
+%if %{with python3}
%py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
%py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
+%endif
%{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
%if %{with python3}
%files -n python3-bytesize
%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/bscalc
%dir %{py3_sitedir}/bytesize
%{py3_sitedir}/bytesize/__pycache__
%{py3_sitedir}/bytesize/*.py
+%{_mandir}/man1/bscalc.1*
%endif