]> git.pld-linux.org Git - packages/libbytesize.git/commitdiff
- updated to 2.0 auto/th/libbytesize-2.0-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 8 Jun 2019 15:02:43 +0000 (17:02 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sat, 8 Jun 2019 15:02:43 +0000 (17:02 +0200)
- added python2 patch (restore python2 module for now, python2 is not EOLed in PLD yet)

libbytesize-python2.patch [new file with mode: 0644]
libbytesize.spec

diff --git a/libbytesize-python2.patch b/libbytesize-python2.patch
new file mode 100644 (file)
index 0000000..3368eea
--- /dev/null
@@ -0,0 +1,44 @@
+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
index 7f4acdd845a5963b6ef0a4f2e1e9c4c310405aa1..cb8572a0a21ebc27a49104811f9725498f579699 100644 (file)
@@ -6,13 +6,14 @@
 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
@@ -21,7 +22,7 @@ BuildRequires:        gmp-devel
 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}
@@ -94,6 +95,7 @@ Ten pakiet zawiera wiązania Pythona 3 do libbytesize.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__libtoolize}
@@ -112,12 +114,16 @@ install -d $RPM_BUILD_ROOT%{_gtkdocdir}
 %{__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
 
@@ -158,7 +164,9 @@ rm -rf $RPM_BUILD_ROOT
 %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
This page took 0.11079 seconds and 4 git commands to generate.