| 1 |
|
| 2 |
|
| 3 |
include /usr/share/dpkg/pkg-info.mk |
| 4 |
|
| 5 |
|
| 6 |
DOCS_stem = README docs/ANONYMITY_NETWORKS docs/LEVIN_PROTOCOL |
| 7 |
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) |
| 8 |
DOCS = $(foreach d,$(DOCS_stem),$d.html $d.txt) |
| 9 |
endif |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
ifneq (,$(filter $(DEB_HOST_ARCH), mipsel)) |
| 14 |
export DEB_CXXFLAGS_MAINT_APPEND = -g0 |
| 15 |
else ifeq ($(DEB_HOST_ARCH_BITS),32) |
| 16 |
export DEB_CXXFLAGS_MAINT_APPEND = -g1 |
| 17 |
endif |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
ifneq (,$(filter $(DEB_HOST_ARCH), armel m68k mips mipsel powerpc powerpcspe sh4)) |
| 22 |
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed -latomic -Wl,--as-needed |
| 23 |
endif |
| 24 |
|
| 25 |
DH_OPTIONS = -O--buildsystem=cmake |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
ifneq (,$(filter $(DEB_HOST_ARCH), riscv64)) |
| 30 |
export DEB_CXXFLAGS_MAINT_APPEND = -O1 |
| 31 |
endif |
| 32 |
|
| 33 |
|
| 34 |
DEB_SUITE_EXP = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION)) |
| 35 |
|
| 36 |
|
| 37 |
FAKEHOME = $(CURDIR)/debian/fakehome |
| 38 |
|
| 39 |
|
| 40 |
GTEST_FILTER = address_from_url.*:dns_resolver.* |
| 41 |
TEST_EXCLUDE = functional_tests_rpc |
| 42 |
|
| 43 |
|
| 44 |
TEST_EXCLUDE += core_tests |
| 45 |
|
| 46 |
|
| 47 |
ifneq (,$(filter $(DEB_HOST_ARCH), armel mipsel m68k)) |
| 48 |
TEST_EXCLUDE += hash-variant2-int-sqrt |
| 49 |
endif |
| 50 |
|
| 51 |
|
| 52 |
TEST_EXCLUDE += $(if $(DEB_SUITE_EXP),,cnv4-jit hash-slow-4) |
| 53 |
|
| 54 |
%: |
| 55 |
dh $@ $(DH_OPTIONS:-O%=%) |
| 56 |
|
| 57 |
%.html: %.md |
| 58 |
pandoc --from gfm-raw_html --to html --standalone --output $@ $< |
| 59 |
|
| 60 |
%.txt: %.md |
| 61 |
pandoc --from gfm-raw_html --to plain --output $@ $< |
| 62 |
|
| 63 |
execute_after_dh_auto_clean: |
| 64 |
rm -rf "$(FAKEHOME)" |
| 65 |
rm -rf external/supercop |
| 66 |
|
| 67 |
override_dh_clean: |
| 68 |
dh_clean -- $(DOCS) |
| 69 |
|
| 70 |
override_dh_auto_configure: |
| 71 |
rm -rf external/supercop |
| 72 |
ln -sfT ../Xsupercop external/supercop |
| 73 |
dh_auto_configure -- -DARCH=default -DNO_AES=ON -DBUILD_TESTS=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DMANUAL_SUBMODULES=1 |
| 74 |
|
| 75 |
execute_after_dh_auto_build: $(DOCS) |
| 76 |
|
| 77 |
override_dh_auto_test: |
| 78 |
HOME="${FAKEHOME}" \ |
| 79 |
GTEST_FILTER="$(GTEST_FILTER)" \ |
| 80 |
dh_auto_test -- ARGS+="--output-on-failure -E '$(subst $() ,|,$(TEST_EXCLUDE))'" \ |
| 81 |
$(if $(DEB_SUITE_EXP),|| true) |
| 82 |
|
| 83 |
override_dh_installdocs: |
| 84 |
dh_installdocs --all -- $(DOCS) |
| 85 |
|
| 86 |
|
| 87 |
override_dh_dwz: |
| 88 |
dh_dwz --exclude=usr/lib/monero/tests/bin/performance_tests |