[c5c522c] | 1 | #!/bin/sh |
---|
| 2 | #DEP:openssl |
---|
| 3 | #DEP:zlib |
---|
| 4 | # Modified by DatuX for Syn-3 build system |
---|
| 5 | |
---|
| 6 | # Copyright 2000 BSDi, Inc. Concord, CA, USA |
---|
| 7 | # Copyright 2001, 2002, 2003, 2004 Slackware Linux, Inc. Concord, CA, USA |
---|
| 8 | # All rights reserved. |
---|
| 9 | # |
---|
| 10 | # Redistribution and use of this script, with or without modification, is |
---|
| 11 | # permitted provided that the following conditions are met: |
---|
| 12 | # |
---|
| 13 | # 1. Redistributions of this script must retain the above copyright |
---|
| 14 | # notice, this list of conditions and the following disclaimer. |
---|
| 15 | # |
---|
| 16 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
---|
| 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
| 18 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
---|
| 19 | # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
| 20 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
| 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
---|
| 22 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
---|
| 23 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
---|
| 24 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
---|
| 25 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 26 | |
---|
| 27 | NAME=openssh |
---|
| 28 | VERSION=6.8p1 |
---|
| 29 | ARCH=${ARCH:-i486} |
---|
| 30 | #BUILD=1 gaat bij ons via SVN |
---|
| 31 | |
---|
| 32 | CWD=`pwd` |
---|
| 33 | PKG=/tmp/package-openssh |
---|
| 34 | |
---|
| 35 | if [ "$ARCH" = "i386" ]; then |
---|
| 36 | SLKCFLAGS="-O2 -march=i386 -mcpu=i686" |
---|
| 37 | elif [ "$ARCH" = "i486" ]; then |
---|
| 38 | SLKCFLAGS="-O2 -march=i486 -mcpu=i686" |
---|
| 39 | elif [ "$ARCH" = "s390" ]; then |
---|
| 40 | SLKCFLAGS="-O2" |
---|
| 41 | elif [ "$ARCH" = "x86_64" ]; then |
---|
| 42 | SLKCFLAGS="-O2" |
---|
| 43 | fi |
---|
| 44 | |
---|
| 45 | # Clean target location: |
---|
| 46 | rm -rf $PKG |
---|
| 47 | mkdir -p $PKG || exit 1 |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | # Prepare the framework and extract the package: |
---|
| 51 | cd /tmp |
---|
| 52 | rm -rf openssh-$VERSION |
---|
| 53 | tar xzvf $CWD/openssh-$VERSION.tar.gz |
---|
| 54 | cd openssh-$VERSION |
---|
| 55 | chown -R root.root . |
---|
| 56 | |
---|
| 57 | #Zodat we commands kunnen zien voor icon debugging |
---|
| 58 | #patch session.c < $CWD/DatuX_execdebug.patch || exit 1 |
---|
| 59 | |
---|
| 60 | # Compile package: |
---|
| 61 | CFLAGS="-fgnu89-inline $SLKCFLAGS" \ |
---|
| 62 | ./configure \ |
---|
| 63 | --prefix=/usr \ |
---|
| 64 | --sysconfdir=/etc/ssh \ |
---|
| 65 | --without-pam \ |
---|
| 66 | --with-md5-passwords \ |
---|
| 67 | --without-tcp-wrappers \ |
---|
| 68 | --with-default-path=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin \ |
---|
| 69 | --with-ipv4-default \ |
---|
| 70 | --with-privsep-path=/var/empty \ |
---|
| 71 | --with-privsep-user=sshd \ |
---|
| 72 | $ARCH-slackware-linux || exit 1 |
---|
| 73 | |
---|
| 74 | make || exit 1 |
---|
| 75 | |
---|
| 76 | # Install the package: |
---|
| 77 | make install DESTDIR=$PKG || exit 1 |
---|
| 78 | |
---|
| 79 | ( cd $PKG |
---|
| 80 | find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
---|
| 81 | find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
---|
| 82 | ) |
---|
| 83 | |
---|
| 84 | # Compress the installed manpages: |
---|
| 85 | find $PKG/usr/man -type f -exec gzip -9 {} \; |
---|
| 86 | |
---|
| 87 | # Relink the slogin(1) man page |
---|
| 88 | ( cd $PKG/usr/man/man1 |
---|
| 89 | rm -f slogin.1 |
---|
| 90 | ln -sf ssh.1.gz slogin.1.gz |
---|
| 91 | ) |
---|
| 92 | |
---|
| 93 | # Install directory used with PrivilegeSeparation option: |
---|
| 94 | mkdir -p $PKG/var/empty |
---|
| 95 | chmod 755 $PKG/var/empty |
---|
| 96 | |
---|
| 97 | # Install docs: |
---|
| 98 | mkdir -p $PKG/usr/doc/openssh-$VERSION |
---|
| 99 | cp -a \ |
---|
| 100 | CREDITS ChangeLog INSTALL LICENCE OVERVIEW README README.privsep README.smartcard RFC.nroff TODO WARNING.RNG \ |
---|
| 101 | $PKG/usr/doc/openssh-$VERSION |
---|
| 102 | chmod 644 $PKG/usr/doc/openssh-$VERSION/* |
---|
| 103 | |
---|
| 104 | # Install also 'ssh-copy-id' and its manpage from contrib: |
---|
| 105 | ( cd contrib |
---|
| 106 | cp -a ssh-copy-id $PKG/usr/bin/ssh-copy-id |
---|
| 107 | chown root.bin $PKG/usr/bin/ssh-copy-id |
---|
| 108 | chmod 755 $PKG/usr/bin/ssh-copy-id |
---|
| 109 | cat ssh-copy-id.1 | gzip -9c > $PKG/usr/man/man1/ssh-copy-id.1.gz |
---|
| 110 | ) |
---|
| 111 | |
---|
| 112 | #bop tenslotte de postinstall der nog ff in. |
---|
| 113 | mkdir -p $PKG/etc/postinst.d |
---|
| 114 | cp $CWD/post.openssh $PKG/etc/postinst.d/post.openssh || exit 1 |
---|
| 115 | |
---|
| 116 | |
---|
| 117 | # Fix some ownerships per FSSTND: |
---|
| 118 | chown -R root.bin $PKG/usr/bin $PKG/usr/sbin |
---|
| 119 | |
---|
| 120 | ( cd $PKG |
---|
| 121 | |
---|
| 122 | # Ditch the new host keys, since these have to be uniquely prepared on each machine: |
---|
| 123 | rm -f etc/ssh/ssh_host_dsa_key |
---|
| 124 | rm -f etc/ssh/ssh_host_dsa_key.pub |
---|
| 125 | rm -f etc/ssh/ssh_host_rsa_key |
---|
| 126 | rm -f etc/ssh/ssh_host_rsa_key.pub |
---|
| 127 | rm -f etc/ssh/ssh_host_key |
---|
| 128 | rm -f etc/ssh/ssh_host_key.pub |
---|
| 129 | |
---|
| 130 | # Set up the config script installation: |
---|
| 131 | mv etc/ssh/ssh_config etc/ssh/ssh_config.new |
---|
| 132 | mv etc/ssh/sshd_config etc/ssh/sshd_config.new |
---|
| 133 | |
---|
| 134 | # Add the init script: |
---|
| 135 | #mkdir -p etc/rc.d |
---|
| 136 | #cat $CWD/rc.sshd > etc/rc.d/rc.sshd |
---|
| 137 | #chmod 755 etc/rc.d/rc.sshd |
---|
| 138 | |
---|
| 139 | mkdir -p service/sshd |
---|
| 140 | cp $CWD/run service/sshd |
---|
| 141 | chmod 755 service/sshd/run |
---|
| 142 | chown root:root service/sshd/run |
---|
| 143 | |
---|
| 144 | # Copy runtime installation files: |
---|
| 145 | mkdir -p install |
---|
| 146 | cat $CWD/doinst.sh > install/doinst.sh |
---|
| 147 | #cat $CWD/slack-desc > install/slack-desc |
---|
| 148 | ) |
---|
| 149 | |
---|
| 150 | # Create the package itself: |
---|
| 151 | cd $PKG |
---|
| 152 | #makepkg -l y -c n /tmp/openssh-$VERSION-$ARCH-$BUILD.tgz |
---|
| 153 | makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && |
---|
| 154 | echo $VERSION > $CWD/$NAME.version && |
---|
| 155 | echo $ARCH > $CWD/$NAME.arch |
---|
| 156 | |
---|