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