# SliTaz package receipt. PACKAGE="usb-modeswitch" VERSION="2.6.1" PACKAGE_DATA="${PACKAGE}-data-20191128" CATEGORY="system-tools" TAGS="3g-modem" SHORT_DESC="Handling Mode-Switching USB Devices on Linux." MAINTAINER="pankso@slitaz.org" LICENSE="GPL2" WEB_SITE="https://www.draisberghof.de/usb_modeswitch/" TARBALL="$PACKAGE-$VERSION.tar.bz2" EXTRA_SOURCE_FILES="$PACKAGE_DATA.tar.bz2 usb_modeswitch.setup" WGET_URL="https://www.draisberghof.de/usb_modeswitch/$TARBALL" DEPENDS="libusb" BUILD_DEPENDS="libusb-dev" # What is the latest version available today? current_version() { wget -O - ${WGET_URL%/*} 2>/dev/null | \ sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q } # Rules to configure and make the package. compile_rules() { mkdir -p $DESTDIR/etc mkdir -p $DESTDIR/lib/udev/usb_modeswitch mkdir -p $DESTDIR/usr/share/man/man1 make usb_modeswitch && make install # download data [ -s $SOURCES_REPOSITORY/$PACKAGE_DATA.tar.bz2 ] || wget -P $SOURCES_REPOSITORY $WEB_SITE/$PACKAGE_DATA.tar.bz2 [ -d $PACKAGE_DATA ] || tar -xjf $SOURCES_REPOSITORY/$PACKAGE_DATA.tar.bz2 # download setup config [ -s $SOURCES_REPOSITORY/usb_modeswitch.setup ] || wget -O $SOURCES_REPOSITORY/usb_modeswitch.setup \ $WEB_SITE/device_reference.txt } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr mkdir -p $fs/etc/usb_modeswitch.d mkdir -p $fs/lib/udev/rules.d cp -a $install/etc $fs cp -a $install/lib $fs cp -a $install/var $fs cp -a $install/usr/sbin $fs/usr cp -a $src/$PACKAGE_DATA/usb_modeswitch.d/* $fs/etc/usb_modeswitch.d cp -a $src/$PACKAGE_DATA/40-usb_modeswitch.rules $fs/lib/udev/rules.d cp -a $SOURCES_REPOSITORY/usb_modeswitch.setup $fs/etc/ chown -R root.root $fs }