summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules23
1 files changed, 22 insertions, 1 deletions
diff --git a/debian/rules b/debian/rules
index c4ddaa7..4e4155a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,10 +1,27 @@
#!/usr/bin/make -f
# -*- makefile -*-
-export DH_OPTIONS += -O-Bbuild-tree
+# hardening
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+export DH_OPTIONS += -O-Bbuild-tree
UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -n '/\(Version:\)/{s/^Version:[[:space:]]\+\([0-9]\+:\)\?\(.*\)/\2/p}' | rev | cut -d- -f 2- | rev)
+LDFLAGS += -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPIC
+CPPFLAGS += -D_FORTIFY_SOURCE=2 -fPIE -pie -Wl,-z,relro -Wl,-z,now
+CFLAGS += -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIE -pie -Wl,-z,relro -Wl,-z,now
+export CPPFLAGS
+export CFLAGS
+export LDFLAGS
+
+#
+# Test for gcc-5 support
+#
+#export CC=gcc-5
+#export CXX=g++-5
+
+
%:
dh $@ --with autoreconf
@@ -47,3 +64,7 @@ override_dh_compress:
override_dh_strip:
dh_strip --dbg-package=libmongo-client0-dbg
+
+override_dh_makeshlibs:
+ dh_makeshlibs
+ dpkg-gensymbols -v$(UPSTREAM_VERSION) -plibmongo-client0