Introduce a proper Debian source package build system

It's not perfect - there is no symbol versioning, and I have had to
make some (perhaps false) assumptions about library ABI stability, but
it does produce something vaguely resembling what would be expected
from a library package found in Debian, and it does so using the
standard Debian source format.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This commit is contained in:
Ian Jackson
2015-09-12 17:13:42 +00:00
parent ae421d4a9c
commit a776e6b0e8
12 changed files with 122 additions and 0 deletions

49
debian/rules vendored Executable file
View File

@@ -0,0 +1,49 @@
#!/usr/bin/make -f
.PHONY: build
VERSION:=$(shell cat VERSION)
export VERSION
soname:=$(shell echo $${VERSION%%.*})
WIRINGPI_SONAME_SUFFIX:=.$(soname)
export soname
export WIRINGPI_SONAME_SUFFIX
build:
dh $@
override_dh_auto_configure:
override_dh_prep:
dh_prep -Xdebian/tmp
dirs:
dh_installdirs -A
mkdir debian/tmp
set -e; for p in `dh_listpackages`; do \
(cd debian/$$p; find -type d) | \
(cd debian/tmp; xargs mkdir -p) \
done
override_dh_clean:
dh_clean
WIRINGPI_SUDO= bash -xe ./build clean
override_dh_auto_build: dirs
V=1 LDCONFIG=: WIRINGPI_SUDO= WIRINGPI_SUID=0 \
DESTDIR=`pwd`/debian/tmp/usr \
PREFIX= WIRINGPI_SUDO= \
bash -xe ./build
override_dh_auto_install:
dh_install
set -ex; for l in libwiringPi libwiringPiDev; do \
ln -sf $$l.so.$${VERSION} \
debian/libwiringpi$$soname/usr/lib/$$l.so.$$soname; \
ln -sf $$l.so.$${VERSION} \
debian/libwiringpi-dev/usr/lib/$$l.so; \
done
%:
dh $@