wok rev 3457

Fix libgphoto2 udev/hal/permissions
author Rohit Joshi <jozee@slitaz.org>
date Mon Jun 15 15:15:09 2009 +0000 (2009-06-15)
parents c54710fa97f6
children df0a411febfa
files libgphoto2/receipt
line diff
     1.1 --- a/libgphoto2/receipt	Mon Jun 15 14:58:20 2009 +0000
     1.2 +++ b/libgphoto2/receipt	Mon Jun 15 15:15:09 2009 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="libgphoto2"
     1.7 -VERSION="2.4.5"
     1.8 +VERSION="2.4.6"
     1.9  CATEGORY="graphics"
    1.10  SHORT_DESC="core library of gphoto2 to access photos from digital camera"
    1.11  MAINTAINER="jozee@slitaz.org"
    1.12 @@ -17,7 +17,8 @@
    1.13  compile_rules()
    1.14  {
    1.15     	cd $src
    1.16 -	./configure --prefix=/usr --with-exif --disable-static &&
    1.17 +	./configure --prefix=/usr udevscriptdir=/lib/udev \
    1.18 +			--with-exif --disable-static &&
    1.19  	make &&
    1.20  	make DESTDIR=$PWD/_pkg install
    1.21  	
    1.22 @@ -26,12 +27,54 @@
    1.23  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.24  genpkg_rules()
    1.25  {
    1.26 -    mkdir -p $fs/usr/lib/$PACKAGE $fs/usr/share
    1.27 +    mkdir -p $fs/usr/lib/$PACKAGE $fs/usr/share \
    1.28 +	          $fs/lib \
    1.29 +			  $fs/usr/share/hal/fdi/information/20thirdparty \
    1.30 +			  $fs/etc/udev/rules.d
    1.31  	cp -a $_pkg/usr/bin $fs/usr
    1.32  	cp -a $_pkg/usr/lib/$PACKAGE $fs/usr/lib
    1.33  	cp -a $_pkg/usr/lib/${PACKAGE}_port $fs/usr/lib
    1.34  	cp -a $_pkg/usr/lib/udev $fs/usr/lib
    1.35  	cp -a $_pkg/usr/lib/*so* $fs/usr/lib
    1.36  	cp -a $_pkg/usr/share/$PACKAGE $fs/usr/share
    1.37 +	cp -a $_pkg/lib/udev $fs/lib
    1.38 +		
    1.39 +	# rm archive files
    1.40 +	rm -f $fs/usr/lib/libgphoto2/$VERSION/*.a
    1.41  	
    1.42 +	# fix permissions
    1.43 +	chmod +x $fs/lib/udev/check*
    1.44 +	chmod +x $fs/usr/bin/gphoto2*
    1.45 +	
    1.46 +	HAL_FDI="usr/share/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi"
    1.47 +	UDEV_RULE="etc/udev/rules.d/70-libgphoto2.rules"
    1.48 +	CAM_LIST="usr/lib/libgphoto2/print-camera-list"
    1.49 +
    1.50 +   # Let print-camera-list find libgphoto2.so
    1.51 +    export LD_LIBRARY_PATH="$fs/usr/lib"
    1.52 +   # Let libgphoto2 find its camera-modules before running print-camera-list
    1.53 +	export CAMLIBS="$fs/usr/lib/libgphoto2/$VERSION"
    1.54 +
    1.55 +  # HAL file
    1.56 +   "$fs/$CAM_LIST" hal-fdi > "$fs/$HAL_FDI" || return 1
    1.57 +  
    1.58 +    #udev rule
    1.59 +   "$fs/$CAM_LIST" udev-rules version 0.98 group camera mode 0660 > "$fs/$UDEV_RULE" || return 1
    1.60 +
    1.61  }
    1.62 +
    1.63 +post_install()
    1.64 +{
    1.65 +	local root
    1.66 +	root=$1
    1.67 +	
    1.68 +	# add group camera or plugdev
    1.69 +	getent group camera >/dev/null || addgroup -g 97 camera
    1.70 +	
    1.71 +	echo "Don't forget to add yourself to group camera to use libgphoto2: addgroup tux camera"
    1.72 +}
    1.73 +
    1.74 +post_remove()
    1.75 +{
    1.76 +	delgroup camera & >/dev/null
    1.77 +}