PKGBUILDs/alarm/wiringpi/PKGBUILD
2012-10-13 16:13:50 -06:00

61 lines
3 KiB
Bash

# Maintainer: Mike Brown <mbrown@archlinuxarm.org>
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
buildarch=18
_pkgname='wiringPi'
pkgname=wiringpi
pkgver=20120726
pkgrel=2
pkgdesc="WiringPi: An implementation of most of the Arduino Wiring functions for the Raspberry Pi"
arch=('arm')
license=('LGPL')
url="https://projects.drogon.net/raspberry-pi/wiringpi/"
install=${pkgname}.install
source=(http://project-downloads.drogon.net/files/${_pkgname}.tgz)
md5sums=('b3c6b79c525e0d1db436445f7aabe716')
build() {
cd "${srcdir}/${_pkgname}/wiringPi"
make
cd "${srcdir}/${_pkgname}/gpio"
make INCLUDE+="-I${srcdir}/${_pkgname}/wiringPi" LDFLAGS+="-L${srcdir}/${_pkgname}/wiringPi"
cd "${srcdir}/${_pkgname}/examples"
make INCLUDE+="-I${srcdir}/${_pkgname}/wiringPi" LDFLAGS+="-L${srcdir}/${_pkgname}/wiringPi"
}
package(){
cd "${srcdir}/${_pkgname}/wiringPi"
install -m 0755 -d "${pkgdir}/usr/lib"
install -m 0755 -d "${pkgdir}/usr/include"
install -m 0644 *.h "${pkgdir}/usr/include"
install -m 0644 libwiringPi.a "${pkgdir}/usr/lib"
cd "${srcdir}/${_pkgname}/gpio"
install -m 0755 -d "${pkgdir}/usr/bin"
install -m 4755 gpio "${pkgdir}/usr/bin"
mkdir -p "${pkgdir}/usr/share/man/man1"
install -m 0644 gpio.1 "${pkgdir}/usr/share/man/man1/"
cd "${srcdir}/${_pkgname}/examples"
install -m 0755 -d "${pkgdir}/usr/share/wiringpi/examples"
install -Dm750 "${srcdir}/wiringPi/examples/test1" "${pkgdir}/usr/share/wiringpi/examples/test1"
install -Dm750 "${srcdir}/wiringPi/examples/test2" "${pkgdir}/usr/share/wiringpi/examples/test2"
install -Dm750 "${srcdir}/wiringPi/examples/speed" "${pkgdir}/usr/share/wiringpi/examples/speed"
install -Dm750 "${srcdir}/wiringPi/examples/lcd" "${pkgdir}/usr/share/wiringpi/examples/lcd"
install -Dm750 "${srcdir}/wiringPi/examples/wfi" "${pkgdir}/usr/share/wiringpi/examples/wfi"
install -Dm750 "${srcdir}/wiringPi/examples/piface" "${pkgdir}/usr/share/wiringpi/examples/piface"
install -m 0755 -d "${pkgdir}/usr/share/wiringpi/examples/source_code"
install -Dm644 "${srcdir}/wiringPi/examples/test1.c" "${pkgdir}/usr/share/wiringpi/examples/source_code/test1.c"
install -Dm644 "${srcdir}/wiringPi/examples/test2.c" "${pkgdir}/usr/share/wiringpi/examples/source_code/test2.c"
install -Dm644 "${srcdir}/wiringPi/examples/speed.c" "${pkgdir}/usr/share/wiringpi/examples/source_code/speed.c"
install -Dm644 "${srcdir}/wiringPi/examples/lcd.c" "${pkgdir}/usr/share/wiringpi/examples/source_code/lcd.c"
install -Dm644 "${srcdir}/wiringPi/examples/wfi.c" "${pkgdir}/usr/share/wiringpi/examples/source_code/wfi.c"
install -Dm644 "${srcdir}/wiringPi/examples/piface.c" "${pkgdir}/usr/share/wiringpi/examples/source_code/piface.c"
install -Dm644 "${srcdir}/wiringPi/examples/Makefile" "${pkgdir}/usr/share/wiringpi/examples/source_code/Makefile"
install -Dm644 "${srcdir}/wiringPi/examples/COPYING.LESSER" "${pkgdir}/usr/share/wiringpi/examples/source_code/COPYING.LESSER"
install -Dm644 "${srcdir}/wiringPi.tgz" "${pkgdir}/usr/share/wiringpi/examples/source_code/wiringPi.tgz"
}