#!/bin/sh echo "Don't forget to update this script with the change-log! Press ENTER to start..." read NAME="libssh2" VERSION="1.2.7" SOURCE="http://www.libssh2.org/download/libssh2-$VERSION.tar.gz" CONFIGURE="--prefix=/usr/local" DATE=`date '+%Y/%m/%d'` export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" export LDFLAGS="-Wl,-O1" echo "Downloading essential packages..." tce-load -wi compiletc squashfs-tools-4.x openssl-0.9.8 openssl-0.9.8-dev cd /tmp/ wget $SOURCE sudo rm -rf $NAME-$VERSION 2>/dev/null sudo rm /tmp/$NAME.tcz /tmp/$NAME.tcz.list /tmp/$NAME.tcz.md5.txt /tmp/$NAME.tcz.dep 2>/dev/null sudo rm -rf /tmp/$NAME 2>/dev/null sudo rm /tmp/$NAME-dev.tcz /tmp/$NAME-dev.tcz.list /tmp/$NAME-dev.tcz.md5.txt /tmp/$NAME-dev.tcz.dep 2>/dev/null sudo rm -rf /tmp/$NAME-dev 2>/dev/null tar xvfz $NAME-$VERSION.tar.gz cd $NAME-$VERSION echo " Starting ./configure $CONFIGURE" ./configure $CONFIGURE echo "Press ENTER to continue... " read make -j3 echo " Starting make install to: /tmp/$NAME" sudo make DESTDIR=/tmp/$NAME install-strip cd /tmp/$NAME sudo find . | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null sudo find . | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip -g 2> /dev/null cd /tmp/ sudo mv $NAME $NAME-dev mkdir -p /tmp/$NAME/usr/local/lib cd /tmp/$NAME-dev/usr/local/lib sudo mv *.so* /tmp/$NAME/usr/local/lib/ sudo mv *.la* /tmp/$NAME/usr/local/lib/ sudo mv pkgconfig /tmp/$NAME/usr/local/lib/ echo "Creating package..." cd /tmp/ sudo mksquashfs $NAME $NAME.tcz sudo md5sum $NAME.tcz > $NAME.tcz.md5.txt cd $NAME sudo find usr -not -type d > ../$NAME.tcz.list cd /tmp/ SIZE="`du -k $NAME.tcz|cut -f1`k" sudo echo "Title: $NAME.tcz Description: libssh2 Version: $VERSION Author: Simon Josefsson, Daniel Stenberg, Eli Fant, The Written Word, Inc., Mikhail Gusarov, Sara Golemon Original-site: http://www.libssh2.org/ Copying-policy: BSD Size: $SIZE Extension_by: andriscom Comments: libssh2 is a client-side C library implementing the SSH2 protocol Built with CFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with CXXFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with LDFLAGS: -Wl,-O1 Built with the following options: ./configure $CONFIGURE Source: $SOURCE Change-log: $DATE Version: $VERSION Current: $DATE Version: $VERSION " > $NAME.tcz.info sudo echo "openssl-0.9.8.tcz " > $NAME.tcz.dep echo "Creating dev package..." cd /tmp/ sudo mksquashfs $NAME-dev $NAME-dev.tcz sudo md5sum $NAME-dev.tcz > $NAME-dev.tcz.md5.txt cd $NAME-dev sudo find usr -not -type d > ../$NAME-dev.tcz.list cd /tmp/ SIZE="`du -k $NAME-dev.tcz|cut -f1`k" sudo echo "Title: $NAME-dev.tcz Description: libssh2 dev files and man pages Version: $VERSION Author: Simon Josefsson, Daniel Stenberg, Eli Fant, The Written Word, Inc., Mikhail Gusarov, Sara Golemon Original-site: http://www.libssh2.org/ Copying-policy: BSD Size: $SIZE Extension_by: andriscom Comments: libssh2 is a client-side C library implementing the SSH2 protocol Built with CFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with CXXFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with LDFLAGS: -Wl,-O1 Built with the following options: ./configure $CONFIGURE Source: $SOURCE Change-log: $DATE Version: $VERSION Current: $DATE Version: $VERSION " > $NAME-dev.tcz.info sudo echo "$NAME.tcz openssl-0.9.8-dev.tcz " > $NAME-dev.tcz.dep cd /tmp/ mkdir packages 2>/dev/null sudo rm packages/$NAME.tar.gz 2>/dev/null sudo rm packages/$NAME-dev.tar.gz 2>/dev/null tar zcf packages/$NAME.tar.gz $NAME.tcz* tar zcf packages/$NAME-dev.tar.gz $NAME-dev.tcz* echo " Run bcrypt on /tmp/packages/*.tar.gz... give password: tinycore" echo "Run the extension_audit.sh and reboot a clean system to try the packages!" echo "Send it to: tcesubmit@gmail.com"