wok view usb-modeswitch/receipt @ rev 24436
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Feb 13 13:09:42 2022 +0000 (2022-02-13) |
parents | 53c1379e13fa |
children | e1e1678c5265 |
line source
1 # SliTaz package receipt.
3 PACKAGE="usb-modeswitch"
4 VERSION="2.5.2"
5 PACKAGE_DATA="${PACKAGE}-data-20170806"
6 CATEGORY="system-tools"
7 TAGS="3g-modem"
8 SHORT_DESC="Handling Mode-Switching USB Devices on Linux."
9 MAINTAINER="pankso@slitaz.org"
10 LICENSE="GPL2"
11 WEB_SITE="https://www.draisberghof.de/usb_modeswitch/"
13 TARBALL="$PACKAGE-$VERSION.tar.bz2"
14 EXTRA_SOURCE_FILES="$PACKAGE_DATA.tar.bz2 usb_modeswitch.setup"
15 WGET_URL="http://www.draisberghof.de/usb_modeswitch/$TARBALL"
17 DEPENDS="libusb"
18 BUILD_DEPENDS="libusb-dev"
20 # What is the latest version available today?
21 current_version()
22 {
23 wget -O - ${WGET_URL%/*} 2>/dev/null | \
24 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
25 }
27 # Rules to configure and make the package.
28 compile_rules()
29 {
30 mkdir -p $DESTDIR/etc
31 mkdir -p $DESTDIR/lib/udev/usb_modeswitch
32 mkdir -p $DESTDIR/usr/share/man/man1
34 make &&
35 make install-static
37 # download data
38 [ -s $SOURCES_REPOSITORY/$PACKAGE_DATA.tar.bz2 ] ||
39 wget -P $SOURCES_REPOSITORY $WEB_SITE/$PACKAGE_DATA.tar.bz2
40 [ -d $PACKAGE_DATA ] ||
41 tar -xjf $SOURCES_REPOSITORY/$PACKAGE_DATA.tar.bz2
43 # download setup config
44 [ -s $SOURCES_REPOSITORY/usb_modeswitch.setup ] ||
45 wget -O $SOURCES_REPOSITORY/usb_modeswitch.setup \
46 $WEB_SITE/device_reference.txt
47 }
49 # Rules to gen a SliTaz package suitable for Tazpkg.
50 genpkg_rules()
51 {
52 mkdir -p $fs/usr
53 mkdir -p $fs/etc/usb_modeswitch.d
54 mkdir -p $fs/lib/udev/rules.d
56 cp -a $install/etc $fs
57 cp -a $install/lib $fs
58 cp -a $install/var $fs
59 cp -a $install/usr/sbin $fs/usr
60 cp -a $src/$PACKAGE_DATA/usb_modeswitch.d/* $fs/etc/usb_modeswitch.d
61 cp -a $src/$PACKAGE_DATA/40-usb_modeswitch.rules $fs/lib/udev/rules.d
62 cp -a $SOURCES_REPOSITORY/usb_modeswitch.setup $fs/etc/
63 chown -R root.root $fs
64 }