wok-next view dropbear/receipt @ rev 19634
Up Xorg (first chunk)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Feb 10 01:19:30 2017 +0200 (2017-02-10) |
parents | 7c66c894e9ba |
children | 2e9df1b30cc2 |
line source
1 # SliTaz package receipt.
3 PACKAGE="dropbear"
4 VERSION="2016.74"
5 CATEGORY="security"
6 SHORT_DESC="Lightweight SSH2 server and client"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="MIT"
9 WEB_SITE="http://matt.ucc.asn.au/dropbear/dropbear.html"
10 CONFIG_FILES="/etc/dropbear"
11 SUGGESTED="sftp-server"
12 PROVIDE="ssh"
13 TAGS="ssh"
14 HOST_ARCH="i486 arm"
16 TARBALL="$PACKAGE-$VERSION.tar.bz2"
17 WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL"
19 DEPENDS="zlib"
20 BUILD_DEPENDS="zlib-dev pam pam-dev"
21 SPLIT="dropbear-pam"
23 # Handle multiarch compilation.
24 case "$ARCH" in
25 arm)
26 BUILD_DEPENDS=""
27 CROSS_ARGS="--disable-zlib"
28 CROSS_BUGS="Fails to find zlib: -lz... no" ;;
29 esac
31 # Rules to configure and make the package.
32 compile_rules()
33 {
34 local i
35 local DROPBEARS
36 DROPBEARS="dropbearkey dropbearconvert dbclient scp"
37 sed -i -e 's|/usr/.*/xauth|/usr/bin/xauth|' \
38 -e 's|/usr/.*/sftp-server|/usr/sbin/sftp-server|' \
39 -e 's|ENABLE_SVR_PAM_AUTH|ENABLE_SVR_PASSWORD_AUTH|' \
40 options.h
41 ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS $CROSS_ARGS &&
42 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
43 install -d -m 755 $DESTDIR/usr/sbin &&
44 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear &&
45 chown 0.0 $DESTDIR/usr/sbin/dropbear || exit 1
47 # No pam support in ARM
48 case "$ARCH" in
49 arm) echo "Skipping Dropbear PAM..." ;;
50 i?86)
51 sed -i 's|ENABLE_SVR_PASSWORD_AUTH|ENABLE_SVR_PAM_AUTH|' \
52 options.h
53 ./configure --prefix=/usr --enable-pam $CONFIGURE_ARGS &&
54 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
55 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear-pam &&
56 chown 0.0 $DESTDIR/usr/sbin/dropbear-pam || exit 1 ;;
57 esac
59 install -d -m 755 $DESTDIR/usr/bin &&
60 for i in $DROPBEARS ssh; do
61 ln -s ../sbin/dropbear $DESTDIR/usr/bin/$i || exit 1
62 done
63 install -d -m 755 $DESTDIR/usr/share/man/man1 &&
64 install -m 644 $src/*.1 $DESTDIR/usr/share/man/man1 &&
65 install -d -m 755 $DESTDIR/usr/share/man/man8 &&
66 install -m 644 $src/*.8 $DESTDIR/usr/share/man/man8 &&
67 install -d -m 755 $DESTDIR/usr/share/doc &&
68 install -m 644 $src/[A-Z][A-Z]* $DESTDIR/usr/share/doc
69 }
71 # Rules to gen a SliTaz package suitable for Tazpkg.
72 genpkg_rules()
73 {
74 mkdir -p $fs/usr
75 cp -a $install/usr/bin $fs/usr
76 cp -a $install/usr/sbin $fs/usr
77 rm -f $fs/usr/sbin/dropbear-pam
78 # Config file and init script.
79 mkdir -p $fs/etc
80 cp -a $stuff/dropbear $fs/etc
81 cp -a $stuff/init.d $fs/etc
82 ln -s daemon $fs/etc/init.d/sshd
83 cp -a $stuff/sshx $fs/usr/bin
84 ln -s sshx $fs/usr/bin/pppssh
85 ln -s sshx $fs/usr/bin/sshfbvnc
86 touch $fs/etc/dropbear/dropbear_dss_host_key \
87 $fs/etc/dropbear/dropbear_rsa_host_key \
89 # Fix dropbear initscript perms
90 chown -R root.root $fs
91 }
93 # Post message when installing.
94 post_install()
95 {
96 while read dropbear openssh ; do
97 [ -s "$1/$openssh" ] || continue
98 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear
99 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
100 done <<EOT
101 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
102 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
103 EOT
104 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
105 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner
106 EOT
107 [ -n "$quiet" ] && return
108 echo -e "\nTo starts $PACKAGE server you can run :\n"
109 echo "/etc/init.d/$PACKAGE start"
110 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
111 }
113 post_remove()
114 {
115 grep -q dropbear "$1/etc/inetd.conf" && sed -i '/dropbear/d' "$1/etc/inetd.conf"
116 }