File: rules

package info (click to toggle)
mongo-cxx-driver-legacy 1.1.3-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,688 kB
  • sloc: cpp: 93,675; sh: 11,310; python: 5,338; ansic: 938; makefile: 343; perl: 213
file content (78 lines) | stat: -rwxr-xr-x 2,405 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export DH_VERBOSE = 1
SCONS=scons

%:
	dh $@

SCONS_COMPILE_FLAGS=             \
    --ssl=SSL                    \
    --use-sasl-client            \
    --sharedclient               \
    --disable-warnings-as-errors \
    --c++11=on			 \
    CXXFLAGS="$(CXXFLAGS) $(CPPFLAGS)"       \
    CFLAGS="$(CFLAGS) $(CPPFLAGS)"           \
    LINKFLAGS="$(LDFLAGS)"

# Set _DEFAULT_SOURCE to use the system's timegm(3). The vendored timegm()
# implementation is buggy under gcc-7.
SCONS_COMPILE_FLAGS += CPPDEFINES="_DEFAULT_SOURCE"

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
        NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
        SCONS_COMPILE_FLAGS += -j $(NUMJOBS)
endif

BACKUP=                                \
   src/third_party/jsoncpp             \
   src/third_party/gtest-1.7.0/src     \
   src/third_party/gtest-1.7.0/include

override_dh_auto_build:
	# Backup directories contained sources that should not be used.
	set -e ; for i in $(BACKUP); do \
		if [ ! -d "$$i".backup ]; then mv -v "$$i" "$$i".backup; fi ; \
	done
	$(SCONS) --prefix=/usr $(SCONS_COMPILE_FLAGS)

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	# The following line perform unit tests only as integration and examples
	# tests are not functional without a working mongodb instance.
	$(SCONS) unit $(SCONS_COMPILE_FLAGS)
endif

override_dh_auto_clean:
	dh_auto_clean
	$(SCONS) --clean --disable-warnings-as-errors
	$(RM) -r build tmp
	$(RM) `find -name "*.pyc"`
	set -e ; for i in $(BACKUP); do \
		if [ -d "$$i".backup ]; then rm -fr "$$i"; mv -v -f "$$i".backup "$$i"; fi ; \
	done

override_dh_install-arch:
	dh_install
	# Move generated header files to the arch-specific include path
	install -d "$(CURDIR)/debian/libmongoclient-dev/usr/include/$${DEB_HOST_MULTIARCH}/mongo"
	mv $(CURDIR)/debian/libmongoclient-dev/usr/include/mongo/config.h \
		$(CURDIR)/debian/libmongoclient-dev/usr/include/mongo/version.h \
		"$(CURDIR)/debian/libmongoclient-dev/usr/include/$${DEB_HOST_MULTIARCH}/mongo"

override_dh_install-indep:


override_dh_auto_install:
	$(SCONS) install --prefix=$(CURDIR)/tmp $(SCONS_COMPILE_FLAGS)

override_dh_makeshlibs:
	dh_makeshlibs -V

override_dh_gencontrol:
	dh_gencontrol -Nmongodb-dev
	# Bump the epoch of mongodb-dev
	dh_gencontrol -pmongodb-dev -- -v2:$(DEB_VERSION)