wok view libgphoto2/receipt @ rev 4968

fix: add camera group in libgphoto2
author Rohit Joshi <jozee@slitaz.org>
date Tue Feb 23 16:06:09 2010 +0000 (2010-02-23)
parents 1eb70625402e
children 8752c40cc534
line source
1 # SliTaz package receipt.
3 PACKAGE="libgphoto2"
4 VERSION="2.4.6"
5 CATEGORY="graphics"
6 SHORT_DESC="core library of gphoto2 to access photos from digital camera"
7 MAINTAINER="jozee@slitaz.org"
8 DEPENDS="libexif jpeg libusb libusb-compat"
9 BUILD_DEPENDS="jpeg-dev libexif-dev libtool libexif jpeg libusb libusb-dev libusb-compat libusb-compat-dev"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WEB_SITE="http://www.gphoto.org"
12 WGET_URL="$SF_MIRROR/gphoto/$TARBALL"
13 TAGS="camera photo"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 ./configure --prefix=/usr udevscriptdir=/lib/udev \
21 --with-exif --disable-static &&
22 make &&
23 make DESTDIR=$PWD/_pkg install
25 }
27 # Rules to gen a SliTaz package suitable for Tazpkg.
28 genpkg_rules()
29 {
30 mkdir -p $fs/usr/lib/$PACKAGE $fs/usr/share \
31 $fs/lib \
32 $fs/usr/share/hal/fdi/information/20thirdparty \
33 $fs/etc/udev/rules.d
34 cp -a $_pkg/usr/bin $fs/usr
35 cp -a $_pkg/usr/lib/$PACKAGE $fs/usr/lib
36 cp -a $_pkg/usr/lib/${PACKAGE}_port $fs/usr/lib
37 cp -a $_pkg/usr/lib/udev $fs/usr/lib
38 cp -a $_pkg/usr/lib/*so* $fs/usr/lib
39 cp -a $_pkg/usr/share/$PACKAGE $fs/usr/share
40 cp -a $_pkg/lib/udev $fs/lib
42 # rm archive files
43 rm -f $fs/usr/lib/libgphoto2/$VERSION/*.a
45 # fix permissions
46 chmod +x $fs/lib/udev/check*
47 chmod +x $fs/usr/bin/gphoto2*
49 HAL_FDI="usr/share/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi"
50 UDEV_RULE="etc/udev/rules.d/70-libgphoto2.rules"
51 CAM_LIST="usr/lib/libgphoto2/print-camera-list"
53 # Let print-camera-list find libgphoto2.so
54 export LD_LIBRARY_PATH="$fs/usr/lib"
55 # Let libgphoto2 find its camera-modules before running print-camera-list
56 export CAMLIBS="$fs/usr/lib/libgphoto2/$VERSION"
58 # HAL file
59 "$fs/$CAM_LIST" hal-fdi > "$fs/$HAL_FDI" || return 1
61 #udev rule
62 "$fs/$CAM_LIST" udev-rules version 0.98 group camera mode 0660 > "$fs/$UDEV_RULE" || return 1
64 }
66 post_install()
67 {
68 local root
69 root=$1
71 # add group camera
72 if [ ! grep -q camera $root/etc/group ]; then
73 addgroup -g 97 camera
74 fi
76 echo "Don't forget to add yourself to group camera to use libgphoto2: addgroup tux camera"
77 }
79 post_remove()
80 {
81 delgroup camera & >/dev/null
82 }