Mail archive
alpine-aports

[alpine-aports] [PATCH v2] testing/hplip: upgrade to 3.16.11, enable scanning support (#6520)

From: Valery Kartel <valery.kartel_at_gmail.com>
Date: Tue, 13 Dec 2016 16:04:20 +0200

--
build fixups
add sane-backend-hpaio subpackage
udev-related data moved to -udev subpackage
v2:
made lite install (printer & scanner drivers only)
remove python dependency
---
 testing/hplip/APKBUILD              | 58 +++++++++++++++++++++++++------------
 testing/hplip/disable_upgrade.patch | 14 ---------
 testing/hplip/fix-paths.patch       | 20 +++++++++++++
 3 files changed, 59 insertions(+), 33 deletions(-)
 delete mode 100644 testing/hplip/disable_upgrade.patch
 create mode 100644 testing/hplip/fix-paths.patch
diff --git a/testing/hplip/APKBUILD b/testing/hplip/APKBUILD
index fd18dd4c5f..4645d23069 100644
--- a/testing/hplip/APKBUILD
+++ b/testing/hplip/APKBUILD
_at_@ -1,48 +1,68 @@
 # Maintainer:
 # Contributor: Bartłomiej Piotrowski <bpiotrowski_at_alpinelinux.org>
 # Contributor: Timo Teräs <timo.teras_at_iki.fi>
+# Contributor: Valery Kartel <valery.kartel_at_gmail.com>
 
 pkgname=hplip
-pkgver=3.16.10
+pkgver=3.16.11
 pkgrel=0
 pkgdesc="Drivers for HP printers"
 arch=all
 url="http://hplipopensource.com"
 license="GPL"
-depends="python py-dbus"
-makedepends="libjpeg-turbo-dev net-snmp-dev cups-dev libusb-dev python-dev"
-subpackages="$pkgname-doc"
+depends=""
+makedepends="libjpeg-turbo-dev net-snmp-dev cups-dev libusb-dev sane-dev"
+subpackages="$pkgname-doc $pkgname-udev::noarch sane-backend-hpaio:sane"
 source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
 	fix-includes.patch
-        disable_upgrade.patch"
+	fix-paths.patch"
+builddir="$srcdir"/$pkgname-$pkgver
 
-builddir="$srcdir/$pkgname-$pkgver"
 build() {
 	cd "$builddir"
 	./configure --prefix=/usr \
-		--disable-qt4 \
-		--disable-scan-build \
+		--with-docdir=/usr/share/doc/$pkgname \
+		--enable-lite-build \
+		--disable-doc-build \
+		--disable-gui-build \
 		--disable-fax-build \
 		--disable-dbus-build \
 		--enable-cups-ppd-install \
-		--enable-foomatic-ppd-install \
-		--enable-foomatic-drv-install \
+		--enable-udev_sysfs_rules \
 		|| return 1
 	make || return 1
 }
 
 package() {
-	make -j1 -C "$builddir" DESTDIR="$pkgdir" install || return 1
-	cd "$pkgdir"
-	rm -rf etc/sane.d etc/xdg usr/share/hal etc/init.d etc/udev
+	cd "$builddir"
+	make -j1 DESTDIR="$pkgdir" install || return 1
+	for dir in usr/bin etc/sane.d usr/share/hal usr/lib/systemd usr/share/$pkgname; do
+		rm -fr  "$pkgdir"/$dir
+	done
+}
+
+udev() {
+	pkgdesc="HPLIP udev rules"
+	install_if="$pkgname=$pkgver-r$pkgrel udev"
+	mkdir -p "$subpkgdir"/etc
+	mv "$pkgdir"/etc/udev "$subpkgdir"/etc
+}
+
+sane() {
+	depends="sane"
+	pkgdesc="SANE backend for HP multi-function peripherals"
+	mkdir -p "$subpkgdir"/usr/lib \
+		"$subpkgdir"/etc/sane.d/dll.d
+	mv "$pkgdir"/usr/lib/sane "$subpkgdir"/usr/lib
+	echo "hpaio" > "$subpkgdir"/etc/sane.d/dll.d/hpaio
 }
 
-md5sums="dd3bf0ecd410e6961abd86407b7f802f  hplip-3.16.10.tar.gz
+md5sums="7d187c3142ba323a3021767d333ad9f4  hplip-3.16.11.tar.gz
 a9cd9a64bc4e1ba14ef221efdcb0d940  fix-includes.patch
-65bddd5951bd2d12a26bbf7b51bcab27  disable_upgrade.patch"
-sha256sums="45b44e0334f76069511b0b2a40885a12d055013bc95a62250de5d1abc10dee84  hplip-3.16.10.tar.gz
+141b8ccbc117990e5dfbaaa5b354366f  fix-paths.patch"
+sha256sums="f6e20cacb4891e4e60fc5de2213a10f8d0c68840f9b511aa38cfca0cb29f9b24  hplip-3.16.11.tar.gz
 9a1d8b509d7bcacb03895529e3c6c83704ea784444bf0deae75ac59feb9e32b2  fix-includes.patch
-b3f8d91a07216e6aad4dbfdb79ae19496b03c29f56444059b9b93a32c86ceb8e  disable_upgrade.patch"
-sha512sums="2aa8cdd7ec0aa042f4c159f4db6bf80e0cc4ffd30f060814d44fcce2f2800dc0195c26ccc6f8d10dc9c62b3fcbc0befcf68f3ad6a5a81f63ab6a26a25686bbad  hplip-3.16.10.tar.gz
+806380485921019ef8e09fe877be75f16153e6ebd0bc1e04b48f47495f4c2a47  fix-paths.patch"
+sha512sums="c59d50adbcc930543b828a81f055653e140987ac9d0b5232cfe6f657078565a3f2a0c96fc13f0dbb575916d59ca76a3447da7cf023bafef900375d4e53d9e180  hplip-3.16.11.tar.gz
 173f0c2bbf0daefc717282bf125d3fd94b3914da0754078c45b58b09ab841672aae9238ca8fc0448486a871e40fc50f960da17c1e07ad3f04053d217ed634498  fix-includes.patch
-57e14c581e82a0dd44344524dc4eb4d845843cf0775b60475541cabfb9d67a4fdab501be3977f8ca9888fbbee4d0392e6068c788e7a85cf4c1add5848be21ae7  disable_upgrade.patch"
+a4cd7692c6c0c393f0ac22f6f29f8434ee8362a0b0d7a5aade5cac25256bb0f013f03f2c909fc5923784f6f2828f7b4cc7afa7a93e1ed1aa5c7887d49a794b4f  fix-paths.patch"
diff --git a/testing/hplip/disable_upgrade.patch b/testing/hplip/disable_upgrade.patch
deleted file mode 100644
index f95b4dfe4b..0000000000
--- a/testing/hplip/disable_upgrade.patch
+++ /dev/null
_at_@ -1,14 +0,0 @@
---- a/upgrade.py	2013-10-31 12:46:54.000000000 +0100
-+++ b/upgrade.py	2013-12-04 14:58:03.000000000 +0100
-_at_@ -134,6 +134,11 @@ except getopt.GetoptError, e:
- if os.getenv("HPLIP_DEBUG"):
-     log.set_level('debug')
- 
-+
-+log.error("HPLIP upgrade is disabled by Alpine Linux for security reasons, see https://bugs.archlinux.org/task/38083")
-+clean_exit(1)
-+
-+
- for o, a in opts:
-     if o in ('-h', '--help'):
-         usage()
diff --git a/testing/hplip/fix-paths.patch b/testing/hplip/fix-paths.patch
new file mode 100644
index 0000000000..5e926255cd
--- /dev/null
+++ b/testing/hplip/fix-paths.patch
_at_@ -0,0 +1,20 @@
+--- a/Makefile.in
++++ b/Makefile.in
+_at_@ -4827,7 +4827,7 @@
+ _at_HPLIP_BUILD_TRUE_at_dist_halpre_DATA = data/rules/20-hplip-devices.fdi
+ 
+ # hplip.conf
+-_at_HPLIP_BUILD_TRUE_at_hplip_confdir = /etc/hp
++_at_HPLIP_BUILD_TRUE_at_hplip_confdir = /etc/hplip
+ _at_HPLIP_BUILD_TRUE_at_hplip_conf_DATA = hplip.conf
+ 
+ #pstotiff filter
+_at_@ -4835,7 +4835,7 @@
+ _at_HPLIP_BUILD_TRUE_at_pstotiff_SCRIPTS = fax/filters/pstotiff
+ 
+ # hplip.state
+-_at_HPLIP_BUILD_TRUE_at_hplip_statedir = /var/lib/hp
++_at_HPLIP_BUILD_TRUE_at_hplip_statedir = /var/lib/hplip
+ _at_HPLIP_BUILD_TRUE_at_dist_hplip_state_DATA = 
+ _at_FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE_at_dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py
+ _at_FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE_at_cmddir = $(hplipdir)
-- 
2.11.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Tue Dec 13 2016 - 16:04:20 GMT