#!/bin/bash # # Maintainer: Deposite Pirate source /usr/src/ports/Build/build.sh NAME=hplip VERSION=3.13.5 BUILD=1 DEPENDS=('ghostscript >= 9.06-1' 'snmp >= 5.7.2-1' 'dbus >= 1.6.8-1') OPTDEPENDS=('usb >= 1.0.15-1' 'cups >= 1.6.2-1' 'python >= 2.7.4-1') # Description cat > ${PKG}/install/slack-desc <> ${PKG}/install/doinst.sh </dev/null 2>&1 fi EOF # Sources SRCNAME[0]=${NAME} SRCVERS[0]=${VERSION} SRCPACK[0]=${URL[sf]}/${SRCNAME[0]}/${SRCNAME[0]}/${SRCVERS[0]}/${SRCNAME[0]}-${SRCVERS[0]}.tar.gz SRCCOPY[0]="GPL2 BSD3 MIT" build0() { find . -type f -exec sed -i 's~^#.*env python~#!/usr/bin/env python2~' {} + find . -name "*.py" -exec sed -i '1s|#!/usr/bin/python|#!/usr/bin/python2|' {} + sed -i 's|python ./print.py|python2 ./print.py|' scan.py sed -i 's|python ./testpage.py|python2 ./testpage.py|' setup.py sed -i 's|python ./setup.py|python2 ./setup.py|' ui4/devmgr5.py ui4/nodevicesdialog.py sed -i 's|python %HOME%|python2 %HOME%|' base/utils.py sed -i 's|python ./plugin.py|python2 ./plugin.py|' base/pkit.py # https://bugs.archlinux.org/task/30085 - hack found in Gentoo # Use system foomatic-rip for hpijs driver instead of foomatic-rip-hplip # The hpcups driver does not use foomatic-rip ( cd ppd/hpijs for file in *.ppd.gz; do rm -f ${file}.temp gunzip -c ${file} | sed 's|foomatic-rip-hplip|foomatic-rip|g' | gzip > ${file}.temp mv ${file}.temp ${file} done ) #LIBS="-Wl,--as-needed $(pkg-config libusb --libs)" export PYTHON=python2 sed -i 's|/usr/lib/systemd/system|/usr/share/systemd/system|g' Makefile.{am,in} CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \ ./configure \ --build="${ARCH}-slackware-linux" \ --host="${ARCH}-slackware-linux" \ --disable-dependency-tracking \ --enable-static=no \ --enable-shared=yes \ --prefix=/usr \ --mandir="${SYS_DIR[man]}" \ --sysconfdir="${SYS_DIR[etc]}" \ --libdir="${SYS_DIR[lib]}" \ --localstatedir="${SYS_DIR[var]}" \ --docdir="${SYS_DIR[html]}/${SRCNAME[0]}" \ --with-docdir="${SYS_DIR[html]}/${SRCNAME[0]}" \ --with-cupsbackenddir="${SYS_DIR[lib]}/exec/cups/backend" \ --with-cupsfilterdir="${SYS_DIR[lib]}/exec/cups/filter" \ --with-hpppddir="${SYS_DIR[share]}/cups/model/HP" \ --with-drvdir="${SYS_DIR[share]}/cups/drv/hp" \ --disable-foomatic-rip-hplip-install \ --enable-foomatic-ppd-install \ --enable-foomatic-drv-install \ --enable-hpcups-install \ --enable-new-hpcups \ --enable-pp-build \ --enable-cups-ppd-install \ --enable-cups-drv-install \ --enable-hpijs-install \ --enable-network-build=yes \ --enable-shadow-build \ --disable-scan-build \ --enable-gui-build \ --enable-fax-build \ --enable-qt4 \ --enable-policykit \ --enable-udev-acl-rules #FIXME: --enable-scan-build when we have sane #FIXME: PAM make ${JOBS} make install DESTDIR="${PKG}" rulesdir="${SYS_DIR[udevrules]}" mv \ ${PKG}${SYS_DIR[etc]}/cron.daily/hplip_cron \ ${PKG}${SYS_DIR[etc]}/cron.daily/hplip # Log dir should not be world writeable chmod 775 \ ${PKG}${SYS_DIR[var]}/log/{hp,hp/tmp} rm -rf \ ${PKG}${SYS_DIR[etc]}/{sane.d,xdg} \ ${PKG}${SYS_DIR[share]}/hal }