diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 1 | ||||
-rwxr-xr-x | debian/rules | 29 |
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 | ||
3 | export DEB_BUILD_MAINT_OPTIONS := hardening=+all | ||
4 | |||
5 | include /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))) |
20 | endif | 24 | endif |
21 | 25 | ||
22 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | ||
23 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) | ||
24 | DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) | ||
25 | |||
26 | ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | 26 | ifeq ($(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 := |
33 | endif | 33 | endif |
34 | 34 | ||
35 | DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) | ||
36 | |||
37 | # Take account of old dpkg-architecture output. | ||
38 | ifeq ($(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 | ||
43 | endif | ||
44 | |||
45 | # Change the version string to reflect distribution | 35 | # Change the version string to reflect distribution |
46 | DISTRIBUTION := $(shell dpkg-vendor --query vendor) | 36 | SSH_EXTRAVERSION := $(DEB_VENDOR)-$(shell echo '$(DEB_VERSION)' | sed -e 's/.*-//') |
47 | SSH_EXTRAVERSION := $(DISTRIBUTION)-$(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p' | sed -e 's/[^-]*-//') | ||
48 | 37 | ||
49 | DISTRIBUTOR := $(shell if dpkg-vendor --derives-from Ubuntu 2>/dev/null; then echo Ubuntu; else echo Debian; fi) | 38 | UBUNTU := $(call dpkg_vendor_derives_from Ubuntu) |
50 | ifeq ($(DISTRIBUTOR),Ubuntu) | 39 | ifeq ($(UBUNTU),yes) |
51 | DEFAULT_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games | 40 | DEFAULT_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games |
52 | else | 41 | else |
53 | DEFAULT_PATH := /usr/local/bin:/usr/bin:/bin:/usr/games | 42 | DEFAULT_PATH := /usr/local/bin:/usr/bin:/bin:/usr/games |
54 | endif | 43 | endif |
55 | SUPERUSER_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | 44 | SUPERUSER_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
56 | 45 | ||
57 | ifeq ($(DISTRIBUTOR),Ubuntu) | 46 | ifeq ($(UBUNTU),yes) |
58 | server_recommends := ssh-import-id | 47 | server_recommends := ssh-import-id |
59 | else | 48 | else |
60 | server_recommends := | 49 | server_recommends := |
@@ -105,8 +94,6 @@ confflags += --with-default-path=$(DEFAULT_PATH) --with-superuser-path=$(SUPERUS | |||
105 | confflags_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 | 94 | confflags_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. |
108 | export DEB_BUILD_MAINT_OPTIONS := hardening=+all | ||
109 | include /usr/share/dpkg/buildflags.mk | ||
110 | cflags := $(CPPFLAGS) $(CFLAGS) | 97 | cflags := $(CPPFLAGS) $(CFLAGS) |
111 | cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" | 98 | cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\" |
112 | cflags_udeb := -Os | 99 | cflags_udeb := -Os |