# packages/openssh/auxbuild
#

# download and unpack tarball
TARVERSION="5.0p1"
TARDIR="${BUILD_PACKAGE}-${TARVERSION}"
TARBALL="${TARDIR}.tar.gz"
build_download "http://mirrors.evolva.ro/OpenSSH/portable/${TARBALL}"
build_unpack "${TARBALL}"

# invoke configure (directory, prefix, extra arguments)
export ac_cv_func_setlogin="no"
build_autoconf "${TARDIR}" "" "--sysconfdir=/etc/ssh --disable-strip --without-shadow --disable-lastlog --disable-utmp --disable-utmpx --disable-wtmp --disable-wtmpx --disable-libutil"

# run make, make install (directory, extra arguments)
build_make "${TARDIR}"
build_make "${TARDIR}" "install"

rm -f "${BUILDROOT}/usr/share/Ssh.bin"

# link configuration files to their local counterparts
(
    cd "${BUILDROOT}/etc/"
    mv "ssh" "ssh.local"
    ln -s "ssh.local" "ssh"
)
[ $? -eq 0 ]

# perform manual strip of executables (openssh build system calls host strip)
"${ARCH_CC_PREFIX}strip" "${BUILDROOT}/usr/bin/"* "${BUILDROOT}/usr/sbin/"* "${BUILDROOT}/usr/libexec/"*

true
# vim: ts=4:sw=4:expandtab:syntax=sh
