[hplip] Build and ship also Python 2 modules for hp-plugin (bug #1196237).

Jiří Popelka jpopelka at fedoraproject.org
Mon Mar 23 15:38:38 UTC 2015


commit 8b7f3bae70aeff95124c11d01a8615590c827cb1
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Mon Mar 23 16:37:58 2015 +0100

    Build and ship also Python 2 modules for hp-plugin (bug #1196237).

 hplip.spec | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)
---
diff --git a/hplip.spec b/hplip.spec
index f10de77..f0f429e 100644
--- a/hplip.spec
+++ b/hplip.spec
@@ -1,13 +1,16 @@
 # we don't want to provide private python extension libs
 %{?filter_setup:
+%filter_provides_in %{python2_sitearch}/.*\.so$
 %filter_provides_in %{python3_sitearch}/.*\.so$
 %filter_setup
 }
 
+%{!?py2dir: %global py2dir python2-%{name}-%{version}-%{release}}
+
 Summary: HP Linux Imaging and Printing Project
 Name: hplip
 Version: 3.15.2
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: GPLv2+ and MIT
 
 Url: http://hplip.sourceforge.net/
@@ -41,6 +44,8 @@ Patch23: hplip-silence-ioerror.patch
 %global hpijs_epoch 1
 Requires: hpijs%{?_isa} = %{hpijs_epoch}:%{version}-%{release}
 Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+# due to hp-plugin (BZ#1196237)
+Requires: %{name}-compat-libs%{?_isa} = %{version}-%{release}
 Requires: python3-pillow
 Requires: cups
 Requires: wget
@@ -87,6 +92,18 @@ Requires: python3
 %description libs
 Libraries needed by HPLIP.
 
+%package compat-libs
+Summary: HPLIP Python 2 modules
+License: GPLv2+ and MIT
+Requires: %{name}-common%{?_isa} = %{version}-%{release}
+Requires: python-pillow
+Requires: dbus-python
+Requires: python
+BuildRequires: python2-devel
+
+%description compat-libs
+Python 2 modules needed by HP plugin.
+
 %package gui
 Summary: HPLIP graphical tools
 Group: Applications/System
@@ -236,7 +253,20 @@ sed -i.env-python -e 's,^#!/usr/bin/env python,#!%{__python3},' \
     prnt/filters/hpps \
     fax/filters/pstotiff
 
+# compat-libs
+rm -rf ../%{py2dir}
+cp -a . ../%{py2dir}
+
+
 %build
+# compat-libs
+pushd ../%{py2dir}
+%configure PYTHON=%{__python2}
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+make
+popd
+
 %configure \
         --enable-scan-build --enable-gui-build --enable-fax-build \
         --disable-foomatic-rip-hplip-install --enable-pp-build \
@@ -251,6 +281,13 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
 make
 
 %install
+# compat-libs
+pushd ../%{py2dir}
+make install DESTDIR=%{buildroot} PYTHON=%{__python2}
+rm -f %{buildroot}%{python2_sitearch}/*.la
+popd
+
+
 mkdir -p %{buildroot}%{_bindir}
 make install DESTDIR=%{buildroot} PYTHON=%{__python3}
 
@@ -445,6 +482,10 @@ rm -f ppds-all
 # Python extension
 %{python3_sitearch}/*
 
+%files compat-libs
+# Python extension
+%{python2_sitearch}/*.so
+
 %files gui
 %{_bindir}/hp-check
 %{_bindir}/hp-print
@@ -480,6 +521,9 @@ rm -f ppds-all
 %postun libs -p /sbin/ldconfig
 
 %changelog
+* Mon Mar 23 2015 Jiri Popelka <jpopelka at redhat.com> - 3.15.2-8
+- Build and ship also Python 2 modules for hp-plugin (bug #1196237).
+
 * Fri Mar 20 2015 Tim Waugh <twaugh at redhat.com> - 3.15.2-7
 - filters: don't use 'env' when starting Python (bug #1202451).
 


More information about the scm-commits mailing list