diff --git a/People b/People index b339494..1123f9d 100644 --- a/People +++ b/People @@ -31,3 +31,7 @@ Andre Crone Rik Teerling Pointing out some silly mistooks in the I2C code... + +Dolf Andringa + Support for multiple SpiDev devices/ports + Debian build support diff --git a/build b/build index 7ba9c54..bed3864 100755 --- a/build +++ b/build @@ -115,14 +115,19 @@ fi if [ x$1 = "xdebian" ]; then here=`pwd` + echo "removing old libs" cd debian-template/wiringPi rm -rf usr + echo "building wiringPi" cd $here/wiringPi make install-deb + echo "building devLib" cd $here/devLib make install-deb INCLUDE='-I. -I../wiringPi' + echo "building gpio" cd $here/gpio make install-deb INCLUDE='-I../wiringPi -I../devLib' LDFLAGS=-L../debian-template/wiringPi/usr/lib + echo "Building deb package" cd $here/debian-template fakeroot dpkg-deb --build wiringPi mv wiringPi.deb wiringpi-`cat $here/VERSION`-1.deb diff --git a/debian-template/wiringPi/DEBIAN/control b/debian-template/wiringPi/DEBIAN/control new file mode 100644 index 0000000..1041c5e --- /dev/null +++ b/debian-template/wiringPi/DEBIAN/control @@ -0,0 +1,10 @@ +Package: wiringPi +Version: 2.46 +Section: libraries +Priority: optional +Architecture: armhf +Depends: libc6 +Maintainer: Boby Lee +Description: The wiringPi libraries for the OrangePi, headers and gpio command + Libraries to allow GPIO access on a Raspberry Pi from C and C++ + and BASIC programs as well as from the command-line diff --git a/debian-template/wiringPi/DEBIAN/postinst b/debian-template/wiringPi/DEBIAN/postinst new file mode 100755 index 0000000..4997e98 --- /dev/null +++ b/debian-template/wiringPi/DEBIAN/postinst @@ -0,0 +1,5 @@ +#!/bin/sh +set -e +/bin/chown root.root /usr/bin/gpio +/bin/chmod 4755 /usr/bin/gpio +/sbin/ldconfig diff --git a/debian-template/wiringPi/DEBIAN/postrm b/debian-template/wiringPi/DEBIAN/postrm new file mode 100755 index 0000000..4be8c58 --- /dev/null +++ b/debian-template/wiringPi/DEBIAN/postrm @@ -0,0 +1,2 @@ +#!/bin/sh +/sbin/ldconfig diff --git a/devLib/Makefile b/devLib/Makefile index cf665d6..e8637c7 100644 --- a/devLib/Makefile +++ b/devLib/Makefile @@ -25,6 +25,9 @@ VERSION=$(shell cat ../VERSION) DESTDIR?=/usr PREFIX?=/local +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(mkfile_path)))) + LDCONFIG?=ldconfig ifneq ($V,1) @@ -108,12 +111,12 @@ install-static: $(STATIC) .PHONY: install-deb install-deb: $(DYNAMIC) $Q echo "[Install Headers: deb]" - $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/include - $Q install -m 0644 $(HEADERS) ~/wiringPi/debian-template/wiringPi/usr/include + $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/include + $Q install -m 0644 $(HEADERS) $(CURDIR)/../debian-template/wiringPi/usr/include $Q echo "[Install Dynamic Lib: deb]" - install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/lib - install -m 0755 libwiringPiDev.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION) - ln -sf ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so + install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/lib + install -m 0755 libwiringPiDev.so.$(VERSION) $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION) + ln -sf $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION) $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPiDev.so .PHONY: uninstall uninstall: diff --git a/gpio/Makefile b/gpio/Makefile index 006bff9..51765c4 100755 --- a/gpio/Makefile +++ b/gpio/Makefile @@ -218,10 +218,10 @@ endif .PHONY: install-deb install-deb: gpio $Q echo "[Install: deb]" - $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/bin - $Q install -m 0755 gpio ~/wiringPi/debian-template/wiringPi/usr/bin - $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/share/man/man1 - $Q install -m 0644 gpio.1 ~/wiringPi/debian-template/wiringPi/usr/share/man/man1 + $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/bin + $Q install -m 0755 gpio $(CURDIR)/../debian-template/wiringPi/usr/bin + $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/share/man/man1 + $Q install -m 0644 gpio.1 $(CURDIR)/../debian-template/wiringPi/usr/share/man/man1 .PHONY: uninstall uninstall: diff --git a/wiringPi/Makefile b/wiringPi/Makefile index ee59fd7..42ab780 100755 --- a/wiringPi/Makefile +++ b/wiringPi/Makefile @@ -25,6 +25,9 @@ VERSION=$(shell cat ../VERSION) DESTDIR?=/usr PREFIX?=/local +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(mkfile_path)))) + LDCONFIG?=ldconfig ifneq ($V,1) @@ -204,6 +207,7 @@ OBJ = $(SRC:.c=.o) all: $(DYNAMIC) + .PHONY: static static: $Q cat noMoreStatic @@ -242,12 +246,12 @@ install: $(DYNAMIC) .PHONY: install-deb install-deb: $(DYNAMIC) $Q echo "[Install Headers: deb]" - $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/include - $Q install -m 0644 $(HEADERS) ~/wiringPi/debian-template/wiringPi/usr/include + $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/include + $Q install -m 0644 $(HEADERS) $(CURDIR)/../debian-template/wiringPi/usr/include $Q echo "[Install Dynamic Lib: deb]" - install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/lib - install -m 0755 libwiringPi.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPi.so.$(VERSION) - ln -sf ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPi.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPi.so + install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/lib + install -m 0755 libwiringPi.so.$(VERSION) $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPi.so.$(VERSION) + ln -sf $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPi.so.$(VERSION) $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPi.so .PHONY: uninstall uninstall: diff --git a/wiringPiD/Makefile b/wiringPiD/Makefile index 6b2cc9e..a3fae44 100644 --- a/wiringPiD/Makefile +++ b/wiringPiD/Makefile @@ -25,6 +25,9 @@ DESTDIR?=/usr PREFIX?=/local +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(mkfile_path)))) + ifneq ($V,1) Q ?= @ endif @@ -78,10 +81,10 @@ install: wiringpid .PHONY: install-deb install-deb: gpio $Q echo "[Install: deb]" - $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/bin - $Q install -m 0755 gpio ~/wiringPi/debian-template/wiringPi/usr/bin - $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/man/man1 - $Q install -m 0644 gpio.1 ~/wiringPi/debian-template/wiringPi/man/man1 + $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/bin + $Q install -m 0755 gpio $(CURDIR)/../debian-template/wiringPi/usr/bin + $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/man/man1 + $Q install -m 0644 gpio.1 $(CURDIR)/../debian-template/wiringPi/man/man1 .PHONY: uninstall uninstall: