SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "brscan"

# SliTaz package receipt.

PACKAGE="brscan"
VERSION="0.2.4"
CATEGORY="office"
SHORT_DESC="Brother Scanner driver for SANE."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
SOURCE="$PACKAGE-src"
TARBALL="$SOURCE-$VERSION.tar.gz"
WEB_SITE="http://solutions.brother.com/linux/sol/printer/linux/sane_drivers.html"
WGET_URL="http://solutions.brother.com/Library/sol/printer/linux/rpmfiles/sane_source/$TARBALL"
TAGS="scanner driver"

DEPENDS="sane-backends ncurses"
BUILD_DEPENDS="file ncurses-dev libusb-compat-dev"

# Rules to configure and make the package.
compile_rules()
{
    cd $src/brscan
    ./configure --prefix=/usr --infodir=/usr/share/info \
    --sysconfdir=/etc --localstatedir=/var \
    --mandir=/usr/share/man \
    $CONFIGURE_ARGS || return 1
    sed -i '/mk_package/d' Makefile
    make -j1 && {
        cd ..
        mkdir -p $DESTDIR
        cp -a brscan $DESTDIR
    }
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/bin $fs/usr/lib/sane
    for i in BHL BHL2 BHL2FB BHLFB BHMFB BHminiFB YL4 YL4FB \
         ZL2 ZL2FB ZLe ZLeFB ; do
        mkdir -p $fs/usr/local/Brother/sane/GrayCmData/$i
        cp -a $install/brscan/libbrcolm/GrayCmData/$i/* \
            $fs/usr/local/Brother/sane/GrayCmData/$i
        chmod 644 $fs/usr/local/Brother/sane/GrayCmData/$i/*
    done
    cp $install/brscan/backend_brscan/.libs/libsane-brother.so.1.0.7 \
        $fs/usr/lib/sane/libsane-brother.so.1.0.7
    ln -s libsane-brother.so.1.0.7 $fs/usr/lib/sane/libsane-brother.so.1
    ln -s libsane-brother.so.1 $fs/usr/lib/sane/libsane-brother.so
    cp $install/brscan/libbrscandec/libbrscandec.so.1.0.0 \
        $fs/usr/lib/libbrscandec.so.1.0.0
    chmod 755 $fs/usr/lib/libbrscandec.so.1.0.0
    ln -s libbrscandec.so.1.0.0 $fs/usr/lib/libbrscandec.so.1
    ln -s libbrscandec.so.1 $fs/usr/lib/libbrscandec.so
    cp $install/brscan/libbrcolm/libbrcolm.so.1.0.0 \
        $fs/usr/lib/libbrcolm.so.1.0.0
    ln -s libbrcolm.so.1.0.0 $fs/usr/lib/libbrcolm.so.1
    ln -s libbrcolm.so.1 $fs/usr/lib/libbrcolm.so
    cp $install/brscan/mk_package/Brsane.ini \
        $fs/usr/local/Brother/sane/Brsane.ini
    cp $install/brscan/mk_package/brsanenetdevice.cfg \
        $fs/usr/local/Brother/sane/brsanenetdevice.cfg
    chmod 666 $fs/usr/local/Brother/sane/brsanenetdevice.cfg
    cp $install/brscan/netconfig/brsaneconfig \
        $fs/usr/local/Brother/sane/brsaneconfig
    ln -s /usr/local/Brother/sane/brsaneconfig $fs/usr/bin/brsaneconfig
    cp $install/brscan/mk_package/setupSaneScan \
        $fs/usr/local/Brother/sane/setupSaneScan
    chmod 755 $fs/usr/local/Brother/sane/setupSaneScan
}

# Pre and post install and remove commands for Tazpkg.
post_install()
{
    chroot "$1/" /usr/local/Brother/sane/setupSaneScan -i
}

pre_remove()
{
    chroot "$1/" /usr/local/Brother/sane/setupSaneScan -e
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)