summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog2
-rwxr-xr-xdebian/rules67
-rw-r--r--version.h7
3 files changed, 59 insertions, 17 deletions
diff --git a/debian/changelog b/debian/changelog
index 5b8f58a62..359f28bb1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -46,6 +46,8 @@ openssh (1:4.7p1-1) UNRELEASED; urgency=low
46 * Create /var/run/sshd on start even if /etc/ssh/sshd_not_to_be_run exists 46 * Create /var/run/sshd on start even if /etc/ssh/sshd_not_to_be_run exists
47 (closes: #453285). 47 (closes: #453285).
48 * Fix "overriden" typo in ssh(1) (thanks, A. Costa; closes: #390699). 48 * Fix "overriden" typo in ssh(1) (thanks, A. Costa; closes: #390699).
49 * Refactor debian/rules configure and make invocations to make development
50 easier.
49 51
50 -- Colin Watson <cjwatson@debian.org> Sun, 23 Dec 2007 12:53:46 +0000 52 -- Colin Watson <cjwatson@debian.org> Sun, 23 Dec 2007 12:53:46 +0000
51 53
diff --git a/debian/rules b/debian/rules
index 46c1344bb..cbb119d23 100755
--- a/debian/rules
+++ b/debian/rules
@@ -69,16 +69,6 @@ PAMSUBST := yes
69PAMDEP := libpam-runtime 69PAMDEP := libpam-runtime
70endif 70endif
71 71
72# The Hurd needs libcrypt for res_query et al.
73ifeq ($(DEB_HOST_ARCH_OS),hurd)
74FORCE_LIBS := LIBS=-lcrypt
75endif
76
77# SELinux support?
78ifeq ($(DEB_HOST_ARCH_OS),linux)
79SELINUX := --with-selinux
80endif
81
82# Change the version string to include the Debian version 72# Change the version string to include the Debian version
83SSH_EXTRAVERSION := Debian-$(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p' | sed -e 's/[^-]*-//') 73SSH_EXTRAVERSION := Debian-$(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p' | sed -e 's/[^-]*-//')
84 74
@@ -90,13 +80,62 @@ DEFAULT_PATH := /usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
90endif 80endif
91SUPERUSER_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 81SUPERUSER_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
92 82
83# Common path configuration.
84confflags += --prefix=/usr --sysconfdir=/etc/ssh --libexecdir=/usr/lib/openssh --mandir=/usr/share/man
85
86# Common build options.
87confflags += --with-4in6
88confflags += --with-privsep-path=/var/run/sshd
89confflags += --without-rand-helper
90
91# The Hurd needs libcrypt for res_query et al.
92ifeq ($(DEB_HOST_ARCH_OS),hurd)
93confflags += --with-libs=-lcrypt
94endif
95
96# Everything above here is common to the deb and udeb builds.
97confflags_udeb := $(confflags)
98
99# Options specific to the deb build.
100confflags += --with-tcp-wrappers
101confflags += --with-pam
102confflags += --with-libedit
103confflags += --with-kerberos5=/usr
104confflags += --with-ssl-engine
105ifeq ($(DEB_HOST_ARCH_OS),linux)
106confflags += --with-selinux
107endif
108
109# The deb build wants xauth; the udeb build doesn't.
110confflags += --with-xauth=/usr/bin/X11/xauth
111confflags_udeb += --without-xauth
112
113# Default paths. The udeb build has /usr/bin/X11 and /usr/games removed.
114confflags += --with-default-path=$(DEFAULT_PATH) --with-superuser-path=$(SUPERUSER_PATH)
115confflags_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
116
117# Compiler flags.
118cflags := $(OPTFLAGS) $(PIE_CFLAGS)
119cflags += -DLOGIN_PROGRAM=\"/bin/login\" -DLOGIN_NO_ENDOPT
120cflags += -DSSHD_PAM_SERVICE=\"ssh\"
121cflags += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\"
122cflags_udeb := -Os
123cflags_udeb += -DSSH_EXTRAVERSION=\"$(SSH_EXTRAVERSION)\"
124confflags += --with-cflags='$(cflags)'
125confflags_udeb += --with-cflags='$(cflags_udeb)'
126
127# Linker flags.
128ifneq ($(PIE_LDFLAGS),)
129confflags += --with-ldflags='$(PIE_LDFLAGS)'
130endif
131
93build: build-deb build-udeb 132build: build-deb build-udeb
94 133
95build-deb: build-deb-stamp 134build-deb: build-deb-stamp
96build-deb-stamp: 135build-deb-stamp:
97 dh_testdir 136 dh_testdir
98 mkdir -p build-deb 137 mkdir -p build-deb
99 cd build-deb && $(FORCE_LIBS) LDFLAGS='$(PIE_LDFLAGS)' ../configure $(confflags) --prefix=/usr --sysconfdir=/etc/ssh --libexecdir=/usr/lib/openssh --mandir=/usr/share/man --with-tcp-wrappers --with-xauth=/usr/bin/X11/xauth --with-default-path=$(DEFAULT_PATH) --with-superuser-path=$(SUPERUSER_PATH) --with-pam --with-4in6 --with-privsep-path=/var/run/sshd --without-rand-helper --with-libedit --with-kerberos5=/usr --with-ssl-engine $(SELINUX) 138 cd build-deb && ../configure $(confflags)
100 139
101ifeq ($(DEB_HOST_ARCH_OS),linux) 140ifeq ($(DEB_HOST_ARCH_OS),linux)
102 # Some 2.2 kernels have trouble with setres[ug]id() (bug #239999). 141 # Some 2.2 kernels have trouble with setres[ug]id() (bug #239999).
@@ -105,7 +144,7 @@ endif
105 # Debian's /var/log/btmp has inappropriate permissions. 144 # Debian's /var/log/btmp has inappropriate permissions.
106 perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-deb/config.h 145 perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-deb/config.h
107 146
108 $(MAKE) -C build-deb -j 2 ASKPASS_PROGRAM='/usr/bin/ssh-askpass' CFLAGS='$(OPTFLAGS) $(PIE_CFLAGS) -g -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wno-pointer-sign -std=gnu99 -DLOGIN_PROGRAM=\"/bin/login\" -DLOGIN_NO_ENDOPT -DSSHD_PAM_SERVICE=\"ssh\" -DSSH_EXTRAVERSION="\" $(SSH_EXTRAVERSION)\""' 147 $(MAKE) -C build-deb -j 2 ASKPASS_PROGRAM='/usr/bin/ssh-askpass'
109 # Support building on Debian 3.0 (with GNOME 1.4) and later. 148 # Support building on Debian 3.0 (with GNOME 1.4) and later.
110 if [ -f /usr/include/libgnomeui-2.0/gnome.h ]; then \ 149 if [ -f /usr/include/libgnomeui-2.0/gnome.h ]; then \
111 $(MAKE) -C contrib gnome-ssh-askpass2 CC='gcc $(OPTFLAGS) -g -Wall'; \ 150 $(MAKE) -C contrib gnome-ssh-askpass2 CC='gcc $(OPTFLAGS) -g -Wall'; \
@@ -119,13 +158,13 @@ build-udeb: build-udeb-stamp
119build-udeb-stamp: 158build-udeb-stamp:
120 dh_testdir 159 dh_testdir
121 mkdir -p build-udeb 160 mkdir -p build-udeb
122 cd build-udeb && $(FORCE_LIBS) ../configure $(confflags) --prefix=/usr --sysconfdir=/etc/ssh --libexecdir=/usr/lib/openssh --without-xauth --with-default-path=/usr/local/bin:/usr/bin:/bin --with-superuser-path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --with-4in6 --with-privsep-path=/var/run/sshd --without-rand-helper 161 cd build-udeb && ../configure $(confflags_udeb)
123 # Debian's /var/log/btmp has inappropriate permissions. 162 # Debian's /var/log/btmp has inappropriate permissions.
124 perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-udeb/config.h 163 perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-udeb/config.h
125 # Avoid libnsl linkage. Ugh. 164 # Avoid libnsl linkage. Ugh.
126 perl -pi -e 's/ +-lnsl//' build-udeb/config.status 165 perl -pi -e 's/ +-lnsl//' build-udeb/config.status
127 cd build-udeb && ./config.status 166 cd build-udeb && ./config.status
128 $(MAKE) -C build-udeb -j 2 ASKPASS_PROGRAM='/usr/bin/ssh-askpass' CFLAGS='-Os -g -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wno-pointer-sign -std=gnu99 -DSSH_EXTRAVERSION="\" $(SSH_EXTRAVERSION)\""' ssh scp sftp sshd ssh-keygen 167 $(MAKE) -C build-udeb -j 2 ASKPASS_PROGRAM='/usr/bin/ssh-askpass' ssh scp sftp sshd ssh-keygen
129 touch build-udeb-stamp 168 touch build-udeb-stamp
130 169
131clean: 170clean:
diff --git a/version.h b/version.h
index 724c665d6..10fbd5f10 100644
--- a/version.h
+++ b/version.h
@@ -3,7 +3,8 @@
3#define SSH_VERSION "OpenSSH_4.7" 3#define SSH_VERSION "OpenSSH_4.7"
4 4
5#define SSH_PORTABLE "p1" 5#define SSH_PORTABLE "p1"
6#ifndef SSH_EXTRAVERSION 6#ifdef SSH_EXTRAVERSION
7#define SSH_EXTRAVERSION 7#define SSH_RELEASE SSH_VERSION SSH_PORTABLE " " SSH_EXTRAVERSION
8#else
9#define SSH_RELEASE SSH_VERSION SSH_PORTABLE
8#endif 10#endif
9#define SSH_RELEASE SSH_VERSION SSH_PORTABLE SSH_EXTRAVERSION