1 # Maintainer: PyroPeter <googlemail.com@abi1789>
3 pkgname=hplip-plugin-all
7 pkgdesc="Binary plugin for HPs hplip printer driver library"
9 url="http://hplipopensource.com/"
10 license=('unknown: proprietary')
11 makedepends=(python2 pygobject dbus-python)
12 depends=('hplip-all='$pkgver)
13 source=("http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-$pkgver-plugin.run")
14 md5sums=('33427017d5bb934e723601dc2796e6d8')
16 # http://hplip.sourceforge.net/plugin.conf
21 if [ -w /etc/hp/hplip.conf ]; then
22 echo "You should not make this package as root!!111!1"
26 # untargziping the makeself selfextracting archive
27 sh hplip-$pkgver-plugin.run --tar xvf
29 sed -i 's!$HOMEDIR!'$pkgdir'/usr/share/hplip!g' plugin.spec
30 sed -i 's!$RULESDIR!'$pkgdir'/etc/udev/rules.d!g' plugin.spec
32 sed -i 's!if mode == INTERACTIVE_MODE:!installPlugin()\nsys.exit(0)\n\0!' \
34 sed -i 's!sys.exit(1)!raise!' \
37 python2 plugin_install.py
39 while IFS= read -r -d '' link; do
40 linkdir="`dirname $link`"
41 linkdir="`readlink -e $linkdir`"
42 linktarget="`readlink -e $link`"
43 relpath="`python2 -c 'import sys,os.path; print os.path.relpath(sys.argv[1],sys.argv[2])' $linktarget $linkdir`"
44 ln -sf "$relpath" "$link"
45 done < <(find "$pkgdir" -type l -print0)