| 1 |
|
| 2 |
|
| 3 |
noet |
| 4 |
export DEB_BUILD_MAINT_OPTIONS=hardening=+all |
| 5 |
include /usr/share/dpkg/pkg-info.mk |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
py3default = $(subst .,,$(shell py3versions -dv)) |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 15 |
|
| 16 |
ifneq (,$(findstring SNAPSHOT,$(DEB_VERSION))) |
| 17 |
|
| 18 |
DVS_SPLIT := $(subst ~, ,$(subst -git, ,$(DEB_VERSION))) |
| 19 |
|
| 20 |
DEB_VERSION_GITHASH := $(word 2,$(DVS_SPLIT)) |
| 21 |
DEB_VERSION_SERIES := $(word 3,$(DVS_SPLIT)) |
| 22 |
|
| 23 |
VERSION_INFO_OVERRIDE := git-$(DEB_VERSION_GITHASH)-ppa$(DEB_VERSION_SERIES) |
| 24 |
else |
| 25 |
VERSION_INFO_OVERRIDE := $(DEB_VERSION) |
| 26 |
endif |
| 27 |
|
| 28 |
|
| 29 |
ifneq (,$(findstring 1ppa,$(DEB_VERSION))) |
| 30 |
|
| 31 |
DVS_SPLIT := $(subst ~, ,$(subst -1ppa, ,$(DEB_VERSION))) |
| 32 |
|
| 33 |
DEB_VERSION_TAG := $(word 1,$(DVS_SPLIT)) |
| 34 |
DEB_VERSION_BUILD := $(word 2,$(DVS_SPLIT)) |
| 35 |
DEB_VERSION_SERIES := $(word 3,$(DVS_SPLIT)) |
| 36 |
|
| 37 |
VERSION_INFO_OVERRIDE := $(DEB_VERSION_TAG)-$(DEB_VERSION_BUILD)-ppa$(DEB_VERSION_SERIES) |
| 38 |
endif |
| 39 |
|
| 40 |
override_dh_auto_configure: |
| 41 |
dh_auto_configure -- -DVERSION_INFO_OVERRIDE:STRING=$(VERSION_INFO_OVERRIDE) \ |
| 42 |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 43 |
-DCMAKE_INSTALL_DOCDIR="share/doc/libbladerf-doc" \ |
| 44 |
-DENABLE_HOST_BUILD=ON \ |
| 45 |
-DTREAT_WARNINGS_AS_ERRORS=OFF \ |
| 46 |
-DENABLE_LIBTECLA=ON \ |
| 47 |
-DENABLE_LIBEDIT=ON \ |
| 48 |
-DENABLE_FX3_BUILD=OFF \ |
| 49 |
-DBUILD_DOCUMENTATION=ON \ |
| 50 |
-DUDEV_RULES_PATH=/usr/lib/udev/rules.d |
| 51 |
|
| 52 |
override_dh_auto_build: |
| 53 |
dh_auto_build |
| 54 |
dh_auto_build --buildsystem=pybuild --sourcedir=host/libraries/libbladeRF_bindings/python |
| 55 |
|
| 56 |
override_dh_auto_install: |
| 57 |
dh_auto_install |
| 58 |
|
| 59 |
dh_auto_install --buildsystem=pybuild --sourcedir=host/libraries/libbladeRF_bindings/python |
| 60 |
|
| 61 |
(cd debian/tmp/usr/share/doc/libbladerf-doc/html && ln -s /usr/share/javascript/mathjax/MathJax.js MathJax.js) |
| 62 |
(cd debian/tmp/usr/share/doc/libbladerf-doc/html && sed --in-place 's_http://cdn.mathjax.org/mathjax/latest/MathJax.js_MathJax.js_' *.html) |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
chmod -x host/examples/bladeRF-cli/sc16q11-packed-mimo/run.sh |
| 67 |
chmod -x host/examples/bladeRF-cli/sc16q11-packed-siso/run.sh |
| 68 |
rm -f host/examples/bladeRF-cli/sc16q11-packed-mimo/.gitignore |
| 69 |
rm -f host/examples/bladeRF-cli/sc16q11-packed-siso/.gitignore |
| 70 |
rm -f host/examples/bladeRF-cli/sync_trx/.gitignore |
| 71 |
rm -f host/examples/python/txrx/.gitignore |
| 72 |
|
| 73 |
help2man --no-discard-stderr -n "perform power level measurements" debian/tmp/usr/bin/bladeRF-power -o debian/tmp/usr/share/man/man1/bladeRF-power.1 |
| 74 |
help2man --no-discard-stderr -n "checks for and optionally installs updates" debian/tmp/usr/bin/bladeRF-update -o debian/tmp/usr/share/man/man1/bladeRF-update.1 |
| 75 |
|
| 76 |
override_dh_auto_clean: |
| 77 |
dh_auto_clean |
| 78 |
- chmod ug+x host/examples/bladeRF-cli/sc16q11-packed-mimo/run.sh |
| 79 |
- chmod ug+x host/examples/bladeRF-cli/sc16q11-packed-siso/run.sh |
| 80 |
rm -rf .pybuild |
| 81 |
rm -rf host/libraries/libbladeRF_bindings/python/bladerf.egg-info |
| 82 |
|
| 83 |
%: |
| 84 |
dh $@ --with python3 |