### this file is sourced not run
PKGVER=1.26.1
PKGBUILD=1
PKGARCH=i686

# source: post BLFS 8.2 2018-06-08, modified and updated to latest

TARBALL=cups-filters-$PKGVER.tar.xz
MD5SUM=f6deaf21750898927d6091fd8b9fee00
SRC_URL=http://www.openprinting.org/download/cups-filters/$TARBALL
BUNDLE=

SLACKREQ='cups32 dbus32 glib32 libijs32 lcms2_32 poppler32 qpdf32 libjpeg-turbo32 libpng32 libtiff32 ghostscript32 mupdf32'
SLACKDESC="cups-filters-avahi32: cups-filters-avahi32 $PKGVER (CUPS backends and filters)  
cups-filters-avahi32:  
cups-filters-avahi32: This package contains additional backends (print/protocol 
cups-filters-avahi32: engine) and filters (=generic printer drivers) that extends the 
cups-filters-avahi32: capability of CUPS.  
cups-filters-avahi32:
cups-filters-avahi32: This one is built with avahi (Bonjour/zeroconf) support.
cups-filters-avahi32: 
cups-filters-avahi32: This contains 32-bit version of the libraries.
cups-filters-avahi32: 
cups-filters-avahi32:
"

### default pkg_download
### default pkg_prepare
### package - only collect the libraries
pkg_package() {
	rm -rf etc bin sbin usr/bin usr/sbin usr/include usr/share
}

### build
pkg_build() {
    cd /tmp/cups-filters*
    
    ./configure $CONFFLAGS --docdir=/usr/share/doc/cups-filters-$PKGVER \
            --with-gs-path=/usr/bin/gs \
            --with-pdftops-path=/usr/bin/pdftops \
            --with-pdftocairo-path=/usr/bin/pdftocairo --with-acroread-path=/usr/bin/acroread \
            --without-rcdir                             \
            --with-pdftops=pdftops                      \
            --enable-auto-setup-driverless              \
            --enable-ijs                                \
            --enable-opvp                               \
            --enable-pclm                               \
            --disable-static &&
#           --disable-dbus # dbus is always used, this only disables dbus for colord stuff

    # our ghostscript does have ps2write 
    cat >> config.h << "EOF"
#undef  HAVE_GHOSTSCRIPT_PS2WRITE
#define HAVE_GHOSTSCRIPT_PS2WRITE
EOF
	
	# build
	make $MAKEFLAGS && make install &&
	pkg_build_slackdesc
}
