diff --git a/hplip.spec b/hplip.spec index 0a9aeb4..39b9c1c 100644 --- a/hplip.spec +++ b/hplip.spec @@ -20,7 +20,7 @@ Summary: HP printer/all-in-one driver infrastructure Name: hplip Version: 3.16.11 -Release: 3 +Release: 4 License: GPLv2+ and MIT Group: System/Printing Url: http://hplip.sourceforge.net/ @@ -97,7 +97,6 @@ BuildRequires: python3-cups %if %{sane_backend} BuildRequires: pkgconfig(sane-backends) BuildRequires: xsane -Requires(post): hplip %endif Requires(post): systemd Requires: cups @@ -203,7 +202,6 @@ the "%{libhpip}" library. %package -n %{libsane} Summary: SANE driver for scanners in HP's multi-function devices (from HPLIP) Group: System/Printing -Requires(post): sane-backends Provides: sane-backends-hpaio = %{version}-%{release} # (cjw) for system-config-printer Provides: libsane-hpaio = %{version}-%{release} @@ -542,6 +540,8 @@ mv %{buildroot}%{_docdir}/%{name}-%{version}%{extraversion} %{buildroot}%{_docdi # Remove static libraries of SANE driver rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.la rm -f %{buildroot}%{_sysconfdir}/sane.d/dll.conf +mkdir -p %{buildroot}%{_sysconfdir}/sane.d/dll.d +echo 'hpaio' > %{buildroot}%{_sysconfdir}/sane.d/dll.d/hpaio # Remove other unneeded/unwanted files # Remove files we don't want to package. @@ -679,27 +679,6 @@ done /sbin/udevadm settle --timeout=15 : -%if %{sane_backend} -%post -n %{libsane} - -# Add HPLIP driver to /etc/sane.d/dll.conf -if ! grep ^hpaio /etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \ - echo hpaio >> /etc/sane.d/dll.conf; \ -fi -%endif - -%if %{sane_backend} -%preun -n %{libsane} -# Remove HPLIP driver from /etc/sane.d/dll.conf -if [ "$1" = 0 ]; then \ - if grep ^hpaio /etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \ - sed '/hpaio/d' /etc/sane.d/dll.conf > /tmp/$$; \ - cp -f /tmp/$$ /etc/sane.d/dll.conf; \ - rm -f /tmp/$$; \ - fi; \ -fi -%endif - # Restart CUPS to make the removal of the Fax PPD known to it %_post_service cups @@ -851,9 +830,13 @@ fi %{_libdir}/libhpdiscovery.so %if %{sane_backend} %{_libdir}/sane/libsane-hpaio.so +%endif +%if %{sane_backend} %files -n %{libsane} %{_libdir}/sane/libsane-hpaio.so.%{sanemaj}* +# Not really a shared library package so it's OK to have config here +%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %endif %files compat-libs