summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules26
1 files changed, 23 insertions, 3 deletions
diff --git a/debian/rules b/debian/rules
index a2efd3a0b..5cf42b692 100755
--- a/debian/rules
+++ b/debian/rules
@@ -44,7 +44,7 @@ endif
44# Change the version string to include the Debian version 44# Change the version string to include the Debian version
45SSH_EXTRAVERSION := Debian-$(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p' | sed -e 's/[^-]*-//') 45SSH_EXTRAVERSION := Debian-$(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p' | sed -e 's/[^-]*-//')
46 46
47DISTRIBUTOR := $(shell dpkg-vendor --derives-from Ubuntu 2>/dev/null && echo Ubuntu) 47DISTRIBUTOR := $(shell if dpkg-vendor --derives-from Ubuntu 2>/dev/null; then echo Ubuntu; else echo Debian; fi)
48ifeq ($(DISTRIBUTOR),Ubuntu) 48ifeq ($(DISTRIBUTOR),Ubuntu)
49DEFAULT_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games 49DEFAULT_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games
50else 50else
@@ -115,6 +115,16 @@ confflags_udeb += --with-ldflags='-Wl,--as-needed'
115%: 115%:
116 dh $@ 116 dh $@
117 117
118DISTRIBUTOR_REPLACE := \
119 debian/openssh-server.if-up \
120 debian/openssh-server.ssh.init \
121 debian/openssh-server.postinst \
122 debian/openssh-server.prerm \
123 debian/ssh-krb5.postinst
124
125debian/%: debian/%.in
126 sed 's/@DISTRIBUTOR@/$(DISTRIBUTOR)/g' $< >$@
127
118override_dh_auto_configure: 128override_dh_auto_configure:
119 dh_auto_configure -Bbuild-deb -- $(confflags) 129 dh_auto_configure -Bbuild-deb -- $(confflags)
120 dh_auto_configure -Bbuild-udeb -- $(confflags_udeb) 130 dh_auto_configure -Bbuild-udeb -- $(confflags_udeb)
@@ -147,10 +157,14 @@ endif
147 (cat debian/copyright.head; iconv -f ISO-8859-1 -t UTF-8 LICENCE) \ 157 (cat debian/copyright.head; iconv -f ISO-8859-1 -t UTF-8 LICENCE) \
148 > debian/copyright 158 > debian/copyright
149 159
160override_dh_clean:
161 dh_clean
162 rm -f $(DISTRIBUTOR_REPLACE)
163
150override_dh_auto_install: 164override_dh_auto_install:
151 $(MAKE) -C build-deb DESTDIR=`pwd`/debian/tmp install-nokeys 165 $(MAKE) -C build-deb DESTDIR=`pwd`/debian/tmp install-nokeys
152 166
153override_dh_install: 167override_dh_install: $(DISTRIBUTOR_REPLACE)
154 rm -f debian/tmp/etc/ssh/sshd_config 168 rm -f debian/tmp/etc/ssh/sshd_config
155 169
156 dh_install -Nopenssh-client-udeb -Nopenssh-server-udeb --fail-missing 170 dh_install -Nopenssh-client-udeb -Nopenssh-server-udeb --fail-missing
@@ -176,6 +190,12 @@ override_dh_installdocs:
176 190
177override_dh_installinit: 191override_dh_installinit:
178 dh_installinit -n --name ssh 192 dh_installinit -n --name ssh
193ifeq ($(DISTRIBUTOR),Ubuntu)
194 # We need to keep the init script as well as the Upstart job for
195 # now, for the benefit of people running sshd in chroots.
196 install -D -o root -g root debian/openssh-server.ssh.init debian/openssh-server/etc/init.d/ssh
197 install -D -o root -g root -m 644 debian/openssh-server.ssh.default debian/openssh-server/etc/default/ssh
198endif
179 199
180override_dh_installpam: 200override_dh_installpam:
181 dh_installpam --name sshd 201 dh_installpam --name sshd
@@ -189,7 +209,7 @@ override_dh_shlibdeps:
189 dh_shlibdeps 209 dh_shlibdeps
190 debian/adjust-openssl-dependencies 210 debian/adjust-openssl-dependencies
191 211
192override_dh_installdeb: 212override_dh_installdeb: $(DISTRIBUTOR_REPLACE)
193 dh_installdeb 213 dh_installdeb
194 perl -i debian/substitute-conffile.pl \ 214 perl -i debian/substitute-conffile.pl \
195 ETC_SSH_MODULI debian/openssh-client/etc/ssh/moduli \ 215 ETC_SSH_MODULI debian/openssh-client/etc/ssh/moduli \