diff options
author | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2006-10-19 19:31:21 +0000 |
---|---|---|
committer | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2006-10-19 19:31:21 +0000 |
commit | 3b42ea2913d5aa8077aba9fe1761b824398f9804 (patch) | |
tree | 64bcbbc6876e27f863df0ef9e9346e22b8291294 /patches/openssh/openssh.SlackBuild | |
parent | 8faf3506c7ee2a4a2f210d11d41ba91d9bd27eea (diff) | |
download | slackbuilds-3b42ea2913d5aa8077aba9fe1761b824398f9804.tar.gz slackbuilds-3b42ea2913d5aa8077aba9fe1761b824398f9804.tar.bz2 |
fixing permissions, part 1
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@455 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'patches/openssh/openssh.SlackBuild')
-rwxr-xr-x | patches/openssh/openssh.SlackBuild | 218 |
1 files changed, 218 insertions, 0 deletions
diff --git a/patches/openssh/openssh.SlackBuild b/patches/openssh/openssh.SlackBuild new file mode 100755 index 00000000..95c62058 --- /dev/null +++ b/patches/openssh/openssh.SlackBuild @@ -0,0 +1,218 @@ +#!/bin/bash +# Copyright 2000 BSDi, Inc. Concord, CA, USA +# Copyright 2001, 2002, 2003, 2004 Slackware Linux, Inc. Concord, CA, USA +# Copyright 2006 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Small changes by rhatto. +# + +CWD="`pwd`" + +if [ -f "/etc/slackbuildrc" ]; then + source /etc/slackbuildrc +fi + +if [ -f "~/.slackbuildrc" ]; then + source ~/.slackbuildrc +fi + +PACKAGE="openssh" +VERSION=${VERSION:=4.4p1} +ARCH=${ARCH:=i486} +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC:=$CWD} +TMP=${TMP:=/tmp} +REPOS=${REPOS:=$TMP} + +if [ "$ARCH" == "x86_64" ]; then + LIBDIR=/usr/lib64 +else + LIBDIR=/usr/lib +fi + +RTOOL="wget" +PACKAGE_EXT="gz" +SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" +URL="ftp://ftp.openbsd.org.br/pub/OpenBSD/OpenSSH/portable/$SRC" + +if [ "$PACKAGE_EXT" == "bz2" ]; then + tarflag="j" +else + tarflag="z" +fi + +SRC_DIR="$SRC_DIR/$PACKAGE" +mkdir -p $SRC_DIR + +if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then + rm -f $SRC_DIR/$SRC.asc + wget "$URL" -O "$SRC_DIR/$SRC" + wget "$URL.asc" -O "$SRC_DIR/$SRC.asc" +fi + +gpg --import << EOGPG +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.0.4 (GNU/Linux) +Comment: For info see http://www.gnupg.org + +mQGiBDqa5pwRBADJSEyXXsgXiyytN93prDPTPmrueRP9lQQfgaQ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rvoVSbd0MR0FWX+bBZ0NjScNBo3kPSSCnQ6jRHokkz55r ++MHe7dqxCJ3pmu7aROl2fgug6wob+7+qXfKke/TdT6wuCb4CdFS6tPgPrfYV+iwq +2NB/BatePGg7Z6UALaULQ0m83DCEVLJNnjemEdIouShelikAAO7QDKMr7vAjH8n0 +zwMpwRMXnvCM6zYlS9i1kOm8LVATk0WyihpQGSaTukdPjKlG7sKwMu20ssK9DGVp +PgulTZ7rHqXl4juY8LQ2j4dPNaPoKWG8JuBVCsyf2D6GNW97PfKQSkzFeZsbVB4S +RQrVTchgBSYoxRVW3fLk/yc3TC5Abh6Gpj4izawUiEYEGBECAAYFAjqa5tQACgkQ +zo7LA4b/nEgftgCdHIZUDVAWDRa5siSi8Aos+IiyAgAAn02wGOl1Wo/YJ+RY+c6K +N58TmAPE +=rCFY +-----END PGP PUBLIC KEY BLOCK----- +EOGPG + +gpg --verify $SRC.asc $SRC || echo WARNING: Could not check signature or WRONG signature found. + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +fi + +# Clean target location: +TMP="$TMP/$PACKAGE" +PKG=$TMP/package-$PACKAGE +rm -rf $TMP +mkdir -p $PKG + +# Prepare the framework and extract the package: +cd $TMP +rm -rf $PKG openssh-$VERSION +tar xvf$tarflag $SRC_DIR/$SRC +cd openssh-$VERSION +chown -R root.root . + +# Compile package: +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --sysconfdir=/etc/ssh \ + --libdir=$LIBDIR \ + --without-pam \ + --with-md5-passwords \ + --with-tcp-wrappers \ + --with-default-path=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin \ + --with-ipv4-default \ + --with-privsep-path=/var/empty \ + --with-privsep-user=sshd \ + $ARCH-slackware-linux + +make || exit 32 + +# Install the package: +make install DESTDIR=$PKG + +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + +# Compress the installed manpages: +find $PKG/usr/man -type f -exec gzip -9 {} \; + +# Relink the slogin(1) man page +( cd $PKG/usr/man/man1 + rm -f slogin.1 + ln -sf ssh.1.gz slogin.1.gz +) + +# Install directory used with PrivilegeSeparation option: +mkdir -p $PKG/var/empty +chmod 755 $PKG/var/empty + +# Install docs: +mkdir -p $PKG/usr/doc/openssh-$VERSION +cp -a \ + CREDITS ChangeLog INSTALL LICENCE OVERVIEW README README.privsep README.smartcard RFC.nroff TODO WARNING.RNG \ + $PKG/usr/doc/openssh-$VERSION +chmod 644 $PKG/usr/doc/openssh-$VERSION/* + +# Install also 'ssh-copy-id' and its manpage from contrib: +( cd contrib + cp -a ssh-copy-id $PKG/usr/bin/ssh-copy-id + chown root.bin $PKG/usr/bin/ssh-copy-id + chmod 755 $PKG/usr/bin/ssh-copy-id + cat ssh-copy-id.1 | gzip -9c > $PKG/usr/man/man1/ssh-copy-id.1.gz +) + +# Fix some ownerships per FSSTND: +chown -R root.bin $PKG/usr/bin $PKG/usr/sbin + +( cd $PKG + + # Ditch the new host keys, since these have to be uniquely prepared on each machine: + rm -f etc/ssh/ssh_host_dsa_key + rm -f etc/ssh/ssh_host_dsa_key.pub + rm -f etc/ssh/ssh_host_rsa_key + rm -f etc/ssh/ssh_host_rsa_key.pub + rm -f etc/ssh/ssh_host_key + rm -f etc/ssh/ssh_host_key.pub + + # Set up the config script installation: + mv etc/ssh/ssh_config etc/ssh/ssh_config.new + mv etc/ssh/sshd_config etc/ssh/sshd_config.new + + # Add the init script: + mkdir -p etc/rc.d + cat $CWD/rc.sshd > etc/rc.d/rc.sshd + chmod 755 etc/rc.d/rc.sshd + + # Copy runtime installation files: + mkdir -p install + zcat $CWD/doinst.sh.gz > install/doinst.sh + cat $CWD/slack-desc > install/slack-desc +) + +# Create the package itself: +cd $PKG +makepkg -l y -c n $REPOS/openssh-$VERSION-$ARCH-$BUILD.tgz + +if [ "$CLEANUP" == "yes" ]; then + rm -rf $TMP +fi + |