wok-6.x view python-rpi-adafruit/receipt @ rev 24476
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Feb 18 09:29:30 2022 +0000 (2022-02-18) |
parents | 9689f1b75619 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="python-rpi-adafruit"
4 GITHASH="99a2955eb6ddc81998ade7359ebb505fb70919d0"
5 VERSION=${GITHASH:0:6}
6 CATEGORY="system-tools"
7 SHORT_DESC="Adafruit Industries Python code for the RPi"
8 MAINTAINER="pankso@slitaz.org"
9 LICENSE="BSD"
10 SOURCE="python-adafruit-code"
11 TARBALL="$PACKAGE-$VERSION.tar.zip"
12 WEB_SITE="https://www.adafruit.com/"
13 WGET_URL="https://codeload.github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/zip/$GITHASH"
14 HOST_ARCH="arm"
16 # Leds support for now
17 DEPENDS="python python-smbus i2c-tools slitaz-arm-rpi"
19 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/commits/master 2>/dev/null | \
23 sed '/commits_list_item/!d;s|.*commits/\(......\).*|\1|;q'
24 }
26 # Rules to gen a SliTaz package suitable for Tazpkg.
27 genpkg_rules()
28 {
29 python="$fs/usr/lib/python2.7"
30 mkdir -p ${python} ${fs}/usr/share/adafruit
31 cp -a ${src}/Adafruit_LEDBackpack ${fs}/usr/share/adafruit/LEDBackpack
32 # Can be imported to write custom code
33 cp ${src}/Adafruit_I2C/* ${python}
34 mv ${fs}/usr/share/adafruit/LEDBackpack/Adafruit_7Segment.py ${python}
35 mv ${fs}/usr/share/adafruit/LEDBackpack/Adafruit_8x8.py ${python}
36 mv ${fs}/usr/share/adafruit/LEDBackpack/Adafruit_LEDBackpack.py ${python}
37 rm ${fs}/usr/share/adafruit/LEDBackpack/Adafruit_I2C.py
38 }