Belphegor の巣窟 - Linux Zaurus(略) - opensshの作成手順


openssh 4.6p1

cd $SOURCE
tar xvzf $ARCHIVE/openssh-4.6p1.tar.gz
cd openssh-4.6p1
CC=$TARGET-gcc AR=$TARGET-ar RANLIB=$TARGET-ranlib \
  enable_etc_default_login=no \
  ./configure --prefix=/opt/QtPalmtop --host=$TARGET
# LLONG_MAX, LLONG_MIN is undefined, so I'll define them.
uudecode -o /dev/stdout << EOF | bzip2 -dc | patch -p1
begin-base64 644 includes_h.patch.bz2
QlpoOTFBWSZTWY/GJ/0AAClfgEIwWH//8G7nikCv594gMADtkw1U8KD1M1PT
U0MGoAaaGTyJpoGGqnmmiYU9INAaABkAAGgJTVMSTyMoyNHqZDRtExNPUP1T
9UMm0OFNcxGbEnPyQcxShIIBP2gBg3CEzrkmQt3ndrZvYoQCNk8McHiM9lg4
ywQkTNaKgc6u2FeE0dWUfxL1PjJI1NEysgEoRqnFtBCJBwJtQpM3EECbWEQe
xaXULoWKZImwmREocd81MvMXBCXyGSQqtibB64E9OYWZ+Y2drpmk+fSU4ndq
e3xgaJ9s9oqJKTenELbyoQ73Qr0SwH64/6Cib1a4UN/KmLSJTcgvwsVITUVC
xbx07Vp5eQhDiGEfzFfWArReLuSKcKEhH4xP+g==
====
EOF
make all

# デバッグ情報の削除
find . -type f -and -perm +0100 | xargs --max-args=1 arm-linux-strip -g > /dev/null 2> /dev/null

# パッケージ作業用仮想ルートの作成、およびインストール
mkdir $SOURCE/openssh-root
make install prefix=$SOURCE/openssh-root/opt/QtPalmtop STRIP_OPT=""
# (注: "ssh-keygen: cannot execute binary file" は無視して良い)

# 不要なファイルの削除
rm -fR $SOURCE/openssh-root/opt/QtPalmtop/share/man

# コントロールファイルの作成
mkdir $SOURCE/openssh-root/CONTROL
cat > $SOURCE/openssh-root/CONTROL/control << EOF
Package: openssh
Priority: optional
Section: net
Version: 4.6p1
Architecture: arm
Maintainer: Yasuhiko Kamata (belphegor@belbel.or.jp)
Source: ftp://ftp.iij.ad.jp/pub/OpenBSD/OpenSSH/portable/openssh-4.6p1.tar.gz
Depends: 
Description: Open Secure SHell (SSH) implementation.
  OpenSSH is a FREE version of the SSH protocol suite of network connectivity tools
  that increasing numbers of people on the Internet are coming to rely on.
EOF

# インストール後スクリプトの作成
cat > $SOURCE/openssh-root/CONTROL/postinst << EOF
#!/bin/sh

# create directories, symbolic links
mkdir -p /var/empty
# create keys
if [ -z "" ] ; then \\
        if [ -f "/opt/QtPalmtop/etc/ssh_host_key" ] ; then \\
                echo "/opt/QtPalmtop/etc/ssh_host_key already exists, skipping." ; \\
        else \\
                /opt/QtPalmtop/bin/ssh-keygen -t rsa1 -f /opt/QtPalmtop/etc/ssh_host_key -N "" ; \\
        fi ; \\
        if [ -f /opt/QtPalmtop/etc/ssh_host_dsa_key ] ; then \\
                echo "/opt/QtPalmtop/etc/ssh_host_dsa_key already exists, skipping." ; \\
        else \\
                /opt/QtPalmtop/bin/ssh-keygen -t dsa -f /opt/QtPalmtop/etc/ssh_host_dsa_key -N "" ; \\
        fi ; \\
        if [ -f /opt/QtPalmtop/etc/ssh_host_rsa_key ] ; then \\
                echo "/opt/QtPalmtop/etc/ssh_host_rsa_key already exists, skipping." ; \\
        else \\
                /opt/QtPalmtop/bin/ssh-keygen -t rsa -f /opt/QtPalmtop/etc/ssh_host_rsa_key -N "" ; \\
        fi ; \\
fi ;
EOF
chmod 755 $SOURCE/openssh-root/CONTROL/postinst

# 設定ファイル群の指定
cat > $SOURCE/openssh-root/CONTROL/conffiles << EOF
/opt/QtPalmtop/etc/ssh_config
/opt/QtPalmtop/etc/sshd_config
EOF

# パッケージの作成
cd $SOURCE
ipkg-build openssh-root
					

Linux Zaurus(略)へ戻る


最終更新日: 2007/08/27 17:49:44