wok-6.x view openssh-pam/receipt @ rev 18689

openssh, openssh-pam: fix post_install() with --root
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Dec 11 00:40:59 2015 +0200 (2015-12-11)
parents ab249f78a473
children 9e01bc6321ea
line source
1 # SliTaz package receipt.
3 PACKAGE="openssh-pam"
4 VERSION="7.1p1"
5 CATEGORY="security"
6 SHORT_DESC="Openbsd Secure Shell using PAM."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 SOURCE="openssh"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="http://www.openssh.org/"
12 WGET_URL="http://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/$TARBALL"
13 CONFIG_FILES="/etc/ssh /etc/inetd.conf"
14 TAGS="ssh security"
16 PROVIDE="openssh:pam ssh:pam"
17 DEPENDS="sftp-server libcrypto zlib pam"
18 BUILD_DEPENDS="libcrypto-dev zlib-dev openssl-dev pam pam-dev"
19 TAZPANEL_DAEMON="man::sshd|edit::/etc/ssh/sshd_config|options::OPENSSH_OPTIONS|web::$WEB_SITE"
21 # Rules to configure and make the package.
22 compile_rules()
23 {
24 unset LD # for cross compiling with --disable-strip
25 ./configure \
26 --prefix=/usr \
27 --sysconfdir=/etc/ssh \
28 --libexecdir=/usr/sbin \
29 --with-privsep-user=nobody \
30 --with-xauth=/usr/bin/xauth \
31 --with-privsep-path=/var/run/sshd \
32 --without-ssh1 \
33 --with-pam \
34 --disable-strip \
35 $CONFIGURE_ARGS &&
36 make STRIP_OPT="" &&
37 make DESTDIR=$DESTDIR install
38 }
40 # Rules to gen a SliTaz package suitable for Tazpkg.
41 genpkg_rules()
42 {
43 mkdir -p $fs/usr $fs/etc/init.d $fs/etc/ssh
44 cp -a $install/usr/sbin $install/usr/bin $fs/usr
45 rm -f $fs/usr/sbin/sftp-server
46 cp -a $install/etc $fs
47 cp ../$SOURCE/stuff/openssh $fs/etc/init.d
48 sed -i 's/.*UsePAM.*/UsePAM yes/' $fs/etc/ssh/sshd_config
49 sed -i 's|/usr/libexec/sftp-server|/usr/sbin/sftp-server|' \
50 $fs/etc/ssh/sshd_config
51 }
53 post_install()
54 {
55 grep -q ssh "$1/etc/inetd.conf" || cat >> "$1/etc/inetd.conf" <<EOT
56 #ssh stream tcp nowait root sshd sshd -i
57 EOT
58 while read dropbear openssh ; do
59 [ -s "$1$dropbear" ] || continue
60 dropbearconvert dropbear openssh "$1$dropbear" "$1$openssh"
61 dropbearkey -y -f "$1$dropbear" | grep ssh > "$1$openssh.pub"
62 dropbearkey -y -f "$1$dropbear" | grep Fingerprint
63 done <<EOT
64 /etc/dropbear/dropbear_rsa_host_key /etc/ssh/ssh_host_rsa_key
65 /etc/dropbear/dropbear_dss_host_key /etc/ssh/ssh_host_dsa_key
66 EOT
68 chroot "$1/" ssh-keygen -A
69 }
71 post_remove()
72 {
73 grep -q sshd "$1/etc/inetd.conf" && sed -i '/sshd/d' "$1/etc/inetd.conf"
74 }