Harald Welte | d4bb7ab | 2010-08-24 15:17:13 +0200 | [diff] [blame] | 1 | #!/usr/bin/make -f |
Harald Welte | d4bb7ab | 2010-08-24 15:17:13 +0200 | [diff] [blame] | 2 | |
| 3 | # Uncomment this to turn on verbose mode. |
| 4 | #export DH_VERBOSE=1 |
| 5 | |
Eric Butler | b5372ab | 2012-08-14 20:43:47 -0700 | [diff] [blame] | 6 | DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) |
| 7 | DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) |
| 8 | VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') |
| 9 | |
Max | 126def7 | 2016-12-21 11:35:13 +0100 | [diff] [blame] | 10 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
Holger Hans Peter Freyther | e7c18dd | 2016-01-18 13:30:28 +0100 | [diff] [blame] | 11 | |
Max | 126def7 | 2016-12-21 11:35:13 +0100 | [diff] [blame] | 12 | export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions |
Holger Hans Peter Freyther | 6308c29 | 2013-12-12 12:31:18 +0100 | [diff] [blame] | 13 | |
Harald Welte | d4bb7ab | 2010-08-24 15:17:13 +0200 | [diff] [blame] | 14 | %: |
Holger Hans Peter Freyther | 9a935e2 | 2013-08-12 11:47:12 +0200 | [diff] [blame] | 15 | dh $@ --with autoreconf --fail-missing |
Harald Welte | d4bb7ab | 2010-08-24 15:17:13 +0200 | [diff] [blame] | 16 | |
Holger Hans Peter Freyther | a5007db | 2013-02-13 19:27:42 +0100 | [diff] [blame] | 17 | override_dh_strip: |
| 18 | dh_strip --dbg-package=libosmocore-dbg |
Harald Welte | d4bb7ab | 2010-08-24 15:17:13 +0200 | [diff] [blame] | 19 | |
Holger Hans Peter Freyther | 9a935e2 | 2013-08-12 11:47:12 +0200 | [diff] [blame] | 20 | override_dh_install: |
| 21 | sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'` |
| 22 | dh_install |
| 23 | |
Holger Hans Peter Freyther | 4cb8b94 | 2013-10-10 15:20:23 +0200 | [diff] [blame] | 24 | # Print test results in case of a failure |
| 25 | override_dh_auto_test: |
| 26 | dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) |
| 27 | |
Oliver Smith | 405e7cc | 2023-08-31 12:40:22 +0200 | [diff] [blame] | 28 | # Set --disable-uring for debian 10 and ubuntu 20.04 |
Max | 936151b | 2016-04-24 12:01:03 +0200 | [diff] [blame] | 29 | override_dh_auto_configure: |
Oliver Smith | e486e01 | 2023-08-24 11:24:57 +0200 | [diff] [blame] | 30 | set -x && \ |
| 31 | CONFIGURE_FLAGS=" \ |
| 32 | --disable-sctp-tests \ |
| 33 | --enable-static \ |
| 34 | --enable-systemd-logging \ |
| 35 | "; \ |
Oliver Smith | 405e7cc | 2023-08-31 12:40:22 +0200 | [diff] [blame] | 36 | distro_v=$$(. /etc/os-release && echo $$VERSION_ID); \ |
| 37 | if [ "$$distro_v" = 10 ] || [ "$$distro_v" = 20.04 ]; then \ |
Oliver Smith | e486e01 | 2023-08-24 11:24:57 +0200 | [diff] [blame] | 38 | CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --disable-uring"; \ |
| 39 | fi; \ |
| 40 | dh_auto_configure -- $$CONFIGURE_FLAGS |
Max | 126def7 | 2016-12-21 11:35:13 +0100 | [diff] [blame] | 41 | |
| 42 | override_dh_clean: |
| 43 | dh_clean |
| 44 | $(RM) .version |
| 45 | $(RM) debian/man/osmo-arfcn.1 |
| 46 | $(RM) debian/man/osmo-auc-gen.1 |
| 47 | $(RM) include/osmocom/core/bit16gen.h |
| 48 | $(RM) include/osmocom/core/bit32gen.h |
| 49 | $(RM) include/osmocom/core/bit64gen.h |
| 50 | $(RM) include/osmocom/core/crc16gen.h |
| 51 | $(RM) include/osmocom/core/crc32gen.h |
| 52 | $(RM) include/osmocom/core/crc64gen.h |
| 53 | $(RM) include/osmocom/core/crc8gen.h |
Pau Espin Pedrol | 672e8d1 | 2023-02-07 11:15:15 +0100 | [diff] [blame] | 54 | $(RM) src/core/crc16gen.c |
| 55 | $(RM) src/core/crc32gen.c |
| 56 | $(RM) src/core/crc64gen.c |
| 57 | $(RM) src/core/crc8gen.c |
Max | 126def7 | 2016-12-21 11:35:13 +0100 | [diff] [blame] | 58 | $(RM) tests/package.m4 |
| 59 | $(RM) tests/testsuite |
| 60 | $(RM) -r doc/codec/ |
| 61 | $(RM) -r doc/core/ |
Harald Welte | 572fc2d | 2018-05-28 17:49:54 +0200 | [diff] [blame] | 62 | $(RM) -r doc/ctrl/ |
Max | 126def7 | 2016-12-21 11:35:13 +0100 | [diff] [blame] | 63 | $(RM) -r doc/gsm/ |
Harald Welte | d55a209 | 2022-11-29 22:33:54 +0100 | [diff] [blame] | 64 | $(RM) -r doc/isdn/ |
Max | 70861e3 | 2017-06-27 13:51:02 +0200 | [diff] [blame] | 65 | $(RM) -r doc/gb/ |
Max | 126def7 | 2016-12-21 11:35:13 +0100 | [diff] [blame] | 66 | $(RM) -r doc/vty/html/ |
| 67 | $(RM) -r doc/vty/latex/ |