wok-current view libgphoto2/receipt @ rev 24462
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Feb 16 21:07:01 2022 +0000 (2022-02-16) |
parents | 9613ce9a98f2 |
children | 63c8af9d3a64 |
line source
1 # SliTaz package receipt.
3 PACKAGE="libgphoto2"
4 VERSION="2.5.24"
5 CATEGORY="graphics"
6 TAGS="camera photo"
7 SHORT_DESC="Core library of gphoto2 to access photos from digital camera."
8 MAINTAINER="jozee@slitaz.org"
9 LICENSE="LGPL2.1"
10 WEB_SITE="http://www.gphoto.org"
12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
13 WGET_URL="$SF_MIRROR/gphoto/$TARBALL"
15 DEPENDS="hal jpeg libexif libltdl libusb libusb-compat"
16 BUILD_DEPENDS="jpeg jpeg-dev libexif libexif-dev libtool \
17 libusb libusb-compat libusb-compat-dev libusb-dev pkg-config"
19 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - https://sourceforge.net/projects/gphoto/files/libgphoto/ 2>/dev/null | \
23 sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
24 sed '/scope="row/!d;s|.*/libgphoto/||;s|/.*||;q'
25 }
27 # Rules to configure and make the package.
28 compile_rules()
29 {
30 ./configure \
31 --prefix=/usr \
32 udevscriptdir=/lib/udev \
33 --with-camlibs=everything \
34 --with-exif \
35 --disable-static \
36 $CONFIGURE_ARGS &&
37 make -j 1 &&
38 make install
39 }
41 # Rules to gen a SliTaz package suitable for Tazpkg.
42 genpkg_rules()
43 {
44 mkdir -p \
45 $fs/usr/lib/$PACKAGE \
46 $fs/usr/share \
47 $fs/lib \
48 $fs/usr/share/hal/fdi/information/20thirdparty \
49 $fs/etc/udev/rules.d
51 cp -a $install/usr/bin $fs/usr
52 cp -a $install/usr/lib/$PACKAGE $fs/usr/lib
53 cp -a $install/usr/lib/${PACKAGE}_port $fs/usr/lib
54 cp -a $install/usr/lib/*so* $fs/usr/lib
55 cp -a $install/usr/share/$PACKAGE $fs/usr/share
56 cp -a $install/lib/udev $fs/lib
58 # remove all archive files
59 find $fs/usr/lib -name "*.*a" -exec rm -f {} \; 2> /dev/null
61 # fix permissions
62 chmod +x $fs/lib/udev/check*
63 chmod +x $fs/usr/bin/gphoto2*
64 }
66 post_install()
67 {
68 HAL_FDI="$1/usr/share/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi"
69 UDEV_RULE="$1/etc/udev/rules.d/70-libgphoto2.rules"
70 CAM_LIST="$1/usr/lib/libgphoto2/print-camera-list"
72 # Let print-camera-list find libgphoto2.so
73 export LD_LIBRARY_PATH="$1/usr/lib"
74 # Let libgphoto2 find its camera-modules before running print-camera-list
75 export CAMLIBS="$1/usr/lib/libgphoto2/$VERSION"
77 # HAL file
78 "$CAM_LIST" hal-fdi > "$HAL_FDI" || return 1
80 #udev rule
81 "$CAM_LIST" udev-rules version 0.98 group camera mode 0660 > "$UDEV_RULE" || return 1
83 tazpkg reconfigure udev --root="$1"
85 # add group camera
86 if ! grep -q camera "$1/etc/group"
87 then
88 chroot "$1/" addgroup -g 97 camera
89 fi
91 echo
92 echo "Don't forget to add your user id to group camera to use libgphoto2:"
93 echo " # addgroup <user id> camera"
94 }
96 post_remove()
97 {
98 chroot "$1/" delgroup camera
99 }