wok view openssh-pam/receipt @ rev 21804

Up vlc (3.0.6)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Aug 15 18:25:28 2019 +0200 (2019-08-15)
parents 809015307697
children f18534b5699c
line source
1 # SliTaz package receipt.
3 PACKAGE="openssh-pam"
4 VERSION="7.9p1"
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 /etc/inetd.conf"
14 TAGS="ssh security"
16 PROVIDE="openssh:pam ssh:pam"
17 DEPENDS="sftp-server libcrypto zlib pam"
18 BUILD_DEPENDS="libcrypto-dev zlib-dev openssl-dev pam pam-dev gtk+-dev"
19 SUGGESTED="gtk+"
20 TAZPANEL_DAEMON="man::sshd|edit::/etc/ssh/sshd_config|options::OPENSSH_OPTIONS|web::$WEB_SITE"
22 # Rules to configure and make the package.
23 compile_rules()
24 {
25 patch -p1 < $WOK/$SOURCE/stuff/knock.u
26 unset LD # for cross compiling with --disable-strip
27 ./configure \
28 --prefix=/usr \
29 --sysconfdir=/etc/ssh \
30 --libexecdir=/usr/sbin \
31 --with-privsep-user=nobody \
32 --with-xauth=/usr/bin/xauth \
33 --with-privsep-path=/var/run/sshd \
34 --with-pam \
35 --disable-strip \
36 $CONFIGURE_ARGS &&
37 make STRIP_OPT="" &&
38 make DESTDIR=$DESTDIR install
39 install -d -m 755 $DESTDIR/usr/share/doc &&
40 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc
41 cd contrib &&
42 cc -Wall $(pkg-config --cflags gtk+-2.0) gnome-ssh-askpass2.c \
43 -o gnome-ssh-askpass $(pkg-config --libs gtk+-2.0) -lX11 &&
44 cp gnome-ssh-askpass $DESTDIR/usr/bin/ssh-askpass
45 }
47 # Rules to gen a SliTaz package suitable for Tazpkg.
48 genpkg_rules()
49 {
50 mkdir -p $fs/usr $fs/etc/init.d $fs/etc/ssh
51 cp -a $install/usr/sbin $install/usr/bin $fs/usr
52 rm -f $fs/usr/sbin/sftp-server
53 install -D -m 755 -oroot -groot $src/contrib/sshd.pam.generic $fs/etc/pam.d/sshd
54 install -m 755 -oroot -groot $src/contrib/ssh-copy-id $fs/usr/bin
55 cp $src/contrib/ssh-copy-id.1 $install/usr/share/man/cat1
56 cp -a $install/etc $fs
57 cp ../$SOURCE/stuff/openssh $fs/etc/init.d
58 sed -i 's/.*UsePAM.*/UsePAM yes/' $fs/etc/ssh/sshd_config
59 sed -i 's|/usr/libexec/sftp-server|/usr/sbin/sftp-server|' \
60 $fs/etc/ssh/sshd_config
62 cat >> $fs/etc/ssh/ssh_config <<EOT
64 # client bug CVE-2016-0777 and CVE-2016-0778
65 Host *
66 UseRoaming no
68 # From https://wiki.gentoo.org/wiki/SSH_jump_host
69 Host *+*
70 ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') exec nc -w1 $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/:/ /')
72 EOT
73 }
75 post_install()
76 {
77 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
78 #ssh stream tcp nowait root sshd sshd -i
79 EOT
80 while read dropbear openssh ; do
81 [ -s "$1$dropbear" ] || continue
82 chroot "$1/" dropbearconvert dropbear openssh $dropbear $openssh
83 chroot "$1/" dropbearkey -y -f $dropbear | grep ssh > "$1$openssh.pub"
84 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
85 done <<EOT
86 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
87 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
88 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key
89 EOT
91 chroot "$1/" ssh-keygen -A
92 }
94 post_remove()
95 {
96 grep -q sshd "$1/etc/inetd.conf" && sed -i '/sshd/d' "$1/etc/inetd.conf"
97 }