adding hplip-rebase.sh script for testing if plugin is available - removing its testing from spec

This commit is contained in:
Zdenek Dohnal 2017-08-04 14:28:32 +02:00
parent b8bcbf3013
commit 9886bfa2e0
2 changed files with 29 additions and 24 deletions

24
hplip-rebase.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
if [ "$1" == "-h" -o "$1" == "--help" ]
then
echo "Usage: ./hplip-rebase.sh X.Y.Z"
exit 0
fi
wget -O hplip-plugin.run http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-$1-plugin.run
if [ $? -gt 0 ]
then
echo "Error while downloading plugin. Check version passed by argument or internet connection. For usage run script with -h or --help argument."
rm hplip-plugin.run
exit 1
fi
rm hplip-plugin.run
fedpkg mockbuild
if [ $? -gt 0 ]
then
echo "Error during mockbuild."
exit 1
fi
exit 0

View File

@ -4,16 +4,10 @@
%filter_setup
}
# Hp-plugin-check is a switch, which allows testing if new hp-plugin is already available - SET TO 1 ONLY FOR LOCAL BUILDS WHEN REBASING,
# NO COMMITS WITH HPPLUGINCHECK 1 (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.17.4
Release: 2%{?dist}
Version: 3.17.6
Release: 1%{?dist}
License: GPLv2+ and MIT and BSD
Url: http://hplip.sourceforge.net/
@ -71,11 +65,6 @@ BuildRequires: python3-cups, cups
# macros: %%{_tmpfilesdir}, %%{_udevrulesdir}
BuildRequires: systemd
# if hpplugincheck is on, it will need wget as BuildRequire. USE ONLY FOR TESTING, NO COMMITS WITH HPPLUGINCHECK = 1
%if "%{hpplugincheck}" == "1"
BuildRequires: wget
%endif
# hpijs was merged into main package in 3.15.7-2
Obsoletes: hpijs < 1:%{version}-%{release}
Provides: hpijs = 1:%{version}-%{release}
@ -338,17 +327,6 @@ 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
@ -487,6 +465,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%postun libs -p /sbin/ldconfig
%changelog
* Fri Aug 04 2017 Zdenek Dohnal <zdohnal@redhat.com> - 3.17.6-1
- adding hplip-rebase.sh script for testing if plugin is available - removing its testing from spec
* Mon May 29 2017 Zdenek Dohnal <zdohnal@redhat.com> - 3.17.4-2
- 1456467 - hp-check shows 'CUPS incompatible or not running' even if CUPS is running