wok-current view sane-backends/receipt @ rev 25728

Merge wok for both arch and few updates
author Stanislas Leduc <shann@slitaz.org>
date Thu Dec 05 08:39:45 2024 +0000 (5 weeks ago)
parents 3ad63c8fc2f9
children
line source
1 # SliTaz package receipt.
3 PACKAGE="sane-backends"
4 VERSION="1.0.32"
5 CATEGORY="system-tools"
6 SHORT_DESC="Scanner Access Now Easy."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="http://www.sane-project.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="https://anduin.linuxfromscratch.org/BLFS/sane/$TARBALL"
14 DEPENDS="jpeg libgphoto2 libltdl libusb-compat libv4l tiff zlib"
15 BUILD_DEPENDS="jpeg-dev libgphoto2-dev libtool libusb-compat-dev
16 libv4l-dev tiff-dev zlib-dev automake"
17 SUGGESTED="gocr imagemagick sane-backends-lang tesseract-ocr"
19 HOST_ARCH="i486 x86_64"
21 current_version()
22 {
23 wget -O - ${WGET_URL%/arch*}/tags 2>/dev/null | \
24 sed '/tar.gz/!d;s|.*/backends-\(.*\).tar.gz".*|\1|;q'
25 }
27 # Rules to configure and make the package.
28 compile_rules()
29 {
30 # 1.0.24: no longer needed
31 # sed -i 's|prefix}/doc|prefix}/share/doc|' configure
33 # 1.0.24: no longer needed
34 # patch -Np1 -i $stuff/libv4l-0.8.3.patch
36 # 1.0.24: no longer needed
37 # fix https://bugs.archlinux.org/task/26114
38 # patch -Np1 -i $stuff/xerox_mfp_fix_usb_devices.patch
40 ./configure \
41 --prefix=/usr \
42 --with-docdir=/usr/share/doc/$PACKAGE-$VERSION \
43 --sysconfdir=/etc \
44 --mandir=/usr/share/man \
45 $CONFIGURE_ARGS &&
46 make &&
47 make -j 1 DESTDIR=$DESTDIR install
49 # copy the missing udev rule
50 [ ! -d $DESTDIR/etc/udev/rules.d ] &&
51 mkdir -p $DESTDIR/etc/udev/rules.d
52 cp -a $src/tools/udev/libsane.rules \
53 $DESTDIR/etc/udev/rules.d/55-sane.rules
54 }
56 # Rules to gen a SliTaz package suitable for Tazpkg.
57 genpkg_rules()
58 {
59 mkdir -p $fs/etc/sane.d
60 mkdir -p $fs/usr/lib
61 mkdir -p $fs/usr/share
62 mkdir -p $fs/var/lock/sane
63 mkdir -p $fs/var/www/tazpanel/lib
64 mkdir -p $fs/var/www/tazpanel/menu.d/hardware
65 mkdir -p $fs/var/www/tazpanel/report.d
66 mkdir -p $fs/var/www/tazpanel/styles/default/images
68 cp -a $install/etc/sane.d $fs/etc
70 cp -a $install/usr/bin $fs/usr
71 cp -a $install/usr/sbin $fs/usr
72 cp -a $install/usr/lib/*.so* $fs/usr/lib
73 cp -a $install/usr/lib/sane $fs/usr/lib
74 cp -a $install/usr/share/sane $fs/usr/share
76 cp $stuff/tazpanel/sane.cgi $fs/var/www/tazpanel/
77 cp $stuff/tazpanel/sane $fs/var/www/tazpanel/report.d/
78 cp $stuff/tazpanel/crop.js $fs/var/www/tazpanel/lib/
79 cp $stuff/tazpanel/drag.gif $fs/var/www/tazpanel/styles/default/images/
80 ln -s ../../sane.cgi $fs/var/www/tazpanel/menu.d/hardware/sane
82 # fix groups and permissions on /var/lock/sane ; add it to scanner group
83 chmod 775 "$fs/var/lock/sane"
84 chgrp 96 "$fs/var/lock/sane"
86 # fix hp officejets
87 echo "hpaio" >> "$fs/etc/sane.d/dll.conf"
88 }
90 post_install()
91 {
92 tazpkg reconfigure udev --root="$1"
94 # add group scanner
95 if ! grep -q scanner "$1/etc/group"
96 then
97 chroot "$1/" addgroup -g 96 scanner
98 fi
100 chroot "$1/" chgrp scanner /usr/bin/scanimage
101 chmod 4750 $1/usr/bin/scanimage
103 echo
104 echo " ADD user(s) to group scanner to use sane: addgroup <user> scanner"
106 rm -f "$1"/var/cache/tazpanel/* 2> /dev/null
107 [ -e "$1/var/www/tazpanel/tmp" ] ||
108 ln -s /tmp "$1/var/www/tazpanel/tmp"
109 }
111 post_remove()
112 {
113 # delete group scanner
114 chroot "$1/" delgroup scanner & >/dev/null
115 }