diff --git a/hplip.spec b/hplip.spec index e734024..37b9071 100644 --- a/hplip.spec +++ b/hplip.spec @@ -4,10 +4,16 @@ %filter_setup } +# Hp-plugin-check is a switch, which allows testing if new hp-plugin is already available - this should be set to 1 only for local builds +# when you rebase package to new version (lately HP ships new plugins a few days after new release, which makes hp-plugin non-functional +# during this time). Any other time it should be set to 0. +%define hpplugincheck 0 +%define urlplugin http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/%{name}-%{version}-plugin.run + Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.16.11 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and MIT and BSD Url: http://hplip.sourceforge.net/ @@ -42,7 +48,11 @@ Patch25: hplip-badwhitespace.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow Requires: cups +%if "%{hpplugincheck}" == "1" +BuildRequires: wget +%else Requires: wget +%endif Requires: python3-dbus Requires: gnupg # /usr/lib/udev/rules.d @@ -328,6 +338,17 @@ rm -f %{buildroot}%{_unitdir}/hplip-printer@.service # window), so don't ship the launcher yet. rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop +%check +%if "%{hpplugincheck}" == "1" + wget -O hp-plugin.run %{urlplugin} + %if "$?" == "0" + echo "New plugin is not available yet. Rerun build later." + rm hp-plugin.run + exit 1 + %endif + rm hp-plugin.run +%endif + %files %doc COPYING doc/* # ex-hpijs @@ -466,6 +487,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %postun libs -p /sbin/ldconfig %changelog +* Mon Nov 28 2016 Zdenek Dohnal - 3.16.11-2 +- adding spec switch hpplugincheck - for testing if new hp plugin is available + * Fri Nov 25 2016 Zdenek Dohnal - 3.16.11-1 - rebase to 3.16.11