summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules200
1 files changed, 33 insertions, 167 deletions
diff --git a/debian/rules b/debian/rules
index ba78595af..ab04b8e19 100755
--- a/debian/rules
+++ b/debian/rules
@@ -24,10 +24,8 @@ DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
24DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 24DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
25 25
26ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) 26ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
27 confflags += --build=$(DEB_HOST_GNU_TYPE)
28 CC := gcc 27 CC := gcc
29else 28else
30 confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
31 CC := $(DEB_HOST_GNU_TYPE)-gcc 29 CC := $(DEB_HOST_GNU_TYPE)-gcc
32 RUN_TESTS := 30 RUN_TESTS :=
33endif 31endif
@@ -69,7 +67,7 @@ endif
69SUPERUSER_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 67SUPERUSER_PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
70 68
71# Common path configuration. 69# Common path configuration.
72confflags += --prefix=/usr --sysconfdir=/etc/ssh --libexecdir=/usr/lib/openssh --mandir=/usr/share/man 70confflags += --sysconfdir=/etc/ssh
73 71
74# Common build options. 72# Common build options.
75confflags += --disable-strip 73confflags += --disable-strip
@@ -117,40 +115,33 @@ confflags_udeb += --with-cflags='$(cflags_udeb)'
117confflags += --with-ldflags='$(strip -Wl,--as-needed $(PIC_LDFLAGS) $(HARDENING_LDFLAGS))' 115confflags += --with-ldflags='$(strip -Wl,--as-needed $(PIC_LDFLAGS) $(HARDENING_LDFLAGS))'
118confflags_udeb += --with-ldflags='-Wl,--as-needed' 116confflags_udeb += --with-ldflags='-Wl,--as-needed'
119 117
120build: build-deb build-udeb 118%:
119 dh $@
121 120
122build-deb: build-deb-stamp 121override_dh_auto_configure:
123build-deb-stamp: 122 dh_auto_configure -Bbuild-deb -- $(confflags)
124 dh_testdir 123 dh_auto_configure -Bbuild-udeb -- $(confflags_udeb)
125 mkdir -p build-deb
126 cd build-deb && ../configure $(confflags)
127 124
125override_dh_auto_build:
128 # Debian's /var/log/btmp has inappropriate permissions. 126 # Debian's /var/log/btmp has inappropriate permissions.
129 perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-deb/config.h 127 perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-deb/config.h
128 perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-udeb/config.h
129
130 # Avoid libnsl linkage. Ugh.
131 perl -pi -e 's/ +-lnsl//' build-udeb/config.status
132 cd build-udeb && ./config.status
130 133
131 $(MAKE) -C build-deb -j 2 ASKPASS_PROGRAM='/usr/bin/ssh-askpass' 134 $(MAKE) -C build-deb -j 2 ASKPASS_PROGRAM='/usr/bin/ssh-askpass'
135 $(MAKE) -C build-udeb -j 2 ASKPASS_PROGRAM='/usr/bin/ssh-askpass' ssh scp sftp sshd ssh-keygen
136
132 $(MAKE) -C contrib gnome-ssh-askpass2 CC='$(CC) $(OPTFLAGS) -g -Wall -Wl,--as-needed' 137 $(MAKE) -C contrib gnome-ssh-askpass2 CC='$(CC) $(OPTFLAGS) -g -Wall -Wl,--as-needed'
138
139override_dh_auto_test:
133ifeq ($(RUN_TESTS),yes) 140ifeq ($(RUN_TESTS),yes)
134 $(MAKE) -C debian/tests 141 $(MAKE) -C debian/tests
135endif 142endif
136 143
137 touch build-deb-stamp 144override_dh_auto_clean:
138
139build-udeb: build-udeb-stamp
140build-udeb-stamp:
141 dh_testdir
142 mkdir -p build-udeb
143 cd build-udeb && ../configure $(confflags_udeb)
144 # Debian's /var/log/btmp has inappropriate permissions.
145 perl -pi -e 's,.*#define USE_BTMP .*,/* #undef USE_BTMP */,' build-udeb/config.h
146 # Avoid libnsl linkage. Ugh.
147 perl -pi -e 's/ +-lnsl//' build-udeb/config.status
148 cd build-udeb && ./config.status
149 $(MAKE) -C build-udeb -j 2 ASKPASS_PROGRAM='/usr/bin/ssh-askpass' ssh scp sftp sshd ssh-keygen
150 touch build-udeb-stamp
151
152clean:
153 dh_testdir
154 rm -rf build-deb build-udeb 145 rm -rf build-deb build-udeb
155ifeq ($(RUN_TESTS),yes) 146ifeq ($(RUN_TESTS),yes)
156 $(MAKE) -C debian/tests clean 147 $(MAKE) -C debian/tests clean
@@ -158,15 +149,8 @@ endif
158 $(MAKE) -C contrib clean 149 $(MAKE) -C contrib clean
159 (cat debian/copyright.head; iconv -f ISO-8859-1 -t UTF-8 LICENCE) \ 150 (cat debian/copyright.head; iconv -f ISO-8859-1 -t UTF-8 LICENCE) \
160 > debian/copyright 151 > debian/copyright
161 dh_clean
162
163install: DH_OPTIONS=-a
164install: build
165 dh_testdir
166 dh_testroot
167 dh_prep
168 dh_installdirs
169 152
153override_dh_auto_install:
170 $(MAKE) -C build-deb DESTDIR=`pwd`/debian/openssh-client install-nokeys 154 $(MAKE) -C build-deb DESTDIR=`pwd`/debian/openssh-client install-nokeys
171 155
172 rm -f debian/openssh-client/etc/ssh/sshd_config 156 rm -f debian/openssh-client/etc/ssh/sshd_config
@@ -182,18 +166,8 @@ install: build
182 mv debian/openssh-client/usr/share/man/man8/sftp-server.8 debian/openssh-server/usr/share/man/man8/ 166 mv debian/openssh-client/usr/share/man/man8/sftp-server.8 debian/openssh-server/usr/share/man/man8/
183 rmdir debian/openssh-client/usr/sbin debian/openssh-client/var/run/sshd 167 rmdir debian/openssh-client/usr/sbin debian/openssh-client/var/run/sshd
184 168
185 install -m 755 contrib/ssh-copy-id debian/openssh-client/usr/bin/ssh-copy-id
186 install -m 644 -c contrib/ssh-copy-id.1 debian/openssh-client/usr/share/man/man1/ssh-copy-id.1
187
188 install -s -o root -g root -m 755 contrib/gnome-ssh-askpass2 debian/ssh-askpass-gnome/usr/lib/openssh/gnome-ssh-askpass 169 install -s -o root -g root -m 755 contrib/gnome-ssh-askpass2 debian/ssh-askpass-gnome/usr/lib/openssh/gnome-ssh-askpass
189 install -m 644 debian/gnome-ssh-askpass.1 debian/ssh-askpass-gnome/usr/share/man/man1/gnome-ssh-askpass.1
190 install -m 644 debian/ssh-askpass-gnome.png debian/ssh-askpass-gnome/usr/share/pixmaps/ssh-askpass-gnome.png
191
192 install -m 755 debian/ssh-argv0 debian/openssh-client/usr/bin/ssh-argv0
193 install -m 644 debian/ssh-argv0.1 debian/openssh-client/usr/share/man/man1/ssh-argv0.1
194 170
195 install -o root -g root debian/openssh-server.init debian/openssh-server/etc/init.d/ssh
196 install -o root -g root -m 644 debian/openssh-server.default debian/openssh-server/etc/default/ssh
197 install -o root -g root debian/openssh-server.if-up debian/openssh-server/etc/network/if-up.d/openssh-server 171 install -o root -g root debian/openssh-server.if-up debian/openssh-server/etc/network/if-up.d/openssh-server
198 install -o root -g root -m 644 debian/openssh-server.ufw.profile debian/openssh-server/etc/ufw/applications.d/openssh-server 172 install -o root -g root -m 644 debian/openssh-server.ufw.profile debian/openssh-server/etc/ufw/applications.d/openssh-server
199 173
@@ -209,26 +183,23 @@ install: build
209 debian/openssh-client/etc/ssh/moduli \ 183 debian/openssh-client/etc/ssh/moduli \
210 debian/openssh-client/etc/ssh/ssh_config 184 debian/openssh-client/etc/ssh/ssh_config
211 185
212# Build architecture-independent files here. 186override_dh_installdocs:
213binary-indep: binary-ssh binary-ssh-krb5 187 dh_installdocs -Nopenssh-server -Nssh
214 188 dh_installdocs -popenssh-server -pssh --link-doc=openssh-client
215# Build architecture-dependent files here. 189 # Avoid breaking dh_installexamples later.
216binary-arch: binary-openssh-client binary-openssh-server 190 mkdir -p debian/openssh-server/usr/share/doc/openssh-client
217binary-arch: binary-ssh-askpass-gnome 191
218binary-arch: binary-openssh-client-udeb binary-openssh-server-udeb 192override_dh_installinit:
219 193 dh_installinit --name ssh
220binary-openssh-client: DH_OPTIONS=-popenssh-client 194
221binary-openssh-client: build install 195override_dh_installpam:
222 dh_testdir 196 dh_installpam --name sshd
223 dh_testroot 197
224 dh_installdebconf 198override_dh_fixperms:
225 dh_installdocs
226 dh_installchangelogs
227 dh_lintian
228 dh_strip
229 dh_compress
230 dh_fixperms 199 dh_fixperms
231 chmod u+s debian/openssh-client/usr/lib/openssh/ssh-keysign 200 chmod u+s debian/openssh-client/usr/lib/openssh/ssh-keysign
201
202override_dh_installdeb:
232 dh_installdeb 203 dh_installdeb
233 test ! -e debian/ssh/etc/ssh/ssh_prng_cmds \ 204 test ! -e debian/ssh/etc/ssh/ssh_prng_cmds \
234 || echo "/etc/ssh/ssh_prng_cmds" >> debian/openssh-client/DEBIAN/conffiles 205 || echo "/etc/ssh/ssh_prng_cmds" >> debian/openssh-client/DEBIAN/conffiles
@@ -236,27 +207,6 @@ binary-openssh-client: build install
236 ETC_SSH_MODULI debian/openssh-client/etc/ssh/moduli \ 207 ETC_SSH_MODULI debian/openssh-client/etc/ssh/moduli \
237 ETC_SSH_SSH_CONFIG debian/openssh-client/etc/ssh/ssh_config \ 208 ETC_SSH_SSH_CONFIG debian/openssh-client/etc/ssh/ssh_config \
238 debian/openssh-client/DEBIAN/preinst 209 debian/openssh-client/DEBIAN/preinst
239 dh_shlibdeps
240 dh_gencontrol
241 dh_md5sums
242 dh_builddeb
243
244binary-openssh-server: DH_OPTIONS=-popenssh-server
245binary-openssh-server: build install
246 dh_testdir
247 dh_testroot
248 dh_installdebconf
249 dh_installdocs
250 mv debian/openssh-server/usr/share/doc/openssh-server debian/openssh-server/usr/share/doc/openssh-client
251 rm -f debian/openssh-server/usr/share/doc/openssh-client/copyright
252 dh_installpam --name sshd
253 dh_lintian
254 dh_link
255 dh_installexamples
256 dh_strip
257 dh_compress
258 dh_fixperms
259 dh_installdeb
260 # Yes, ETC_PAM_D_SSH is meant to be spelled that way, to match the 210 # Yes, ETC_PAM_D_SSH is meant to be spelled that way, to match the
261 # old configuration file name we need to transfer. 211 # old configuration file name we need to transfer.
262 perl -i debian/substitute-conffile.pl \ 212 perl -i debian/substitute-conffile.pl \
@@ -264,85 +214,6 @@ binary-openssh-server: build install
264 ETC_INIT_D_SSH debian/openssh-server/etc/init.d/ssh \ 214 ETC_INIT_D_SSH debian/openssh-server/etc/init.d/ssh \
265 ETC_PAM_D_SSH debian/openssh-server/etc/pam.d/sshd \ 215 ETC_PAM_D_SSH debian/openssh-server/etc/pam.d/sshd \
266 debian/openssh-server/DEBIAN/preinst 216 debian/openssh-server/DEBIAN/preinst
267 dh_shlibdeps
268 dh_gencontrol
269 dh_md5sums
270 dh_builddeb
271
272binary-ssh: DH_OPTIONS=-pssh
273binary-ssh: build install
274 dh_testdir
275 dh_testroot
276 dh_installdirs
277 dh_installdocs
278 mv debian/ssh/usr/share/doc/ssh debian/ssh/usr/share/doc/openssh-client
279 rm -f debian/ssh/usr/share/doc/openssh-client/copyright
280 dh_lintian
281 dh_link
282 dh_compress
283 dh_fixperms
284 dh_installdeb
285 dh_gencontrol
286 dh_md5sums
287 dh_builddeb
288
289binary-ssh-krb5: DH_OPTIONS=-pssh-krb5
290binary-ssh-krb5: build install
291 dh_testdir
292 dh_testroot
293 dh_installdocs
294 dh_installchangelogs
295 dh_link
296 dh_compress
297 dh_fixperms
298 dh_installdeb
299 dh_gencontrol
300 dh_md5sums
301 dh_builddeb
302
303binary-ssh-askpass-gnome: DH_OPTIONS=-pssh-askpass-gnome
304binary-ssh-askpass-gnome: build install
305 dh_testdir
306 dh_testroot
307 dh_installdocs
308 dh_installexamples
309 dh_installchangelogs
310 dh_strip
311 dh_compress
312 dh_fixperms
313 dh_installdeb
314 dh_shlibdeps
315 dh_gencontrol
316 dh_md5sums
317 dh_builddeb
318
319binary-openssh-client-udeb: DH_OPTIONS=-popenssh-client-udeb
320binary-openssh-client-udeb: build install
321 dh_testdir
322 dh_testroot
323 dh_strip
324 dh_compress
325 dh_fixperms
326 dh_installdeb
327 dh_shlibdeps
328 dh_gencontrol
329 dh_md5sums
330 dh_builddeb
331
332binary-openssh-server-udeb: DH_OPTIONS=-popenssh-server-udeb
333binary-openssh-server-udeb: build install
334 dh_testdir
335 dh_testroot
336 dh_strip
337 dh_compress
338 dh_fixperms
339 dh_installdeb
340 dh_shlibdeps
341 dh_gencontrol
342 dh_md5sums
343 dh_builddeb
344
345binary: binary-indep binary-arch
346 217
347debian/faq.html: 218debian/faq.html:
348 wget -O - http://www.openssh.org/faq.html | \ 219 wget -O - http://www.openssh.org/faq.html | \
@@ -358,9 +229,4 @@ quilt-setup:
358 done 229 done
359 quilt push -a 230 quilt push -a
360 231
361.PHONY: build clean binary-indep binary-arch binary install
362.PHONY: build-deb build-udeb
363.PHONY: binary-openssh-client binary-openssh-server binary-ssh
364.PHONY: binary-ssh-krb5 binary-ssh-askpass-gnome
365.PHONY: binary-openssh-client-udeb binary-openssh-server-udeb
366.PHONY: quilt-setup 232.PHONY: quilt-setup