File: rules

package info (click to toggle)
mongo-cxx-driver-legacy 1.1.2-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,676 kB
  • ctags: 20,285
  • sloc: cpp: 93,665; sh: 11,310; python: 5,338; ansic: 938; makefile: 337; perl: 213
file content (66 lines) | stat: -rwxr-xr-x 1,975 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
#!/usr/bin/make -f

export DH_VERBOSE = 1
SCONS=scons

DVERSION = $(shell dpkg-parsechangelog -SVersion)

%:
	dh $@ --parallel

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

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_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:$(DVERSION)

get-orig-source:
	uscan --no-conf --repack --compress=xz --download-current-version --destdir $(CURDIR)/ --check-dirname-level 0 --force-download $(CURDIR)