wok view sane-backends/receipt @ rev 25616
Add emu2
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Aug 26 15:51:29 2023 +0000 (14 months ago) |
parents | 1b5e36efea1d |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="sane-backends"
4 VERSION="1.0.24"
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://gitlab.com/sane-project/backends/-/archive/RELEASE_${VERSION//./_}/backends-RELEASE_${VERSION//./_}.tar.gz"
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"
17 SUGGESTED="gocr imagemagick sane-backends-lang tesseract-ocr"
19 current_version()
20 {
21 wget -O - ${WGET_URL%/arch*}/tags 2>/dev/null | \
22 sed '/tar.gz/!d;s|.*/backends-\(.*\).tar.gz".*|\1|;q'
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 # 1.0.24: no longer needed
29 # sed -i 's|prefix}/doc|prefix}/share/doc|' configure
31 # 1.0.24: no longer needed
32 # patch -Np1 -i $stuff/libv4l-0.8.3.patch
34 # 1.0.24: no longer needed
35 # fix https://bugs.archlinux.org/task/26114
36 # patch -Np1 -i $stuff/xerox_mfp_fix_usb_devices.patch
38 ./configure \
39 --prefix=/usr \
40 --with-docdir=/usr/share/doc/$PACKAGE-$VERSION \
41 --sysconfdir=/etc \
42 --mandir=/usr/share/man \
43 $CONFIGURE_ARGS &&
44 make &&
45 make -j 1 DESTDIR=$DESTDIR install
47 # copy the missing udev rule
48 [ ! -d $DESTDIR/etc/udev/rules.d ] &&
49 mkdir -p $DESTDIR/etc/udev/rules.d
50 cp -a $src/tools/udev/libsane.rules \
51 $DESTDIR/etc/udev/rules.d/55-sane.rules
52 }
54 # Rules to gen a SliTaz package suitable for Tazpkg.
55 genpkg_rules()
56 {
57 mkdir -p $fs/etc/sane.d
58 mkdir -p $fs/usr/lib
59 mkdir -p $fs/usr/share
60 mkdir -p $fs/var/lock/sane
61 mkdir -p $fs/var/www/tazpanel/lib
62 mkdir -p $fs/var/www/tazpanel/menu.d/hardware
63 mkdir -p $fs/var/www/tazpanel/report.d
64 mkdir -p $fs/var/www/tazpanel/styles/default/images
66 cp -a $install/etc/sane.d $fs/etc
68 cp -a $install/usr/bin $fs/usr
69 cp -a $install/usr/sbin $fs/usr
70 cp -a $install/usr/lib/*.so* $fs/usr/lib
71 cp -a $install/usr/lib/sane $fs/usr/lib
72 cp -a $install/usr/share/sane $fs/usr/share
74 cp $stuff/tazpanel/sane.cgi $fs/var/www/tazpanel/
75 cp $stuff/tazpanel/sane $fs/var/www/tazpanel/report.d/
76 cp $stuff/tazpanel/crop.js $fs/var/www/tazpanel/lib/
77 cp $stuff/tazpanel/drag.gif $fs/var/www/tazpanel/styles/default/images/
78 ln -s ../../sane.cgi $fs/var/www/tazpanel/menu.d/hardware/sane
80 # fix groups and permissions on /var/lock/sane ; add it to scanner group
81 chmod 775 "$fs/var/lock/sane"
82 chgrp 96 "$fs/var/lock/sane"
84 # fix hp officejets
85 echo "hpaio" >> "$fs/etc/sane.d/dll.conf"
86 }
88 post_install()
89 {
90 tazpkg reconfigure udev --root="$1"
92 # add group scanner
93 if ! grep -q scanner "$1/etc/group"
94 then
95 chroot "$1/" addgroup -g 96 scanner
96 fi
98 chroot "$1/" chgrp scanner /usr/bin/scanimage
99 chmod 4750 $1/usr/bin/scanimage
101 echo
102 echo " ADD user(s) to group scanner to use sane: addgroup <user> scanner"
104 rm -f "$1"/var/cache/tazpanel/* 2> /dev/null
105 [ -e "$1/var/www/tazpanel/tmp" ] ||
106 ln -s /tmp "$1/var/www/tazpanel/tmp"
107 }
109 post_remove()
110 {
111 # delete group scanner
112 chroot "$1/" delgroup scanner & >/dev/null
113 }