#Packager: Dimitris Tzemos pkgname=hplip pkgver=3.18.7 pkgrel=1dj source=("https://downloads.sourceforge.net/${pkgname}/$pkgname-$pkgver.tar.gz" "hplip.no.upgrade.diff.gz" "setup.py.lc_all.c.diff.gz" "hplip.python3.shebang.diff.gz" "hplib-fix-install.patch") options=('nosrcpack' 'noautodotnew') doinst() { if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database usr/share/applications >/dev/null 2>&1 fi } slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "hplip (HP print/scan/fax support)" "HPLIP is an HP developed solution for printing, scanning, and faxing" "with HP inkjet and laser based printers in Linux. The HPLIP project" "provides printing support for more than 1400 HP printer models," "including Deskjet, Officejet, Photosmart, PSC (Print Scan Copy)," "Business Inkjet, LaserJet, and LaserJet MFP." "" "For more information, see: http://hplipopensource.com" ) build() { cd $startdir/src/$pkgname-$pkgver # Upgrades should not be done outside the package system: patch -p1 < $startdir/src/hplip.no.upgrade.diff || exit 1 # Set LC_ALL=C to fix issues with CUPS output parsing in hp-setup: patch -p1 < $startdir/src/setup.py.lc_all.c.diff || exit 1 # Fix a few .py files lacking #!/usr/bin/python3: patch -p1 < $startdir/src/hplip.python3.shebang.diff || exit 1 patch -p1 < $startdir/src/hplib-fix-install.patch || exit 1 # Fix udev rules for current versions of udev sed -i 's/SYSFS/ATTR/g' data/rules/*.rules # Fix ownership in udev rules file sed -i 's%OWNER="lp"%OWNER="root"%g' data/rules/*.rules find -name '*.py' -print0 | xargs -0 \ sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,' sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,' \ prnt/filters/hpps \ fax/filters/pstotiff export AUTOMAKE='automake --foreign' autoreconf --force --install CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ PYTHON=/usr/bin/python3 \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --with-cupsbackenddir=/usr/lib${LIBDIRSUFFIX}/cups/backend \ --with-cupsfilterdir=/usr/lib${LIBDIRSUFFIX}/cups/filter \ --sysconfdir=/etc \ --localstatedir=/var \ --docdir=/usr/doc/hplip-$pkgver \ --with-docdir=/usr/doc/hplip-$pkgver \ --with-htmldir=/usr/doc/hplip-$pkgver/html \ --with-hpppddir=/usr/share/ppd/HP \ --with-drvdir=/usr/share/cups/drv/HP \ --enable-hpijs-install \ --enable-shadow-build \ --enable-scan-build \ --disable-gui-build \ --disable-qt4 \ --enable-fax-build \ --enable-doc-build \ --enable-foomatic-rip-hplip-install \ --enable-pp-build \ --disable-foomatic-ppd-install \ --enable-foomatic-drv-install \ --enable-network-build=yes \ --enable-policykit \ --enable-cups-ppd-install \ --build=$arch-slackware-linux \ --host=$arch-slackware-linux \ || return 1 make -j $numjobs || return 1 make install DESTDIR=$startdir/pkg rulesdir=/lib/udev/rules.d || return 1 # Don't ship .la files: rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la # 3.16.8 is not making this directory even though several scripts # continue to make use of it: mkdir -p $startdir/pkg/var/lib/hp/ # No thanks, we don't replace/add files which are part of other packages rm -rf $startdir/pkg/etc/sane.d # We don't need the systray icon rm -rf $startdir/pkg/etc/xdg # No .desktop file either rm -rf $startdir/pkg/usr/share/applications }