/
rules
executable file
·45 lines (34 loc) · 1.66 KB
/
rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/make -f
DEB_DIVERT_EXTENSION = .debathena
DEB_DIVERT_FILES_debathena-ssh-server-config += \
/etc/ssh/sshd_config.debathena
DEB_UNDIVERT_FILES_debathena-ssh-server-config += \
/etc/default/ssh.debathena
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/config-package.mk
ifneq ($(wildcard /usr/share/openssh/sshd_config),)
PRIVSEP = yes
debian/sshd_config.debathena-orig: $(call debian_check_files,/usr/share/openssh/sshd_config)
cp $< $@
else
ifeq ($(shell dpkg --compare-versions \
"`dpkg-query --showformat='$${Version}' --show openssh-server`" ">=" 1:4.3 && echo y),y)
PRIVSEP = yes
debian/sshd_config.debathena-orig: /var/lib/dpkg/info/openssh-server.postinst
perl -0pe 's/^.*<<EOF[^\n]*\n(.*\n)EOF\n.*$$/$$1/s or die;' $< > $@
else
PRIVSEP = no
debian/sshd_config.debathena-orig: /var/lib/dpkg/info/ssh-krb5.postinst
perl -0pe 's/^.*<<EOF[^\n]*\n(.*\n)EOF\n.*<<EOF[^\n]*\n.*\nEOF\n.*<<EOF[^\n]*\n(.*\n)EOF\n.*<<EOF[^\n]*\n(.*\n)EOF\n.*$$/$$1$$2$$3/s or die;' $< > $@
endif
endif
common-build-indep:: debian/sshd_config.debathena
debian/sshd_config.debathena: debian/sshd_config.debathena-orig
perl -0pe ' \
s/^#?GSSAPIAuthentication .*$$/GSSAPIAuthentication yes\nGSSAPIKeyExchange yes\nGSSAPIStrictAcceptorCheck no/m and \
s/^#?GSSAPICleanupCredentials .*$$/GSSAPICleanupCredentials yes/m and \
s/^#?ChallengeResponseAuthentication .*$$/ChallengeResponseAuthentication yes/m and \
s/^#?UsePrivilegeSeparation .*$$/UsePrivilegeSeparation $(PRIVSEP)/m and \
s/^#?PasswordAuthentication .*$$/PasswordAuthentication no/m or die;' $< > $@
clean::
rm -f debian/sshd_config.debathena debian/sshd_config.debathena-orig