aurpkg/hplip-plugin/PKGBUILD

72 lines
2.5 KiB
Bash

# Maintainer: andmars <andreas.marschall @ unitybox.de>
# Contributor: PyroPeter <googlemail.com @ abi1789>
# Contributor: Ivan Shapovalov <intelfx@intelfx.name>
pkgname=hplip-plugin
pkgver=3.22.6
pkgrel=1
pkgdesc="Binary plugin for HPs hplip printer driver library"
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
url="https://developers.hp.com/hp-linux-imaging-and-printing/binary_plugin.html"
license=('custom:proprietary')
depends=("hplip>=$pkgver")
backup=(var/lib/hp/hplip.state)
#source=("http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-$pkgver-plugin.run")
source=("https://developers.hp.com/sites/default/files/hplip-$pkgver-plugin.run")
md5sums=('5bc2edf1ebd92b25b9d38f14ee353022')
prepare() {
sh "hplip-$pkgver-plugin.run" --target "$srcdir/hplip-$pkgver-plugin" --noexec
}
package(){
cd "$srcdir/hplip-$pkgver-plugin"
if [ $CARCH = "i686" ]; then
_arch='x86_32'
elif [ $CARCH = "x86_64" ]; then
_arch='x86_64'
elif [ $CARCH = "armv6h" ]; then
_arch='arm32'
elif [ $CARCH = "armv7h" ]; then
_arch='arm32'
elif [ $CARCH = "aarch64" ]; then
_arch='arm64'
fi
# Create folders
install -d "$pkgdir/usr/share/hplip/data/firmware"
install -d "$pkgdir/usr/share/hplip/fax/plugins"
install -d "$pkgdir/usr/share/hplip/prnt/plugins"
install -d "$pkgdir/usr/share/hplip/scan/plugins"
install -d "$pkgdir/usr/share/licenses/hplip-plugin"
install -d "$pkgdir/var/lib/hp"
# Copy files
install -m644 plugin.spec "$pkgdir/usr/share/hplip/"
install -m644 hp_laserjet_*.fw.gz "$pkgdir/usr/share/hplip/data/firmware/"
install -m755 fax_marvell-"$_arch".so "$pkgdir/usr/share/hplip/fax/plugins/"
install -m755 hbpl1-"$_arch".so "$pkgdir/usr/share/hplip/prnt/plugins/"
install -m755 lj-"$_arch".so "$pkgdir/usr/share/hplip/prnt/plugins/"
install -m755 bb_*-"$_arch".so "$pkgdir/usr/share/hplip/scan/plugins/"
install -m644 license.txt "$pkgdir/usr/share/licenses/hplip-plugin/"
# Create hplip.state used by hplip-tools
cat << EOF > hplip.state
[plugin]
installed = 1
eula = 1
version = $pkgver
EOF
install -m644 hplip.state "$pkgdir/var/lib/hp"
# Create symlinks
find "$pkgdir/usr/share/hplip" -type f -name "*.so" | while read f; do
lib_dir="${f%/*}"
lib_name="${f##*/}"
ln -vsf "$lib_name" "$lib_dir/${lib_name%%-*}.so"
done
}
# Note: to check the install, perform: hp-diagnose_plugin