wok annotate openssh/receipt @ rev 24336

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jan 28 18:19:21 2022 +0000 (2022-01-28)
parents 7bea68e23e6b
children 980adf6bb9e7
rev   line source
pascal@860 1 # SliTaz package receipt.
pascal@860 2
pascal@860 3 PACKAGE="openssh"
pascal@24099 4 VERSION="8.7p1"
pascal@860 5 CATEGORY="security"
pascal@860 6 SHORT_DESC="Openbsd Secure Shell."
pascal@860 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@14657 8 LICENSE="BSD"
pascal@860 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@1597 10 WEB_SITE="http://www.openssh.org/"
pascal@24099 11 WGET_URL="https://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/$TARBALL"
pascal@23902 12 CONFIG_FILES="/etc/ssh/*config /etc/ssh/moduli"
pascal@23902 13 SECRET_FILES="/etc/ssh/*key*"
pankso@16381 14 TAGS="ssh security"
pankso@16381 15 HOST_ARCH="i486 arm"
pankso@16381 16
pascal@24049 17 SPLIT="sftp-server"
pascal@14772 18 PROVIDE="ssh"
pascal@3628 19 DEPENDS="sftp-server libcrypto zlib"
pascal@20876 20 BUILD_DEPENDS="libcrypto-dev zlib-dev openssl-dev gtk+-dev"
pascal@20876 21 SUGGESTED="gtk+"
pankso@16381 22 TAZPANEL_DAEMON="man::sshd|edit::/etc/ssh/sshd_config|options|web::$WEB_SITE"
pascal@860 23
pascal@22825 24 current_version()
pascal@22825 25 {
pascal@22826 26 wget -O - ${WGET_URL%/*}/ 2>/dev/null | \
pascal@22826 27 sed '/tar..z"/!d;s|.*ssh-\(.*\).tar..z".*|\1|' | tail -n1
pascal@22825 28 }
pascal@22825 29
pascal@860 30 # Rules to configure and make the package.
pascal@860 31 compile_rules()
pascal@860 32 {
pankso@16381 33 unset LD # for cross compiling with --disable-strip
pankso@16381 34 ./configure \
pankso@16381 35 --prefix=/usr \
pankso@16381 36 --sysconfdir=/etc/ssh \
pankso@2213 37 --libexecdir=/usr/sbin \
pankso@16381 38 --with-privsep-user=nobody \
pascal@16754 39 --with-xauth=/usr/bin/xauth \
pankso@16381 40 --with-privsep-path=/var/run/sshd \
pankso@16381 41 --without-pam \
pankso@16381 42 --disable-strip \
pascal@1514 43 $CONFIGURE_ARGS &&
pankso@16381 44 make STRIP_OPT="" &&
pascal@23631 45 make -j 1 DESTDIR=$DESTDIR install
pascal@19369 46 install -d -m 755 $DESTDIR/usr/share/doc &&
pascal@19371 47 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc
pascal@20876 48 cd contrib &&
pascal@20876 49 cc -Wall $(pkg-config --cflags gtk+-2.0) gnome-ssh-askpass2.c \
pascal@20877 50 -o gnome-ssh-askpass $(pkg-config --libs gtk+-2.0) -lX11 &&
pascal@20876 51 cp gnome-ssh-askpass $DESTDIR/usr/bin/ssh-askpass
pascal@860 52 }
pascal@860 53
pascal@860 54 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@860 55 genpkg_rules()
pascal@860 56 {
al@18689 57 mkdir -p $fs/usr $fs/etc/init.d $fs/etc/ssh
pascal@14772 58 cp -a $install/usr/sbin $install/usr/bin $fs/usr
pascal@3628 59 rm -f $fs/usr/sbin/sftp-server
pascal@20876 60 install -m 755 -oroot -groot $src/contrib/ssh-copy-id $fs/usr/bin
pascal@20876 61 cp $src/contrib/ssh-copy-id.1 $install/usr/share/man/cat1
pascal@14772 62 cp -a $install/etc $fs
slaxemulator@11063 63 cp $stuff/openssh $fs/etc/init.d
pascal@2598 64 sed -i 's|/usr/libexec/sftp-server|/usr/sbin/sftp-server|' \
pascal@2598 65 $fs/etc/ssh/sshd_config
pascal@18807 66
pascal@19409 67 cat >> $fs/etc/ssh/ssh_config <<EOT
pascal@19409 68
pascal@19409 69 # client bug CVE-2016-0777 and CVE-2016-0778
pascal@19409 70 Host *
pascal@19409 71 UseRoaming no
pascal@19409 72
pascal@19409 73 # From https://wiki.gentoo.org/wiki/SSH_jump_host
pascal@19409 74 Host *+*
pascal@23654 75 ProxyCommand ssh \$(echo %h | sed 's/+[^+]*$//;s/\\([^+%%]*\\)%%\\([^+]*\\)\$/\\2 -l \\1/;s/:/ -p /') exec nc -w1 \$(echo %h | sed 's/^.*+//;/:/!s/\$/ %p/;s/:/ /')
pascal@19409 76
pascal@19409 77 EOT
pascal@860 78 }
pascal@860 79
pascal@7303 80 post_install()
pascal@7303 81 {
al@18689 82 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
pascal@17048 83 #ssh stream tcp nowait root sshd sshd -i
pascal@17048 84 EOT
pascal@16753 85 while read dropbear openssh ; do
al@18689 86 [ -s "$1$dropbear" ] || continue
pascal@23995 87 [ -s "$1$openssh" ] && continue
pascal@18730 88 chroot "$1/" dropbearconvert dropbear openssh $dropbear $openssh
pascal@18730 89 chroot "$1/" dropbearkey -y -f $dropbear | grep ssh > "$1$openssh.pub"
pascal@18730 90 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
pascal@16753 91 done <<EOT
pascal@7303 92 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
pascal@7305 93 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
pascal@19829 94 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key
pascal@23868 95 /etc/dropbear/dropbear_ed25519_host_key /etc/ssh/ssh_host_ed25519_key
pascal@7303 96 EOT
al@18689 97
al@18689 98 chroot "$1/" ssh-keygen -A
pascal@7303 99 }
pascal@17048 100
pascal@17048 101 post_remove()
pascal@17048 102 {
al@18689 103 grep -q sshd "$1/etc/inetd.conf" && sed -i '/sshd/d' "$1/etc/inetd.conf"
pascal@17048 104 }