From a776e6b0e834189b69bd5d33a9bcc5e07ad6cc03 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 12 Sep 2015 17:13:42 +0000 Subject: [PATCH] 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 --- debian/.gitignore | 9 +++++++ debian/changelog | 6 +++++ debian/compat | 1 + debian/control | 29 ++++++++++++++++++++ debian/copyright | 15 +++++++++++ debian/libwiringpi-dev.dirs | 2 ++ debian/libwiringpi-dev.install | 3 +++ debian/libwiringpi2.install | 1 + debian/libwiringpi2.shlibs | 2 ++ debian/rules | 49 ++++++++++++++++++++++++++++++++++ debian/wiringpi.dirs | 1 + debian/wiringpi.install | 4 +++ 12 files changed, 122 insertions(+) create mode 100644 debian/.gitignore create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/libwiringpi-dev.dirs create mode 100644 debian/libwiringpi-dev.install create mode 100644 debian/libwiringpi2.install create mode 100644 debian/libwiringpi2.shlibs create mode 100755 debian/rules create mode 100644 debian/wiringpi.dirs create mode 100644 debian/wiringpi.install diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000..6296064 --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,9 @@ +*.debhelper.log +*.substvars +tmp +wiringpi +libwiringpi2 +libwiringpi-dev +files +*.postinst.debhelper +*.postrm.debhelper diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..7f04ad5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +wiringpi (2.26~iwj) rpi-unstable; urgency=low + + * Initial version with real Debian source package build. + + -- Ian Jackson Sat, 12 Sep 2015 18:31:35 +0100 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..1d6d228 --- /dev/null +++ b/debian/control @@ -0,0 +1,29 @@ +Source: wiringpi +Section: electronics +Priority: optional +Maintainer: Ian Jackson +Standards-Version: 3.8.0 +Homepage: http://wiringpi.com/ +Build-Depends: debhelper (>= 8) + +Package: libwiringpi2 +Section: libs +Architecture: armhf +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: GPIO librariees for Raspberry Pi (runtime). + Runtime for the popular wiringPi library. + +Package: wiringpi +Architecture: armhf +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: gpio utility for Raspberry Pi + The wiringPi gpio command line utility, for GPIO access on a + Raspberry Pi from the command line. + +Package: libwiringpi-dev +Architecture: armhf +Depends: libwiringpi2 (= ${binary:Version}), libc6-dev, ${misc:Depends} +Suggests: wiringpi +Description: GPIO development library for Raspberry Pi + Development libraries to allow GPIO access on a Raspberry Pi from C + and C++ programs. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..de82701 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,15 @@ +wiringPi is Copyright (C) 2012-2015 Gordon Henderson. + +wiringPi is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License, as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +wiringPi is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +On all Debian and Raspbian systems, a copy of the GNU Lesser General +Public License version 3 can be found in +`/usr/share/common-licenses/LGPL-3'. diff --git a/debian/libwiringpi-dev.dirs b/debian/libwiringpi-dev.dirs new file mode 100644 index 0000000..4418816 --- /dev/null +++ b/debian/libwiringpi-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include diff --git a/debian/libwiringpi-dev.install b/debian/libwiringpi-dev.install new file mode 100644 index 0000000..d7ea901 --- /dev/null +++ b/debian/libwiringpi-dev.install @@ -0,0 +1,3 @@ +debian/tmp/usr/include +debian/tmp/usr/lib/*.so +examples usr/share/doc/libwiringpi-dev diff --git a/debian/libwiringpi2.install b/debian/libwiringpi2.install new file mode 100644 index 0000000..c45ebcf --- /dev/null +++ b/debian/libwiringpi2.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/lib*.so.* diff --git a/debian/libwiringpi2.shlibs b/debian/libwiringpi2.shlibs new file mode 100644 index 0000000..0be8db1 --- /dev/null +++ b/debian/libwiringpi2.shlibs @@ -0,0 +1,2 @@ +libwiringPi 2 libwiringpi2 +libwiringPiDev 2 libwiringpi2 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..423a473 --- /dev/null +++ b/debian/rules @@ -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 $@ diff --git a/debian/wiringpi.dirs b/debian/wiringpi.dirs new file mode 100644 index 0000000..e772481 --- /dev/null +++ b/debian/wiringpi.dirs @@ -0,0 +1 @@ +usr/bin diff --git a/debian/wiringpi.install b/debian/wiringpi.install new file mode 100644 index 0000000..41ae22d --- /dev/null +++ b/debian/wiringpi.install @@ -0,0 +1,4 @@ +debian/tmp/usr/bin +debian/tmp/usr/man usr/share +README.TXT usr/share/doc/wiringpi +People usr/share/doc/wiringpi -- 2.30.2