wok view dropbear/receipt @ rev 12839

dropbear: make it cross-compile for ARM (had to disable zlib)
author Christophe Lincoln <pankso@slitaz.org>
date Wed May 23 01:32:48 2012 +0200 (2012-05-23)
parents b2cca7c91b35
children caf768bb46f9
line source
1 # SliTaz package receipt.
3 PACKAGE="dropbear"
4 VERSION="2012.55"
5 CATEGORY="security"
6 SHORT_DESC="Light SSH client and server."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
9 WEB_SITE="http://matt.ucc.asn.au/dropbear/dropbear.html"
10 WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL"
11 CONFIG_FILES="/etc/dropbear"
12 SUGGESTED="sftp-server"
13 PROVIDE="ssh"
14 TAGS="ssh"
15 HOST_ARCH="i486 arm"
17 DEPENDS="zlib"
18 BUILD_DEPENDS="zlib-dev pam pam-dev"
20 # Handle multiarch compilation.
21 case "$ARCH" in
22 arm)
23 BUILD_DEPENDS=""
24 CROSS_ARGS="--disable-zlib"
25 CROSS_BUGS="Fails to find zlib: -lz... no" ;;
26 esac
28 # Rules to configure and make the package.
29 compile_rules()
30 {
31 local i
32 local DROPBEARS
33 DROPBEARS="dropbearkey dropbearconvert dbclient scp"
34 cd $src
35 sed -i -e 's|/usr/.*/xauth|/usr/bin/xauth|' \
36 -e 's|/usr/.*/sftp-server|/usr/sbin/sftp-server|' \
37 -e 's|ENABLE_SVR_PAM_AUTH|ENABLE_SVR_PASSWORD_AUTH|' \
38 options.h
39 ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS $CROSS_ARGS &&
40 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
41 install -d -m 755 $DESTDIR/usr/sbin &&
42 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear &&
43 chown 0.0 $DESTDIR/usr/sbin/dropbear || exit 1
45 # No pam support in ARM
46 case "$ARCH" in
47 arm) echo "Skipping Dropbear PAM..." ;;
48 i?86)
49 sed -i 's|ENABLE_SVR_PASSWORD_AUTH|ENABLE_SVR_PAM_AUTH|' \
50 options.h
51 ./configure --prefix=/usr --enable-pam $CONFIGURE_ARGS &&
52 make PROGRAMS="dropbear $DROPBEARS" MULTI=1 SCPPROGRESS=1 &&
53 install -m 755 dropbearmulti $DESTDIR/usr/sbin/dropbear-pam &&
54 chown 0.0 $DESTDIR/usr/sbin/dropbear-pam || exit 1 ;;
55 esac
57 install -d -m 755 $DESTDIR/usr/bin &&
58 for i in $DROPBEARS ssh; do
59 ln -s ../sbin/dropbear $DESTDIR/usr/bin/$i || exit 1
60 done
61 }
63 # Rules to gen a SliTaz package suitable for Tazpkg.
64 genpkg_rules()
65 {
66 mkdir -p $fs/usr
67 cp -a $install/usr/bin $fs/usr
68 cp -a $install/usr/sbin $fs/usr
69 rm -f $fs/usr/sbin/dropbear-pam
70 # Config file and init script.
71 mkdir -p $fs/etc
72 cp -a $stuff/dropbear $fs/etc
73 cp -a $stuff/init.d $fs/etc
74 cp -a $stuff/sshx $fs/usr/bin
75 touch $fs/etc/dropbear/dropbear_dss_host_key \
76 $fs/etc/dropbear/dropbear_rsa_host_key
78 # Fix dropbear initscript perms
79 chown -R root.root $fs
80 }
82 # Post message when installing.
83 post_install()
84 {
85 while read dropbear openssh ; do
86 [ -s $openssh ] || continue
87 dropbearconvert openssh dropbear ${root}$openssh ${root}$dropbear
88 dropbearkey -y -f ${root}$dropbear | grep Fingerprint
89 done <<EOT
90 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
91 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
92 EOT
93 echo -e "\nTo starts $PACKAGE server you can run :\n"
94 echo "/etc/init.d/$PACKAGE start"
95 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
96 }