wok view openssh-pam/receipt @ rev 24011
mosh: create /usr/share/terminfo/x/xterm-256color link
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Feb 05 17:16:12 2021 +0000 (2021-02-05) |
parents | 848e2021d813 |
children | 6b6d14c9f7e9 |
line source
1 # SliTaz package receipt.
3 PACKAGE="openssh-pam"
4 VERSION="8.4p1"
5 CATEGORY="security"
6 SHORT_DESC="Openbsd Secure Shell using PAM."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 SOURCE="openssh"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="http://www.openssh.org/"
12 WGET_URL="http://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/$TARBALL"
13 CONFIG_FILES="/etc/ssh/*config /etc/ssh/moduli"
14 SECRET_FILES="/etc/ssh/*key*"
15 TAGS="ssh security"
17 PROVIDE="openssh:pam ssh:pam"
18 DEPENDS="sftp-server libcrypto zlib pam"
19 BUILD_DEPENDS="libcrypto-dev zlib-dev openssl-dev pam pam-dev gtk+-dev"
20 SUGGESTED="gtk+"
21 TAZPANEL_DAEMON="man::sshd|edit::/etc/ssh/sshd_config|options::OPENSSH_OPTIONS|web::$WEB_SITE"
23 current_version()
24 {
25 wget -O - ${WGET_URL%/*}/ 2>/dev/null | \
26 sed '/tar..z"/!d;s|.*ssh-\(.*\).tar..z".*|\1|' | tail -n1
27 }
29 # Rules to configure and make the package.
30 compile_rules()
31 {
32 unset LD # for cross compiling with --disable-strip
33 ./configure \
34 --prefix=/usr \
35 --sysconfdir=/etc/ssh \
36 --libexecdir=/usr/sbin \
37 --with-privsep-user=nobody \
38 --with-xauth=/usr/bin/xauth \
39 --with-privsep-path=/var/run/sshd \
40 --with-pam \
41 --disable-strip \
42 $CONFIGURE_ARGS &&
43 make STRIP_OPT="" &&
44 make -j 1 DESTDIR=$DESTDIR install
45 install -d -m 755 $DESTDIR/usr/share/doc &&
46 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc
47 cd contrib &&
48 cc -Wall $(pkg-config --cflags gtk+-2.0) gnome-ssh-askpass2.c \
49 -o gnome-ssh-askpass $(pkg-config --libs gtk+-2.0) -lX11 &&
50 cp gnome-ssh-askpass $DESTDIR/usr/bin/ssh-askpass
51 }
53 # Rules to gen a SliTaz package suitable for Tazpkg.
54 genpkg_rules()
55 {
56 mkdir -p $fs/usr $fs/etc/init.d $fs/etc/ssh
57 cp -a $install/usr/sbin $install/usr/bin $fs/usr
58 rm -f $fs/usr/sbin/sftp-server
59 install -D -m 755 -oroot -groot $src/contrib/sshd.pam.generic $fs/etc/pam.d/sshd
60 install -m 755 -oroot -groot $src/contrib/ssh-copy-id $fs/usr/bin
61 cp $src/contrib/ssh-copy-id.1 $install/usr/share/man/cat1
62 cp -a $install/etc $fs
63 cp ../$SOURCE/stuff/openssh $fs/etc/init.d
64 sed -i 's/.*UsePAM.*/UsePAM yes/' $fs/etc/ssh/sshd_config
65 sed -i 's|/usr/libexec/sftp-server|/usr/sbin/sftp-server|' \
66 $fs/etc/ssh/sshd_config
68 cat >> $fs/etc/ssh/ssh_config <<EOT
70 # client bug CVE-2016-0777 and CVE-2016-0778
71 Host *
72 UseRoaming no
74 # From https://wiki.gentoo.org/wiki/SSH_jump_host
75 Host *+*
76 ProxyCommand ssh \$(echo %h | sed 's/+[^+]*$//;s/\\([^+%%]*\\)%%\\([^+]*\\)\$/\\2 -l \\1/;s/:/ -p /') exec nc -w1 \$(echo %h | sed 's/^.*+//;/:/!s/\$/ %p/;s/:/ /')
78 EOT
79 }
81 post_install()
82 {
83 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
84 #ssh stream tcp nowait root sshd sshd -i
85 EOT
86 while read dropbear openssh ; do
87 [ -s "$1$dropbear" ] || continue
88 [ -s "$1$openssh" ] && continue
89 chroot "$1/" dropbearconvert dropbear openssh $dropbear $openssh
90 chroot "$1/" dropbearkey -y -f $dropbear | grep ssh > "$1$openssh.pub"
91 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
92 done <<EOT
93 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
94 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
95 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key
96 /etc/dropbear/dropbear_ed25519_host_key /etc/ssh/ssh_host_ed25519_key
97 EOT
99 chroot "$1/" ssh-keygen -A
100 }
102 post_remove()
103 {
104 grep -q sshd "$1/etc/inetd.conf" && sed -i '/sshd/d' "$1/etc/inetd.conf"
105 }