SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "sane-backends"

# SliTaz package receipt.

PACKAGE="sane-backends"
VERSION="1.0.22"
CATEGORY="system-tools"
SHORT_DESC="Scanner Access Now Easy."
MAINTAINER="pankso@slitaz.org"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://www.sane-project.org/"
WGET_URL="ftp://ftp2.sane-project.org/pub/sane/$PACKAGE-$VERSION/$TARBALL"

DEPENDS="libusb-compat jpeg tiff zlib libgphoto2 libv4l libltdl"
BUILD_DEPENDS="libusb-compat-dev jpeg-dev tiff-dev zlib-dev libv4l-dev \
libgphoto2-dev libtool"

# Rules to configure and make the package.
compile_rules()
{
    cd $src
    patch -Np1 -i $stuff/libv4l-0.8.3.patch
    # fix https://bugs.archlinux.org/task/26114
    patch -Np1 -i $stuff/xerox_mfp_fix_usb_devices.patch
    ./configure \
        --prefix=/usr \
        --sysconfdir=/etc \
        --mandir=/usr/share/man \
        $CONFIGURE_ARGS &&
    make &&
    make -j 1 DESTDIR=$DESTDIR install

    # copy the missing udev rule
    [ ! -d $DESTDIR/etc/udev/rules.d ] && mkdir -p $DESTDIR/etc/udev/rules.d
    cp -a $src/tools/udev/libsane.rules $DESTDIR/etc/udev/rules.d/55-sane.rules
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/lib $fs/usr/share \
             $fs/var/lock/sane $fs/etc/sane.d
    
    cp -a $_pkg/etc/sane.d $fs/etc
    cp -a $_pkg/usr/bin $fs/usr
    cp -a $_pkg/usr/sbin $fs/usr
    cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
    cp -a $_pkg/usr/lib/sane $fs/usr/lib
    cp -a $_pkg/usr/share/sane $fs/usr/share
    
    # fix groups/permissions on /var/lock/sane ; add it to scanner group
    chmod 775 "$fs/var/lock/sane"
    chgrp 96 "$fs/var/lock/sane"
   
    # fix hp officejets
    echo "hpaio" >> "$fs/etc/sane.d/dll.conf"
}

post_install()
{
    local root
    root=$1
    
    tazpkg reconfigure udev --root=$root
    
    # add group scanner
    if ! grep -q scanner $root/etc/group ; then
        chroot "$root/" addgroup -g 96 scanner
    fi
    
    echo " ADD yourself to group scanner to use sane: addgroup tux scanner"
}

post_remove()
{
    chroot "$1/" delgroup scanner & >/dev/null
}
3382 packages and 430813 files in stable database (Mon Mar 4 17:53:49 2019)