wok-next view dropbear/receipt @ rev 20709
cdrdao: add patch.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat May 26 17:09:29 2018 +0300 (2018-05-26) |
parents | 0e7893ac206d |
children | 68405ac5fe8a |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="dropbear"
4 VERSION="2017.75"
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"
11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
12 WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL"
14 case "$ARCH" in
15 i486) BUILD_DEPENDS="zlib-dev pam pam-dev"; SPLIT="dropbear-pam";;
16 x86_64) BUILD_DEPENDS="zlib-dev";;
17 arm*) BUILD_DEPENDS="";;
18 esac
20 compile_rules() {
21 # Handle multiarch compilation.
22 case "$ARCH" in
23 arm)
24 CROSS_ARGS="--disable-zlib"
25 CROSS_BUGS="Fails to find zlib: -lz... no" ;;
26 esac
28 local i DROPBEARS="dropbearkey dropbearconvert dbclient scp"
29 sed -iold -e 's|/usr/.*/xauth|/usr/bin/xauth|' \
30 -e 's|ENABLE_SVR_PAM_AUTH|ENABLE_SVR_PASSWORD_AUTH|' \
31 options.h
33 ./configure \
34 --prefix=/usr \
35 --without-pam \
36 $CONFIGURE_ARGS $CROSS_ARGS &&
37 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
38 install -dm755 $install/usr/sbin &&
39 install -m755 dropbearmulti $install/usr/sbin/dropbear || exit 1
41 # No PAM support in ARM
42 case "$ARCH" in
43 arm) echo "Skipping Dropbear PAM..." ;;
44 i?86)
45 sed -i 's|ENABLE_SVR_PASSWORD_AUTH|ENABLE_SVR_PAM_AUTH|' options.h
46 ./configure \
47 --enable-pam \
48 $CONFIGURE_ARGS &&
49 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
50 install -m755 dropbearmulti $install/usr/sbin/dropbear-pam || return 1
51 ;;
52 esac
54 install -dm755 $install/usr/bin &&
55 for i in $DROPBEARS ssh; do
56 ln -s ../sbin/dropbear $install/usr/bin/$i || exit 1
57 done
59 cook_pick_manpages $src/*.1 $src/*.8
60 cook_pick_docs CHANGES INSTALL LICENSE MULTI README SMALL TODO
62 # Config file and init script.
63 mkdir -p $install/etc
64 cp -a $stuff/dropbear $install/etc
65 cp -a $stuff/init.d $install/etc
66 cp -a $stuff/sshx $install/usr/bin
67 ln -s sshx $install/usr/bin/pppssh
68 ln -s sshx $install/usr/bin/sshfbvnc
69 touch $install/etc/dropbear/dropbear_dss_host_key \
70 $install/etc/dropbear/dropbear_rsa_host_key \
71 $install/etc/dropbear/dropbear_ecdsa_host_key
73 # PAM
74 cp -a $stuff/pam.d $install/etc
76 # Fix dropbear initscript perms
77 chown -R root:root $install
79 ln -s daemon $install/etc/init.d/sshd
81 }
83 genpkg_rules() {
84 case $PACKAGE in
85 dropbear)
86 copy @std
87 rm -f $fs/usr/sbin/dropbear-pam
88 rm -r $fs/etc/pam.d/
89 DEPENDS="zlib"
90 CONFIG_FILES="/etc/dropbear"
91 PROVIDE="ssh"
92 TAGS="ssh"
93 ;;
94 dropbear-pam)
95 copy dropbear-pam pam.d/
96 mv $fs/usr/sbin/dropbear-pam $fs/usr/sbin/dropbear
97 DEPENDS="dropbear pam"
98 CAT="security|with PAM support"
99 PROVIDE="dropbear:pam ssh:pam"
100 TAGS="ssh"
101 ;;
102 esac
103 }
105 # Post message when installing.
106 post_install_dropbear() {
107 while read dropbear openssh; do
108 [ -s "$1/$openssh" ] || continue
109 chroot "$1/" dropbearconvert openssh dropbear $openssh $dropbear
110 chroot "$1/" dropbearkey -y -f $dropbear | grep Fingerprint
111 done <<EOT
112 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
113 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
114 /etc/dropbear/dropbear_ecdsa_host_key /etc/ssh/ssh_host_ecdsa_key
115 EOT
116 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
117 #ssh stream tcp nowait root dropbear dropbear -i -b /etc/dropbear/banner
118 EOT
119 [ -n "$quiet" ] && return
120 cat <<EOT
122 .-------------------------------------------------.
123 | To start dropbear server you can run: |
124 | |
125 | /etc/init.d/dropbear start |
126 | Or add dropbear to RUN_DAEMONS in /etc/rcS.conf |
127 '-------------------------------------------------'
128 EOT
129 }
131 post_remove_dropbear() {
132 grep -q dropbear "$1/etc/inetd.conf" &&
133 sed -i '/dropbear/d' "$1/etc/inetd.conf"
134 }
136 post_remove_dropbear_pam() {
137 tazpkg -gi dropbear --forced
138 }