Browse Source

Add support for debian building

pull/13/head
Dolf Andringa 5 years ago
parent
commit
8d55c41ec5
  1. 4
      People
  2. 5
      build
  3. 10
      debian-template/wiringPi/DEBIAN/control
  4. 5
      debian-template/wiringPi/DEBIAN/postinst
  5. 2
      debian-template/wiringPi/DEBIAN/postrm
  6. 13
      devLib/Makefile
  7. 8
      gpio/Makefile
  8. 14
      wiringPi/Makefile
  9. 11
      wiringPiD/Makefile

4
People

@ -31,3 +31,7 @@ Andre Crone
Rik Teerling Rik Teerling
Pointing out some silly mistooks in the I2C code... Pointing out some silly mistooks in the I2C code...
Dolf Andringa
Support for multiple SpiDev devices/ports
Debian build support

5
build

@ -115,14 +115,19 @@ fi
if [ x$1 = "xdebian" ]; then if [ x$1 = "xdebian" ]; then
here=`pwd` here=`pwd`
echo "removing old libs"
cd debian-template/wiringPi cd debian-template/wiringPi
rm -rf usr rm -rf usr
echo "building wiringPi"
cd $here/wiringPi cd $here/wiringPi
make install-deb make install-deb
echo "building devLib"
cd $here/devLib cd $here/devLib
make install-deb INCLUDE='-I. -I../wiringPi' make install-deb INCLUDE='-I. -I../wiringPi'
echo "building gpio"
cd $here/gpio cd $here/gpio
make install-deb INCLUDE='-I../wiringPi -I../devLib' LDFLAGS=-L../debian-template/wiringPi/usr/lib make install-deb INCLUDE='-I../wiringPi -I../devLib' LDFLAGS=-L../debian-template/wiringPi/usr/lib
echo "Building deb package"
cd $here/debian-template cd $here/debian-template
fakeroot dpkg-deb --build wiringPi fakeroot dpkg-deb --build wiringPi
mv wiringPi.deb wiringpi-`cat $here/VERSION`-1.deb mv wiringPi.deb wiringpi-`cat $here/VERSION`-1.deb

10
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 <leeboby@aliyun.com>
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
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

2
debian-template/wiringPi/DEBIAN/postrm

@ -0,0 +1,2 @@
#!/bin/sh
/sbin/ldconfig

13
devLib/Makefile

@ -25,6 +25,9 @@ VERSION=$(shell cat ../VERSION)
DESTDIR?=/usr DESTDIR?=/usr
PREFIX?=/local PREFIX?=/local
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
LDCONFIG?=ldconfig LDCONFIG?=ldconfig
ifneq ($V,1) ifneq ($V,1)
@ -108,12 +111,12 @@ install-static: $(STATIC)
.PHONY: install-deb .PHONY: install-deb
install-deb: $(DYNAMIC) install-deb: $(DYNAMIC)
$Q echo "[Install Headers: deb]" $Q echo "[Install Headers: deb]"
$Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/include $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/include
$Q install -m 0644 $(HEADERS) ~/wiringPi/debian-template/wiringPi/usr/include $Q install -m 0644 $(HEADERS) $(CURDIR)/../debian-template/wiringPi/usr/include
$Q echo "[Install Dynamic Lib: deb]" $Q echo "[Install Dynamic Lib: deb]"
install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/lib install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/lib
install -m 0755 libwiringPiDev.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION) install -m 0755 libwiringPiDev.so.$(VERSION) $(CURDIR)/../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 ln -sf $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION) $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPiDev.so
.PHONY: uninstall .PHONY: uninstall
uninstall: uninstall:

8
gpio/Makefile

@ -218,10 +218,10 @@ endif
.PHONY: install-deb .PHONY: install-deb
install-deb: gpio install-deb: gpio
$Q echo "[Install: deb]" $Q echo "[Install: deb]"
$Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/bin $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/bin
$Q install -m 0755 gpio ~/wiringPi/debian-template/wiringPi/usr/bin $Q install -m 0755 gpio $(CURDIR)/../debian-template/wiringPi/usr/bin
$Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/share/man/man1 $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/share/man/man1
$Q install -m 0644 gpio.1 ~/wiringPi/debian-template/wiringPi/usr/share/man/man1 $Q install -m 0644 gpio.1 $(CURDIR)/../debian-template/wiringPi/usr/share/man/man1
.PHONY: uninstall .PHONY: uninstall
uninstall: uninstall:

14
wiringPi/Makefile

@ -25,6 +25,9 @@ VERSION=$(shell cat ../VERSION)
DESTDIR?=/usr DESTDIR?=/usr
PREFIX?=/local PREFIX?=/local
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
LDCONFIG?=ldconfig LDCONFIG?=ldconfig
ifneq ($V,1) ifneq ($V,1)
@ -204,6 +207,7 @@ OBJ = $(SRC:.c=.o)
all: $(DYNAMIC) all: $(DYNAMIC)
.PHONY: static .PHONY: static
static: static:
$Q cat noMoreStatic $Q cat noMoreStatic
@ -242,12 +246,12 @@ install: $(DYNAMIC)
.PHONY: install-deb .PHONY: install-deb
install-deb: $(DYNAMIC) install-deb: $(DYNAMIC)
$Q echo "[Install Headers: deb]" $Q echo "[Install Headers: deb]"
$Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/include $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/include
$Q install -m 0644 $(HEADERS) ~/wiringPi/debian-template/wiringPi/usr/include $Q install -m 0644 $(HEADERS) $(CURDIR)/../debian-template/wiringPi/usr/include
$Q echo "[Install Dynamic Lib: deb]" $Q echo "[Install Dynamic Lib: deb]"
install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/lib install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/lib
install -m 0755 libwiringPi.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPi.so.$(VERSION) install -m 0755 libwiringPi.so.$(VERSION) $(CURDIR)/../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 ln -sf $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPi.so.$(VERSION) $(CURDIR)/../debian-template/wiringPi/usr/lib/libwiringPi.so
.PHONY: uninstall .PHONY: uninstall
uninstall: uninstall:

11
wiringPiD/Makefile

@ -25,6 +25,9 @@
DESTDIR?=/usr DESTDIR?=/usr
PREFIX?=/local PREFIX?=/local
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
ifneq ($V,1) ifneq ($V,1)
Q ?= @ Q ?= @
endif endif
@ -78,10 +81,10 @@ install: wiringpid
.PHONY: install-deb .PHONY: install-deb
install-deb: gpio install-deb: gpio
$Q echo "[Install: deb]" $Q echo "[Install: deb]"
$Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/bin $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/usr/bin
$Q install -m 0755 gpio ~/wiringPi/debian-template/wiringPi/usr/bin $Q install -m 0755 gpio $(CURDIR)/../debian-template/wiringPi/usr/bin
$Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/man/man1 $Q install -m 0755 -d $(CURDIR)/../debian-template/wiringPi/man/man1
$Q install -m 0644 gpio.1 ~/wiringPi/debian-template/wiringPi/man/man1 $Q install -m 0644 gpio.1 $(CURDIR)/../debian-template/wiringPi/man/man1
.PHONY: uninstall .PHONY: uninstall
uninstall: uninstall:

Loading…
Cancel
Save