python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / hplip / template
blob108cd88b382966231aa5f7f19f5bfd103dc01270
1 # Template file for 'hplip'
2 pkgname=hplip
3 version=3.18.4
4 revision=1
5 build_style=gnu-configure
6 configure_args="
7  --enable-gui-build
8  --disable-qt4
9  --enable-qt5
10  --disable-foomatic-rip-hplip-install
11  --enable-foomatic-ppd-install
12  --enable-hpcups-install
13  --enable-new-hpcups
14  --enable-cups-ppd-install
15  --enable-cups-drv-install
16  --enable-hpijs-install
17  --enable-foomatic-drv-install
18  --enable-pp-build
19  --with-mimedir=/usr/share/cups/mime"
20 hostmakedepends="pkg-config automake libtool python"
21 makedepends="libressl-devel python-devel libxml2-python cups-devel sane-devel
22  ghostscript-devel net-snmp-devel libusb-devel libjpeg-turbo-devel dbus-devel"
23 depends="python-gobject2 python-dbus desktop-file-utils
24  foomatic-db foomatic-db-engine"
25 conf_files="/etc/hp/hplip.conf"
26 make_dirs="/var/lib/hp 0755 root root"
27 pycompile_dirs="usr/share/hplip"
28 short_desc="HP Linux Imaging and Printing"
29 maintainer="Juan RP <xtraeme@voidlinux.eu>"
30 license="GPL-2.0-only, BSD-3-Clause, MIT"
31 homepage="https://developers.hp.com/hp-linux-imaging-and-printing"
32 distfiles="${SOURCEFORGE_SITE}/hplip/hplip/${version}/hplip-${version}.tar.gz"
33 checksum=0a6a019cba53da5d1055d865afa04438d3651f4f4618dd555e6c1949be71e824
34 conflicts="hplip-gui"
36 CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/libusb-1.0 -I${XBPS_CROSS_BASE}/usr/include/python2.7"
38 pre_configure() {
39         export AUTOMAKE='automake --foreign'
40         libtoolize -f
41         autoreconf -fi || true
44 do_install() {
45         # remove wildcard install of ppd files to avoid errors when overwriting
46         sed -i Makefile -e "s;ppd/hpcups/\\*.ppd.gz;;g"
47         make rulesdir=/usr/lib/udev/rules.d DESTDIR=${DESTDIR} install
48         # remove config provided by sane and autostart of hp-daemon
49         rm -rf ${DESTDIR}/etc/{sane.d,xdg}
50         # remove unwanted files
51         rm -f ${DESTDIR}/usr/share/doc/hplip-${version}/{copyright,README_LIBJPG,COPYING}
52         # remove HAL .fdi file because HAL is no longer used
53         rm -rf ${DESTDIR}/usr/share/hal
54         rm -rf ${DESTDIR}/var
55         # remove systemd service file
56         rm -rf ${DESTDIR}/usr/lib/systemd
57         # save gui-version of hplip.conf
58         cp -p ${DESTDIR}/etc/hp/hplip.conf /tmp/hplip.conf
59         # adjust values to non-gui version
60         sed -i ${PKGDESTDIR}/etc/hp/hplip.conf \
61          -e "s/\(gui-build=\).*/\1no/" \
62          -e "s/\(ui-toolkit=\).*/\1no/" \
63          -e "s/\(qt5=\).*/\1no/"
64         # licenses
65         vlicense COPYING
66         vlicense copyright
69 hplip-gui_package() {
70         depends="python-gobject2 python-dbus desktop-file-utils
71          foomatic-db foomatic-db-engine python-PyQt5-dbus"
72         short_desc+=" (with GUI)"
73         conflicts="hplip"
74         pkg_install() {
75                 vmove usr/bin/hp-toolbox
76                 vmove usr/share/applications
77                 vmove usr/share/hplip/ui5
78                 vmove usr/share/hplip/data/images
79                 cp -a ${DESTDIR}/. ${PKGDESTDIR}/
80                 # restore gui-version of hplip.conf
81                 mv /tmp/hplip.conf ${PKGDESTDIR}/etc/hp/
82         }