chiark / gitweb /
Debian build: ./newVersion updates debian/changelog too.
[wiringPi.git] / debian / rules
1 #!/usr/bin/make -f
2
3 .PHONY: build
4
5 VERSION:=$(shell cat VERSION)
6 export VERSION
7
8 soname:=$(shell echo $${VERSION%%.*})
9 WIRINGPI_SONAME_SUFFIX:=.$(soname)
10 export soname
11 export WIRINGPI_SONAME_SUFFIX
12
13 build:
14         dh $@
15
16 override_dh_auto_configure:
17
18 override_dh_prep:
19         dh_prep -Xdebian/tmp
20
21 dirs:
22         dh_installdirs -A
23         mkdir debian/tmp
24         set -e; for p in `dh_listpackages`; do \
25                 (cd debian/$$p; find -type d) | \
26                 (cd debian/tmp; xargs mkdir -p) \
27         done
28
29 override_dh_clean:
30         dh_clean
31         WIRINGPI_SUDO= bash -xe ./build clean
32
33 override_dh_auto_build: dirs
34         V=1 LDCONFIG=: WIRINGPI_SUDO= WIRINGPI_SUID=0 \
35             DESTDIR=`pwd`/debian/tmp/usr \
36             PREFIX= WIRINGPI_SUDO= \
37             bash -xe ./build
38
39 override_dh_auto_install:
40
41 override_dh_install:
42         dh_install -X COPYING.LESSER
43         set -e; cd debian/libwiringpi-dev; \
44          for f in `find usr/share/doc -name \*.sh`; do \
45                         mkdir -p ../wiringpi-tools/$${f%/*}; \
46                         mv $$f ../wiringpi-tools/$$f; \
47         done
48         set -ex; for l in libwiringPi libwiringPiDev; do \
49                 ln -sf $$l.so.$${VERSION} \
50                         debian/libwiringpi$$soname/usr/lib/$$l.so.$$soname; \
51                 ln -sf $$l.so.$${VERSION} \
52                         debian/libwiringpi-dev/usr/lib/$$l.so; \
53         done
54
55 override_dh_fixperms:
56         dh_fixperms
57         set -e; b=debian/wiringpi-tools/usr/bin/gpio; \
58         chown root.root $$b; \
59         chmod 4755 $$b
60
61 override_dh_compress:
62         dh_compress -Xexamples
63
64 %:
65         dh $@