diff --git a/hplip.changes b/hplip.changes index f987344..c5e9b9b 100644 --- a/hplip.changes +++ b/hplip.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Thu Aug 29 20:33:04 UTC 2019 - Martin Wilck + +- Renamed "hplip-scan" to "hplip-scan-utils" to express the + purpose of the package more clearly in the name. + "hplip-scan" has never been in public repos. + +------------------------------------------------------------------- +Thu Aug 29 20:24:48 UTC 2019 - Martin Wilck + +- Added conditional BuildRequires on "cups-rpm-helper". + Recently a bug in python-pycups was fixed that had prevented + autogeneration of Provides: tags in printer drivers by means + of "BuildRequires: python3-cups". See OBS sr#726727. This + dependency must be conditional for now, as cups-rpm-helper + is not available in every project yet. +- Ran spec-cleaner. + +------------------------------------------------------------------- +Wed Aug 28 21:32:04 UTC 2019 - Martin Wilck + +- Removed compatibility code for SLE12/Leap42 and earlier + As we are now using rpm 4.13 (A and B) syntax, we can't support + these any more anyway. + ------------------------------------------------------------------- Tue Aug 27 10:48:46 UTC 2019 - Martin Wilck diff --git a/hplip.spec b/hplip.spec index 561e987..a7ad1a8 100644 --- a/hplip.spec +++ b/hplip.spec @@ -17,42 +17,15 @@ # python-rpm-macros doesn't work for hplip! -# we don't build both py2 and py3, just one -%if 0%{?suse_version} >= 1500 +# We just build for py3 since SLE15 %define pyversion 3 %define pymod() python3-%{**} -%define pyver %py3_ver +%define pyver %{py3_ver} %define pyexe %{_bindir}/python3 -%define gobject gobject -%else -%define pyversion 2 -%define pymod() python-%{**} -%define pyver %py_ver -%define pyexe %{_bindir}/python -%define gobject gobject2 -%endif -%if 0%{?suse_version} == 1315 && 0%{?is_opensuse} -%define is_leap 1 -%else -%define is_leap 0 -%endif -# For udev macros -%if 0%{?suse_version} > 1130 -BuildRequires: systemd-rpm-macros -%else -# For older suse_version (in particular for SLE11) define needed udev macros manually: -%{!?_udevrulesdir: %global _udevrulesdir %{_prefix}/lib/udev/rules.d } -%endif -%if 0%{?suse_version} == 1110 -# For SLE11 redefine _libexecdir because on SLE11 _libexecdir is "/usr/lib64": -%global _libexecdir %{_prefix}/lib -%endif -# Use Qt5 frontend on TW, Leap >= 42.2 and SLE >= 15 -%if 0%{?suse_version} > 1320 || (0%{?sle_version} >= 120200 && 0%{?is_opensuse}) %global use_qt5 1 -%else -%global use_qt5 0 -%endif +# Set _with_new_pycups in prjconf if cups-rpm-helper is available +# (for auto-generated printer driver Provides:) +%bcond_with new_pycups Name: hplip Version: 3.19.6 Release: 0 @@ -103,13 +76,11 @@ Patch303: photocard-fix-import-error-for-pcardext.patch Patch400: hplip-remove-imageprocessor.diff # Let a function return NULL instead of nothing Patch401: hplip-orblite-return-null.diff -# All printer driver packages should have "BuildRequires: python-cups" -# because python-cups installs special rpm macros that adds Provides tags -# for the printer drivers supported by the package, -# see https://bugzilla.novell.com/show_bug.cgi?id=735865 -BuildRequires: %{pymod cups} BuildRequires: %{pymod devel} +BuildRequires: %{pymod qt5-devel} BuildRequires: %{pymod xml} +BuildRequires: cups > 1.5 +BuildRequires: cups-devel > 1.5 BuildRequires: dbus-1-devel BuildRequires: fdupes BuildRequires: hicolor-icon-theme @@ -121,7 +92,18 @@ BuildRequires: libusb-1_0-devel BuildRequires: net-snmp-devel BuildRequires: pkgconfig BuildRequires: readline-devel +BuildRequires: sane-backends-devel +BuildRequires: systemd-rpm-macros BuildRequires: update-desktop-files +#!BuildIgnore: clang8 +#!BuildIgnore: libclang8 +# Break this dependency chain that has caused build breakage +# python3-qt5-devel -> libqt5-qttools-devel -> libqt5-qttools-doc -> clang8 +#!BuildIgnore: libqt5-qttools-devel +#!BuildIgnore: libqt5-qtwebengine +# Break this dependency chain that has caused build breakage +# python3-qt5-devel -> libqt5-qtwebengine-devel -> libavcodec58 -> libdav1d.so.1 +#!BuildIgnore: libqt5-qtwebengine-devel # Require the exact matching version-release of the hpijs sub-package to make sure # to have the exact matching version of libhpip and libhpmud installed. # The exact matching version-release of the sub-package is available on the same @@ -130,6 +112,10 @@ Requires: %{name}-hpijs = %{version}-%{release} # Require the exact matching version-release of the sane sub-package to make sure # to have the exact matching version of libsane-hpaio installed: Requires: %{name}-sane = %{version}-%{release} +Requires: %{pymod dbus-python} >= 0.80 +Requires: %{pymod gobject} +Requires: %{pymod qt5} +Requires: cups > 1.5 # foomatic-filters and cups-filters-foomatic-rip # do not require Ghostscript because depending on the PPD # (e.g. some PPDs for PostScript printers in OpenPrintingPPDs-postscript) @@ -140,14 +126,6 @@ Requires: %{name}-sane = %{version}-%{release} # (see the comment for the hplip-hpijs sub-package below). # Therefore the hplip main package which is intended # to get "all the HPLIP stuff" installed has the RPM requirement: -Requires: %{pymod %gobject} -# Require special Python stuff (which pulls in Python base stuff). -# At least since openSUSE 11.1 and SLE11 pyxml is no longer required -# (pyxml was required in particular for openSUSE 10.3 and SLE10, -# see https://answers.launchpad.net/hplip/+question/25696) -# but meanwhile python-xml alone is sufficient for "import xml.parsers.expat" -# see https://bugzilla.novell.com/show_bug.cgi?id=656779#c3 -Requires: %{pymod xml} # Because foomatic-rip-hplip has CVE-2011-2697 (bnc#698451) # plus a leftover in CVE-2004-0801 (bnc#59233) # foomatic-rip-hplip is no longer installed and foomatic-rip @@ -163,87 +141,14 @@ Requires(post): %{_bindir}/find Requires(post): /bin/grep Requires(post): /bin/sed Requires(post): coreutils -# Either the hplip17 packages or the hplip packages can be installed, -# see https://bugzilla.novell.com/show_bug.cgi?id=251830#c20 -# for the full story why there is this unversioned Obsoletes: +# Obsolete earlier package names Obsoletes: hplip17 -# Obsolete the hplip3 copy that was introduced for older SLED11-GA HP preloads: Provides: hplip3 = 3.9.5 Obsoletes: hplip3 < 3.9.5 -# Break this dependency chain that has caused build breakage -# python3-qt5-devel -> libqt5-qttools-devel -> libqt5-qttools-doc -> clang8 -#!BuildIgnore: libqt5-qttools-devel -#!BuildIgnore: libclang8 -#!BuildIgnore: clang8 -# Break this dependency chain that has caused build breakage -# python3-qt5-devel -> libqt5-qtwebengine-devel -> libavcodec58 -> libdav1d.so.1 -#!BuildIgnore: libqt5-qtwebengine-devel -#!BuildIgnore: libqt5-qtwebengine -%if %use_qt5 -BuildRequires: %{pymod qt5-devel} -%global ui_dir ui5 -%else -BuildRequires: %{pymod qt4} -BuildRequires: libqt4-devel -%global ui_dir ui4 -%endif -# Since version 2.8.4 all interprocess communication uses dbus. -# Therefore python-dbus version 0.80 or greater is required (which pulls in dbus base stuff). -# The dbus stuff in HPLIP requires the Python module gobject -# but there is no automated RPM requirement for python-gobject2, -# see https://answers.launchpad.net/hplip/+question/30741 -%if 0%{pyversion} == 3 -Requires: dbus-1-python3 >= 0.80 -%else -Requires: dbus-1-python >= 0.80 -%endif -%if %use_qt5 -Requires: %{pymod qt5} -%else -Requires: %{pymod qt4} -%endif -# Install into this non-root directory (required when norootforbuild is used): -# HPLIP's Python module cupsext.so has a build-time dependancy on the CUPS version: -# It needs symbols (like ippFirstAttribute, ippNextAttribute, ippSetOperation etc) -# that are defined only in libcups.so version > 1.5. For backward compatibility -# cupsext.c has a macro (CUPS_VERSION_1_6) which defines those undefined function names -# if CUPS version is <= 1.5. To check the CUPS version the CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR -# macros from cups/cups.h are used which means it depends on the CUPS version during build-time -# whether or not cupsext will work with CUPS <= 1.5 at run-time. -# See https://bugs.launchpad.net/hplip/+bug/1423220 -# and https://bugzilla.opensuse.org/show_bug.cgi?id=918387 -# Therefore it BuildRequires the CUPS version as provided in the openSUSE/SLE versions. -# Up to openSUSE 13.2 and SLE11 CUPS < 1.6 is provided (from CUPS 1.3.9 for SLE11 up to CUPS 1.5.4 for openSUSE 13.2). -# For SLE12 by default CUPS 1.7.5 is provided and alternatively CUPS 1.5.4 is provided in the "legacy" module. -# After openSUSE 13.2 (i.e. for current openSUSE Factory) CUPS 2.0 is provided. -# Up to openSUSE 13.2 and SLE12 it BuildRequires CUPS < 1.6 to ensure it even works on SLE12 with CUPS 1.5.4. -# When it was built with CUPS > 1.5 it must also require CUPS > 1.5 during run-time. -# In contrast when it was built with CUPS < 1.6 there must not be a run-time requirement -# for a CUPS version to ensure it works on SLE12 both with CUPS 1.7.5 and CUPS 1.5.4. -# For suse_version values see https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto -%if 0%{?suse_version} > 1320 || %{is_leap} -# For openSUSE after 13.2 (i.e. for current openSUSE Factory) CUPS > 1.5 is provided and required: -BuildRequires: cups > 1.5 -BuildRequires: cups-devel > 1.5 -Requires: cups > 1.5 -%endif -%if 0%{?suse_version} == 1315 && !%{is_leap} -# For SLE12 build it with traditional CUPS 1.5.4 to ensure it works on SLE12 both with CUPS 1.7.5 and CUPS 1.5.4. -# Only in the Printing project for SLE12 use cups154 and cups154-devel (from the cups154-SLE12 source package): -BuildRequires: cups154 -BuildRequires: cups154-devel -Requires: cups -%endif -%if 0%{?suse_version} == 1320 || 0%{?suse_version} < 1315 -# For openSUSE 13.2 and for openSUSE 13.1 and older openSUSE and SLE11 versions CUPS < 1.6 is provided: -BuildRequires: cups < 1.6 -BuildRequires: cups-devel < 1.6 -Requires: cups -%endif -%if 0%{?suse_version} > 1130 -BuildRequires: sane-backends-devel -%else -BuildRequires: sane-backends +%if 0%{?with_new_pycups} +# All printer driver packages should have "BuildRequires: cups-rpm-helper" +# for automatic generation of Provides: tags. +BuildRequires: cups-rpm-helper %endif %description @@ -340,20 +245,21 @@ Supplements: (%{name}-hpijs and sane-backends) This package includes the backend driver for scanning with HP scanners and all-in-one devices using SANE tools like xsane or scanimage. -%package scan +%package scan-utils Summary: HPLIP scanning frontends hp-scan and hp-uiscan # SLE does not provide python-pillow (PIL) (bsc#1131613) Group: Hardware/Scanner -%if 0%{?is_opensuse} Requires: %{pymod Pillow} -Requires: hplip # hp-scan et al. import skimage from the scikit-image package. # It is pretty heavy-weight and pulls in various other packages. Requires: %{pymod scikit-image} +Requires: hplip Enhances: hplip -%endif +# "hplip-scan" has been replaced by hplip-scan-utils +Provides: %{name}-scan = %{version}-%{release} +Obsoletes: %{name}-scan < %{version}-%{release} -%description scan +%description scan-utils This package provides the "hp-scan" and "hp-uiscan" frontend utilities. These utilities are alternatives to the SANE frontends "xsane" and "scanimage". They expose some advanced features of certain HP scanner models. @@ -442,13 +348,8 @@ export CXXFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=return-type" # so that --with-htmldir must be explicitly set. %configure \ --disable-qt3 \ -%if %use_qt5 --disable-qt4 \ --enable-qt5 \ -%else - --enable-qt4 \ - --disable-qt5 \ -%endif --disable-policykit \ --enable-doc-build \ --enable-network-build \ @@ -489,7 +390,7 @@ sed -i 's|ppd/hpcups/\*.ppd.gz ||g' Makefile rm -f %{buildroot}%{_datadir}/hplip/scan.py \ %{buildroot}%{_datadir}/hplip/uiscan.py \ %{buildroot}%{_datadir}/hplip/base/imageprocessing.py \ - %{buildroot}%{_datadir}/hplip/%{ui_dir}/scandialog.py \ + %{buildroot}%{_datadir}/hplip/ui5/scandialog.py \ %{buildroot}%{_bindir}/hp-scan \ %{buildroot}%{_bindir}/hp-uiscan \ %{buildroot}%{_datadir}/applications/hp-uiscan.desktop \ @@ -498,25 +399,8 @@ rm -rf %{buildroot}%{_datadir}/hplip/scan %endif # Make and install Python compiled bytecode files -# (.pyc compiled python and .pyo optimized compiled python) -# because normal users do not have write permissions -# to the install location /usr/share/hplip/ so that -# for normal users Python would recompile the sources every time -# which results longer program startup time and waste of CPU for compiling, -# see https://en.opensuse.org/openSUSE:Packaging_Python#Byte_Compiled_Files -# and http://lists.opensuse.org/opensuse-packaging/2014-10/msg00028.html - -%if 0%{pyversion} == 3 -# Make and install .pyc files: %py3_compile %{buildroot}%{_datadir}/hplip -# Make and install .pyo files: %py3_compile -O %{buildroot}%{_datadir}/hplip -%else -# Make and install .pyc files: -%py_compile %{buildroot}%{_datadir}/hplip -# Make and install .pyo files: -%py_compile -O %{buildroot}%{_datadir}/hplip -%endif # Hardlink .pyc and .pyo when they have same content. # Do not run "fdupes buildroot/_datadir/hplip" because @@ -525,11 +409,7 @@ rm -rf %{buildroot}%{_datadir}/hplip/scan # https://bugzilla.opensuse.org/show_bug.cgi?id=784670 for pyc in $( find %{buildroot}%{_datadir}/hplip -name '*.pyc' ) do -%if 0%{pyversion} == 3 pyo="${pyc%.pyc}.opt-1.pyc" -%else - pyo="${pyc%.pyc}.pyo" -%endif if test -f $pyo && cmp -s $pyc $pyo then echo hardlinking $pyc and $pyo because both have same content ln -f $pyc $pyo @@ -681,13 +561,9 @@ install -m 644 %{SOURCE102} %{buildroot}%{_mandir}/man1/ %fdupes -s %{buildroot}%{_datadir}/hplip/data/images %post -p /bin/bash -%if 0%{?suse_version} > 1130 %udev_rules_update %desktop_database_post %icon_theme_cache_post -%else -gtk-update-icon-cache %{_datadir}/icons/hicolor || true -%endif /sbin/ldconfig exit 0 @@ -704,12 +580,8 @@ fi exit 0 %postun -p /bin/bash -%if 0%{?suse_version} >= 1140 %desktop_database_postun %icon_theme_cache_postun -%else -gtk-update-icon-cache %{_datadir}/icons/hicolor || true -%endif /sbin/ldconfig # If the package was removed (but not if it was updated) # then remove the hpaio lines in /etc/sane.d/dll.conf. @@ -739,12 +611,7 @@ exit 0 exit 0 %files -%defattr(-, root, root) %config %{_sysconfdir}/xdg/autostart/hplip-systray.desktop -%if 0%{?suse_version} == 1110 || 0%{?suse_version} == 1320 || 0%{?suse_version} == 1315 -%dir %{_prefix}/lib/udev -%dir %{_prefix}/lib/udev/rules.d -%endif %{_udevrulesdir}/56-hpmud.rules %{_bindir}/hp-align %{_bindir}/hp-check @@ -799,22 +666,19 @@ exit 0 %{_datadir}/hplip/ %exclude %{_datadir}/hplip/data/models/models.dat %exclude %{_datadir}/hplip/base/imageprocessing.py* -%exclude %{_datadir}/hplip/%{ui_dir}/scandialog.py* +%exclude %{_datadir}/hplip/ui5/scandialog.py* %exclude %{_datadir}/hplip/scan %exclude %{_datadir}/hplip/scan.py* %exclude %{_datadir}/hplip/uiscan.py* -%if %{pyversion} != 2 %exclude %{_datadir}/hplip/__pycache__/uiscan.* %exclude %{_datadir}/hplip/__pycache__/scan.* %exclude %{_datadir}/hplip/base/__pycache__/imageprocessing.* -%exclude %{_datadir}/hplip/%{ui_dir}/__pycache__/scandialog.* -%endif +%exclude %{_datadir}/hplip/ui5/__pycache__/scandialog.* # The scanning utils depend on PIL and python3-scikit-image, # which are not available in SLE %if 0%{?is_opensuse} -%files scan -%defattr(-, root, root) +%files scan-utils %{_datadir}/applications/hp-uiscan.desktop %{_libdir}/python%{pyver}/site-packages/scanext.* %{_bindir}/hp-scan @@ -823,22 +687,19 @@ exit 0 %{_datadir}/hplip/scan.py* %{_datadir}/hplip/uiscan.py* %{_datadir}/hplip/base/imageprocessing.py* -%{_datadir}/hplip/%{ui_dir}/scandialog.py* -%if %{pyversion} != 2 +%{_datadir}/hplip/ui5/scandialog.py* %{_datadir}/hplip/__pycache__/uiscan.* %{_datadir}/hplip/__pycache__/scan.* %{_datadir}/hplip/base/__pycache__/imageprocessing.* -%{_datadir}/hplip/%{ui_dir}/__pycache__/scandialog.* -%endif +%{_datadir}/hplip/ui5/__pycache__/scandialog.* %endif %files hpijs -%defattr(-, root, root) %config %{_sysconfdir}/hp/ %config %{_sysconfdir}/cups/pstotiff.convs %config %{_sysconfdir}/cups/pstotiff.types %{_bindir}/hpijs -%{_mandir}/man1/hpijs.1.gz +%{_mandir}/man1/hpijs.1%{?ext_man} %{_libdir}/libhpip.so.* %{_libdir}/libhpipp.so.* %{_libdir}/libhpmud.so.* @@ -866,12 +727,10 @@ exit 0 %dir %{_localstatedir}/lib/hp %files sane -%defattr(-, root, root) %dir %{_libdir}/sane %{_libdir}/sane/libsane-hpaio.so.* %files devel -%defattr(-, root, root) %{_libdir}/libhpip.so %{_libdir}/libhpipp.so %{_libdir}/libhpmud.so