wok annotate wiringpi/receipt @ rev 16466
R-Pi: add wiringpi (GPIO tool and library)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Apr 22 02:05:54 2014 +0200 (2014-04-22) |
parents | |
children | fe06085e7586 |
rev | line source |
---|---|
pankso@16466 | 1 # SliTaz package receipt. |
pankso@16466 | 2 |
pankso@16466 | 3 PACKAGE="wiringpi" |
pankso@16466 | 4 GITHASH="f18c8f7204d6354220fd6754578b3daa43734e1b" |
pankso@16466 | 5 VERSION="${GITHASH:0:7}" |
pankso@16466 | 6 CATEGORY="system-tools" |
pankso@16466 | 7 SHORT_DESC="GPIO access library written in C for the Raspberry Pi/BCM2835." |
pankso@16466 | 8 MAINTAINER="pankso@slitaz.org" |
pankso@16466 | 9 LICENSE="LGPL" |
pankso@16466 | 10 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
pankso@16466 | 11 WEB_SITE="http://wiringpi.com/" |
pankso@16466 | 12 WGET_URL="git|git://git.drogon.net/wiringPi" |
pankso@16466 | 13 HOST_ARCH="arm" |
pankso@16466 | 14 |
pankso@16466 | 15 # Rules to configure and make the package. |
pankso@16466 | 16 compile_rules() |
pankso@16466 | 17 { |
pankso@16466 | 18 # Fixes: fancy paths in Makefile and do sym link manually |
pankso@16466 | 19 sed -i \ |
pankso@16466 | 20 -e s"#CC = gcc#CC = ${HOST_SYSTEM}-gcc#" \ |
pankso@16466 | 21 -e s"#DESTDIR=.*#DESTDIR=$DESTDIR#" \ |
pankso@16466 | 22 -e s"#PREFIX=.*#PREFIX=/usr#" */Makefile |
pankso@16466 | 23 |
pankso@16466 | 24 # First: WiringPi Library |
pankso@16466 | 25 cd ${src}/wiringPi |
pankso@16466 | 26 make || return 1 |
pankso@16466 | 27 sed -i '/libwiringPi.so$/'d Makefile |
pankso@16466 | 28 make install && cd ${DESTDIR}/usr/lib |
pankso@16466 | 29 ln -s libwiringPi.so.2.0 libwiringPi.so |
pankso@16466 | 30 |
pankso@16466 | 31 # Second: Devices Library |
pankso@16466 | 32 cd ${src}/devLib |
pankso@16466 | 33 sed -i \ |
pankso@16466 | 34 -e s'#^INCLUDE.*#INCLUDE = -I. -I${DESTDIR}/usr/include#' \ |
pankso@16466 | 35 -e '/libwiringPiDev.so$/'d Makefile |
pankso@16466 | 36 make || return 1 |
pankso@16466 | 37 make install && cd ${DESTDIR}/usr/lib |
pankso@16466 | 38 ln -s libwiringPiDev.so.2.0 libwiringPiDev.so |
pankso@16466 | 39 |
pankso@16466 | 40 # Last: GPIO Utility |
pankso@16466 | 41 cd ${src}/gpio |
pankso@16466 | 42 patch -p0 < ${stuff}/gpio-decodePin.patch |
pankso@16466 | 43 mkdir -p ${DESTDIR}/usr/bin |
pankso@16466 | 44 make && make install |
pankso@16466 | 45 } |
pankso@16466 | 46 |
pankso@16466 | 47 # SliTaz package testsuite |
pankso@16466 | 48 testsuite() { |
pankso@16466 | 49 readelf -Ah ${install}/usr/bin/gpio || return 1 |
pankso@16466 | 50 } |
pankso@16466 | 51 |
pankso@16466 | 52 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@16466 | 53 genpkg_rules() |
pankso@16466 | 54 { |
pankso@16466 | 55 mkdir -p $fs/usr/lib |
pankso@16466 | 56 cp -a ${install}/usr/lib/*.so* $fs/usr/lib |
pankso@16466 | 57 cp -a ${install}/usr/bin $fs/usr |
pankso@16466 | 58 } |