wok-next annotate sane-backends/receipt @ rev 21715
Up cookutils (1146)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jul 28 07:53:22 2020 +0000 (2020-07-28) |
parents | d5aab818505e |
children |
rev | line source |
---|---|
al@20428 | 1 # SliTaz package receipt v2. |
pankso@648 | 2 |
pankso@648 | 3 PACKAGE="sane-backends" |
slaxemulator@8619 | 4 VERSION="1.0.22" |
pankso@648 | 5 CATEGORY="system-tools" |
al@20428 | 6 SHORT_DESC="Scanner Access Now Easy" |
al@21020 | 7 MAINTAINER="devel@slitaz.org" |
pascal@15000 | 8 LICENSE="GPL2" |
al@20428 | 9 WEB_SITE="http://www.sane-project.org/" |
al@20428 | 10 |
pankso@648 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
slaxemulator@12330 | 12 WGET_URL="ftp://ftp2.sane-project.org/pub/sane/$PACKAGE-$VERSION/$TARBALL" |
pankso@648 | 13 |
al@20604 | 14 BUILD_DEPENDS="libusb-compat-dev libjpeg-turbo-dev tiff-dev zlib-dev v4l-utils-dev \ |
al@20428 | 15 libgphoto2-dev libtool eudev-dev" |
al@21020 | 16 SPLIT="$package-dev" |
erjo@9948 | 17 |
al@20428 | 18 compile_rules() { |
pascal@19294 | 19 sed -i 's|prefix}/doc|prefix}/share/doc|' configure |
al@20534 | 20 |
al@20534 | 21 ./configure $CONFIGURE_ARGS && |
al@20604 | 22 fix libtool && |
pascal@1514 | 23 make && |
al@20534 | 24 make -j1 DESTDIR=$install install || return 1 |
slaxemulator@8619 | 25 |
slaxemulator@8619 | 26 # copy the missing udev rule |
al@20428 | 27 mkdir -p $install/etc/udev/rules.d |
al@20428 | 28 cp $src/tools/udev/libsane.rules $install/etc/udev/rules.d/55-sane.rules |
al@20428 | 29 |
al@20428 | 30 # TazPanel stuff |
al@20428 | 31 mkdir -p \ |
pascal@20605 | 32 $install/var/lock/sane \ |
al@20428 | 33 $install/var/www/tazpanel/lib/ \ |
al@20428 | 34 $install/var/www/tazpanel/report.d/ \ |
al@20428 | 35 $install/var/www/tazpanel/menu.d/hardware/ \ |
al@20428 | 36 $install/var/www/tazpanel/styles/default/images |
al@20428 | 37 cp $stuff/tazpanel/sane.cgi $install/var/www/tazpanel/ |
al@20428 | 38 cp $stuff/tazpanel/sane $install/var/www/tazpanel/report.d/ |
al@20428 | 39 cp $stuff/tazpanel/crop.js $install/var/www/tazpanel/lib/ |
al@20428 | 40 cp $stuff/tazpanel/drag.gif $install/var/www/tazpanel/styles/default/images/ |
al@20428 | 41 ln -s ../../sane.cgi $install/var/www/tazpanel/menu.d/hardware/sane |
al@20428 | 42 |
al@21020 | 43 # fix groups/permissions on /var/lock/sane; add it to scanner group |
al@20428 | 44 chmod 775 "$install/var/lock/sane" |
al@20428 | 45 chgrp 96 "$install/var/lock/sane" |
al@20428 | 46 |
al@20428 | 47 # fix hp officejets |
al@20428 | 48 echo "hpaio" >> "$install/etc/sane.d/dll.conf" |
pankso@648 | 49 } |
pankso@648 | 50 |
al@20428 | 51 genpkg_rules() { |
al@20428 | 52 case $PACKAGE in |
al@20428 | 53 sane-backends) |
al@20428 | 54 copy @std |
al@21080 | 55 DEPENDS="libusb-compat libjpeg-turbo libtiff zlib libgphoto2 v4l-utils libltdl" |
al@20428 | 56 SUGGESTED="imagemagick gocr tesseract-ocr" |
al@20428 | 57 ;; |
al@20428 | 58 *-dev) |
al@20428 | 59 copy @dev |
al@20428 | 60 DEPENDS="sane-backends" |
al@20428 | 61 ;; |
al@20428 | 62 esac |
pankso@648 | 63 } |
jozee@3468 | 64 |
al@20428 | 65 post_install_sane_backends() { |
al@20428 | 66 tazpkg reconfigure eudev --root="$1" |
al@20428 | 67 |
jozee@3468 | 68 # add group scanner |
al@21020 | 69 if ! grep -q scanner "$1/etc/group"; then |
pascal@18730 | 70 chroot "$1/" addgroup -g 96 scanner |
jozee@4966 | 71 fi |
pascal@20667 | 72 chroot "$1/" chgrp scanner /usr/bin/scanimage |
pascal@20667 | 73 chmod 4750 $1/usr/bin/scanimage |
al@20428 | 74 |
jozee@3468 | 75 echo " ADD yourself to group scanner to use sane: addgroup tux scanner" |
al@20428 | 76 |
al@20428 | 77 rm -f "$1"/var/cache/tazpanel/* 2>/dev/null |
pascal@18730 | 78 [ -e "$1/var/www/tazpanel/tmp" ] || |
pascal@18730 | 79 ln -s /tmp "$1/var/www/tazpanel/tmp" |
jozee@3468 | 80 } |
jozee@3468 | 81 |
al@20428 | 82 post_remove_sane_backends() { |
al@20534 | 83 chroot "$1/" delgroup scanner >/dev/null |
jozee@3468 | 84 } |