#!/usr/bin/make -f # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 # This is the debhelper compatability version to use. export DH_COMPAT=1 # This has to be exported to make some magic below work. export DH_OPTIONS ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) OPTFLAGS := -O2 else OPTFLAGS := -O0 endif #PKG_VER = $(shell perl -e 'print <> =~ /\((.*)\)/' debian/changelog) ifeq (,$(wildcard /usr/bin/po2debconf)) PO2DEBCONF := no MINDEBCONFVER := 0.5 else PO2DEBCONF := yes MINDEBCONFVER := 1.2.0 endif # We need a new libpam-runtime for sane PAM handling # (http://lists.debian.org/debian-devel-announce-0308/msg00012.html). # Unfortunately it's hard to detect during the build whether this is # appropriate, so woody-compatibility is a pain. I've had to punt and go for # a DEB_BUILD_SSH_WOODY environment variable. We can remove this hack once # we no longer care about woody. ifeq ($(DEB_BUILD_SSH_WOODY),) PAMSUBST := no PAMDEP := libpam-runtime (>= 0.76-14) else PAMSUBST := yes PAMDEP := libpam-runtime endif # Change the version string to include the Debian version SSH_VERSION := $(shell sed -e '/define/!d; s/.*\"\(.*\)\".*/\1/; q' = # 4.1.16) depends on it), the binary-arch target will generate a # better version for sarge. echo 1 > debian/po/output po2debconf debian/templates.master > debian/templates rm -f debian/po/output endif ifeq ($(PAMSUBST),yes) if [ -f debian/ssh.pam.new-style ]; then \ mv debian/ssh.pam.new-style debian/ssh.pam; \ fi endif dh_clean install: DH_OPTIONS= install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/tmp. $(MAKE) DESTDIR=`pwd`/debian/tmp install-nokeys rm -f debian/tmp/etc/ssh/sshd_config #Temporary hack: remove /usr/share/Ssh.bin, since we have no smartcard support anyway. rm -f debian/tmp/usr/share/Ssh.bin install -m 755 contrib/ssh-copy-id debian/tmp/usr/bin/ssh-copy-id install -m 644 -c contrib/ssh-copy-id.1 debian/tmp/usr/share/man/man1/ssh-copy-id.1 install -m 644 debian/moduli.5 debian/tmp/usr/share/man/man5/moduli.5 if [ -f contrib/gnome-ssh-askpass2 ]; then \ install -s -o root -g root -m 755 contrib/gnome-ssh-askpass2 debian/ssh-askpass-gnome/usr/lib/ssh/gnome-ssh-askpass; \ elif [ -f contrib/gnome-ssh-askpass1 ]; then \ install -s -o root -g root -m 755 contrib/gnome-ssh-askpass1 debian/ssh-askpass-gnome/usr/lib/ssh/gnome-ssh-askpass; \ fi install -m 644 debian/gnome-ssh-askpass.1 debian/ssh-askpass-gnome/usr/share/man/man1/gnome-ssh-askpass.1 install -m 755 debian/ssh-argv0 debian/tmp/usr/bin/ssh-argv0 install -m 644 debian/ssh-argv0.1 debian/tmp/usr/share/man/man1/ssh-argv0.1 install -o root -g root debian/init debian/tmp/etc/init.d/ssh install -o root -g root -m 644 debian/ssh.default debian/tmp/etc/default/ssh install -o root -g root -m 755 -d debian/tmp/var/run/sshd # Build architecture-independent files here. binary-indep: build install # nothing to do # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot ifeq ($(PO2DEBCONF),yes) po2debconf -e utf8 debian/templates.master > debian/templates endif dh_installdebconf dh_installdocs OVERVIEW README cat debian/copyright.head LICENCE > debian/tmp/usr/share/doc/ssh/copyright nroff RFC.nroff > debian/tmp/usr/share/doc/ssh/RFC gzip -9 debian/tmp/usr/share/doc/ssh/RFC rm -rf debian/tmp/usr/share/doc/ssh/RFC.nroff.gz ifeq ($(PAMSUBST),yes) # Clean up if we've done this already, to ensure idempotency. if [ -f debian/ssh.pam.new-style ]; then \ mv debian/ssh.pam.new-style debian/ssh.pam; \ fi cp -a debian/ssh.pam debian/ssh.pam.new-style sed -e "s/@include common-auth/auth required pam_unix.so/" \ -e "s/@include common-account/account required pam_unix.so/" \ -e "s/@include common-session/session required pam_unix.so/" \ -e "s/@include common-password/password required pam_unix.so/" \ debian/ssh.pam.new-style > debian/ssh.pam endif dh_installpam dh_installchangelogs ChangeLog dh_strip dh_compress dh_fixperms dh_installdeb test ! -e debian/tmp/etc/ssh/ssh_prng_cmds \ || echo "/etc/ssh/ssh_prng_cmds" >> debian/tmp/DEBIAN/conffiles dh_shlibdeps dh_gencontrol -- -V'debconf-depends=debconf (>= $(MINDEBCONFVER))' \ -V'pam-depends=$(PAMDEP)' dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install