Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # See debhelper(7) (uncomment to enable)
3 # output every command that modifies files on the build system.
4 #DH_VERBOSE = 1
5
6 # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
7 DPKG_EXPORT_BUILDFLAGS = 1
8 include /usr/share/dpkg/default.mk
9 include /usr/share/dpkg/pkg-info.mk
10
11 # see FEATURE AREAS in dpkg-buildflags(1)
12 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
13
14 # see ENVIRONMENT in dpkg-buildflags(1)
15 # package maintainers to append CFLAGS
16 #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
17 # package maintainers to append LDFLAGS
18 export DEB_LDFLAGS_MAINT_APPEND := -lpthread
19 # Link with libatomic on riscv64 to get access to the __atomic_*_1 functions
20 ifeq ($(DEB_HOST_ARCH),riscv64)
21 export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed
22 endif
23
24
25 ifeq (,$(filter libbson-doc libmongoc-doc,$(shell dh_listpackages)))
26 DOCS=OFF
27 else
28 DOCS=ON
29 endif
30
31 # main packaging script based on dh7 syntax
32 %:
33 dh $@
34
35 override_dh_auto_configure:
36 [ "$(DOCS)" = "ON" ] || echo "arch-only build; not building documentation"
37 echo $(DEB_VERSION_UPSTREAM) > VERSION_CURRENT
38 dh_auto_configure -- \
39 -DENABLE_MONGOC=ON \
40 -DENABLE_MAN_PAGES=$(DOCS) \
41 -DENABLE_HTML_DOCS=$(DOCS) \
42 -DENABLE_MAINTAINER_FLAGS=ON \
43 -DENABLE_TESTS=OFF \
44 -DENABLE_ZLIB=SYSTEM \
45 -DUSE_BUNDLED_UTF8PROC=OFF
46
47 override_dh_auto_clean:
48 rm -f VERSION_CURRENT
49 dh_auto_clean
50
51 override_dh_auto_install:
52 dh_auto_install
53 find $(CURDIR)/debian/tmp/usr/include -type f -name "*.h" -print0 | \
54 xargs -0r sed -i -e 's@\([" ]\)[^ ]*-f\(file\|debug\)-prefix-map=[^ ]*\([" ]\)@\1\3@g'
55
56 #override_dh_install:
57 # dh_install -a -X.la -Xmongoc-stat -Xdoc/mongo-c-driver -Xdoc/libbson -Xman/man3 -X-priv.so -X-priv.pc --fail-missing
58
59 override_dh_makeshlibs:
60 dh_makeshlibs -V
61
62 override_dh_auto_test:
63 echo "Skip dh_auto_test because upstream CI already tests extensively"