Skip to content

Commit

Permalink
Add support for debian building
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfandringa committed Mar 20, 2020
1 parent 5525b62 commit 8d55c41
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 18 deletions.
4 changes: 4 additions & 0 deletions People
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions debian-template/wiringPi/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Package: wiringPi
Version: 2.46
Section: libraries
Priority: optional
Architecture: armhf
Depends: libc6
Maintainer: Boby Lee <[email protected]>
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
5 changes: 5 additions & 0 deletions debian-template/wiringPi/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e
/bin/chown root.root /usr/bin/gpio
/bin/chmod 4755 /usr/bin/gpio
/sbin/ldconfig
2 changes: 2 additions & 0 deletions debian-template/wiringPi/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
/sbin/ldconfig
13 changes: 8 additions & 5 deletions devLib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions gpio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 9 additions & 5 deletions wiringPi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -204,6 +207,7 @@ OBJ = $(SRC:.c=.o)

all: $(DYNAMIC)


.PHONY: static
static:
$Q cat noMoreStatic
Expand Down Expand Up @@ -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:
Expand Down
11 changes: 7 additions & 4 deletions wiringPiD/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8d55c41

Please sign in to comment.