blob: db97497c2929ee15475d7bedfa1d9b3bfe4a768a [file] [log] [blame]
Harald Welted4bb7ab2010-08-24 15:17:13 +02001#!/usr/bin/make -f
Harald Welted4bb7ab2010-08-24 15:17:13 +02002
3# Uncomment this to turn on verbose mode.
4#export DH_VERBOSE=1
5
Eric Butlerb5372ab2012-08-14 20:43:47 -07006DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)
7DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1)
8VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
9
Max126def72016-12-21 11:35:13 +010010export DEB_BUILD_MAINT_OPTIONS = hardening=+all
Holger Hans Peter Freythere7c18dd2016-01-18 13:30:28 +010011
Max126def72016-12-21 11:35:13 +010012export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions
Holger Hans Peter Freyther6308c292013-12-12 12:31:18 +010013
Harald Welted4bb7ab2010-08-24 15:17:13 +020014%:
Holger Hans Peter Freyther9a935e22013-08-12 11:47:12 +020015 dh $@ --with autoreconf --fail-missing
Harald Welted4bb7ab2010-08-24 15:17:13 +020016
Holger Hans Peter Freythera5007db2013-02-13 19:27:42 +010017override_dh_strip:
18 dh_strip --dbg-package=libosmocore-dbg
Harald Welted4bb7ab2010-08-24 15:17:13 +020019
Holger Hans Peter Freyther9a935e22013-08-12 11:47:12 +020020override_dh_install:
21 sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`
22 dh_install
23
Holger Hans Peter Freyther4cb8b942013-10-10 15:20:23 +020024# Print test results in case of a failure
25override_dh_auto_test:
26 dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)
27
Oliver Smith405e7cc2023-08-31 12:40:22 +020028# Set --disable-uring for debian 10 and ubuntu 20.04
Max936151b2016-04-24 12:01:03 +020029override_dh_auto_configure:
Oliver Smithe486e012023-08-24 11:24:57 +020030 set -x && \
31 CONFIGURE_FLAGS=" \
32 --disable-sctp-tests \
Andreas Eversberg35f20b12024-02-15 13:30:38 +010033 --disable-uring-tests \
Oliver Smithe486e012023-08-24 11:24:57 +020034 --enable-static \
35 --enable-systemd-logging \
36 "; \
Oliver Smith405e7cc2023-08-31 12:40:22 +020037 distro_v=$$(. /etc/os-release && echo $$VERSION_ID); \
38 if [ "$$distro_v" = 10 ] || [ "$$distro_v" = 20.04 ]; then \
Oliver Smithe486e012023-08-24 11:24:57 +020039 CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --disable-uring"; \
40 fi; \
41 dh_auto_configure -- $$CONFIGURE_FLAGS
Max126def72016-12-21 11:35:13 +010042
43override_dh_clean:
44 dh_clean
45 $(RM) .version
46 $(RM) debian/man/osmo-arfcn.1
47 $(RM) debian/man/osmo-auc-gen.1
48 $(RM) include/osmocom/core/bit16gen.h
49 $(RM) include/osmocom/core/bit32gen.h
50 $(RM) include/osmocom/core/bit64gen.h
51 $(RM) include/osmocom/core/crc16gen.h
52 $(RM) include/osmocom/core/crc32gen.h
53 $(RM) include/osmocom/core/crc64gen.h
54 $(RM) include/osmocom/core/crc8gen.h
Pau Espin Pedrol672e8d12023-02-07 11:15:15 +010055 $(RM) src/core/crc16gen.c
56 $(RM) src/core/crc32gen.c
57 $(RM) src/core/crc64gen.c
58 $(RM) src/core/crc8gen.c
Max126def72016-12-21 11:35:13 +010059 $(RM) tests/package.m4
60 $(RM) tests/testsuite
61 $(RM) -r doc/codec/
62 $(RM) -r doc/core/
Harald Welte572fc2d2018-05-28 17:49:54 +020063 $(RM) -r doc/ctrl/
Max126def72016-12-21 11:35:13 +010064 $(RM) -r doc/gsm/
Harald Welted55a2092022-11-29 22:33:54 +010065 $(RM) -r doc/isdn/
Max70861e32017-06-27 13:51:02 +020066 $(RM) -r doc/gb/
Max126def72016-12-21 11:35:13 +010067 $(RM) -r doc/vty/html/
68 $(RM) -r doc/vty/latex/