diff options
Diffstat (limited to 'debian/rules')
-rwxr-xr-x | debian/rules | 26 |
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 |
45 | SSH_EXTRAVERSION := Debian-$(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p' | sed -e 's/[^-]*-//') | 45 | SSH_EXTRAVERSION := Debian-$(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p' | sed -e 's/[^-]*-//') |
46 | 46 | ||
47 | DISTRIBUTOR := $(shell dpkg-vendor --derives-from Ubuntu 2>/dev/null && echo Ubuntu) | 47 | DISTRIBUTOR := $(shell if dpkg-vendor --derives-from Ubuntu 2>/dev/null; then echo Ubuntu; else echo Debian; fi) |
48 | ifeq ($(DISTRIBUTOR),Ubuntu) | 48 | ifeq ($(DISTRIBUTOR),Ubuntu) |
49 | DEFAULT_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games | 49 | DEFAULT_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games |
50 | else | 50 | else |
@@ -115,6 +115,16 @@ confflags_udeb += --with-ldflags='-Wl,--as-needed' | |||
115 | %: | 115 | %: |
116 | dh $@ | 116 | dh $@ |
117 | 117 | ||
118 | DISTRIBUTOR_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 | |||
125 | debian/%: debian/%.in | ||
126 | sed 's/@DISTRIBUTOR@/$(DISTRIBUTOR)/g' $< >$@ | ||
127 | |||
118 | override_dh_auto_configure: | 128 | override_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 | ||
160 | override_dh_clean: | ||
161 | dh_clean | ||
162 | rm -f $(DISTRIBUTOR_REPLACE) | ||
163 | |||
150 | override_dh_auto_install: | 164 | override_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 | ||
153 | override_dh_install: | 167 | override_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 | ||
177 | override_dh_installinit: | 191 | override_dh_installinit: |
178 | dh_installinit -n --name ssh | 192 | dh_installinit -n --name ssh |
193 | ifeq ($(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 | ||
198 | endif | ||
179 | 199 | ||
180 | override_dh_installpam: | 200 | override_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 | ||
192 | override_dh_installdeb: | 212 | override_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 \ |