summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2018-10-21 01:57:36 +0100
committerColin Watson <cjwatson@debian.org>2018-10-21 01:57:36 +0100
commit2df9bff12640a33749f0f20ae806b6efac327116 (patch)
tree0216953ff29e8923e6d8386b183a29d22afddf42
parent0ed79b83282d048dae91bbe2a631b0e9b00d1709 (diff)
Simplify debian/rules using /usr/share/dpkg/default.mk.
-rw-r--r--debian/changelog1
-rwxr-xr-xdebian/rules29
2 files changed, 9 insertions, 21 deletions
diff --git a/debian/changelog b/debian/changelog
index ca9f40844..42fd29b8a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -54,6 +54,7 @@ openssh (1:7.9p1-1) UNRELEASED; urgency=medium
54 apparently required by some glibc/OpenSSL combinations. 54 apparently required by some glibc/OpenSSL combinations.
55 * Remove dh_builddeb override to use xz compression; this has been the 55 * Remove dh_builddeb override to use xz compression; this has been the
56 default since dpkg 1.17.0. 56 default since dpkg 1.17.0.
57 * Simplify debian/rules using /usr/share/dpkg/default.mk.
57 58
58 -- Colin Watson <cjwatson@debian.org> Fri, 19 Oct 2018 21:34:47 +0100 59 -- Colin Watson <cjwatson@debian.org> Fri, 19 Oct 2018 21:34:47 +0100
59 60
diff --git a/debian/rules b/debian/rules
index c44afccff..a41241079 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,9 @@
1#!/usr/bin/make -f 1#!/usr/bin/make -f
2 2
3export DEB_BUILD_MAINT_OPTIONS := hardening=+all
4
5include /usr/share/dpkg/default.mk
6
3# Uncomment this to turn on verbose mode. 7# Uncomment this to turn on verbose mode.
4# export DH_VERBOSE=1 8# export DH_VERBOSE=1
5 9
@@ -19,10 +23,6 @@ else
19 -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) 23 -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
20endif 24endif
21 25
22DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
23DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
24DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
25
26ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) 26ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
27 CC := gcc 27 CC := gcc
28 PKG_CONFIG = pkg-config 28 PKG_CONFIG = pkg-config
@@ -32,29 +32,18 @@ else
32 RUN_TESTS := 32 RUN_TESTS :=
33endif 33endif
34 34
35DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
36
37# Take account of old dpkg-architecture output.
38ifeq ($(DEB_HOST_ARCH_OS),)
39 DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM))
40 ifeq ($(DEB_HOST_ARCH_OS),gnu)
41 DEB_HOST_ARCH_OS := hurd
42 endif
43endif
44
45# Change the version string to reflect distribution 35# Change the version string to reflect distribution
46DISTRIBUTION := $(shell dpkg-vendor --query vendor) 36SSH_EXTRAVERSION := $(DEB_VENDOR)-$(shell echo '$(DEB_VERSION)' | sed -e 's/.*-//')
47SSH_EXTRAVERSION := $(DISTRIBUTION)-$(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p' | sed -e 's/[^-]*-//')
48 37
49DISTRIBUTOR := $(shell if dpkg-vendor --derives-from Ubuntu 2>/dev/null; then echo Ubuntu; else echo Debian; fi) 38UBUNTU := $(call dpkg_vendor_derives_from Ubuntu)
50ifeq ($(DISTRIBUTOR),Ubuntu) 39ifeq ($(UBUNTU),yes)
51DEFAULT_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games 40DEFAULT_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
52else 41else
53DEFAULT_PATH := /usr/local/bin:/usr/bin:/bin:/usr/games 42DEFAULT_PATH := /usr/local/bin:/usr/bin:/bin:/usr/games
54endif 43endif
55SUPERUSER_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 44SUPERUSER_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
56 45
57ifeq ($(DISTRIBUTOR),Ubuntu) 46ifeq ($(UBUNTU),yes)
58server_recommends := ssh-import-id 47server_recommends := ssh-import-id
59else 48else
60server_recommends := 49server_recommends :=
@@ -105,8 +94,6 @@ confflags += --with-default-path=$(DEFAULT_PATH) --with-superuser-path=$(SUPERUS
105confflags_udeb += --with-default-path=/usr/local/bin:/usr/bin:/bin --with-superuser-path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 94confflags_udeb += --with-default-path=/usr/local/bin:/usr/bin:/bin --with-superuser-path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
106 95
107# Compiler flags. 96# Compiler flags.
108export DEB_BUILD_MAINT_OPTIONS := hardening=+all
109include /usr/share/dpkg/buildflags.mk
110cflags := $(CPPFLAGS) $(CFLAGS) 97cflags := $(CPPFLAGS) $(CFLAGS)
111cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" 98cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\"
112cflags_udeb := -Os 99cflags_udeb := -Os