#!/bin/sh # Heavily based on the Slackware 13.1 SlackBuild # Requirements: wxwidgets # http://filezilla-project.org # Packager baldelario ~at~ gmail ~dot~ com # Last build from Vito Magnanimo (vitomag89@gmail.com) # http://www.slacky.eu # Note: FileZilla 3 is the next generation (S)FTP-client # from the FileZilla project and is currently in development. # # Exit on most errors set -e # Set variables: CWD=`pwd` OUTPUT=${OUTPUT:-$CWD} PKGNAME=FileZilla TMP=${TMP:-/tmp/txz/$PKGNAME} PKG=$TMP/package VERSION=${VERSION:-3.3.4.1} ARCH=${ARCH:-x86_64} BUILD=${BUILD:-2} TAG=${TAG:-sl} SOURCE=http://d10xg45o6p6dbl.cloudfront.net/projects/f/filezilla/$PKGNAME'_'$VERSION'_'src.tar.bz2 # Download sorce tarball if still not present if [ ! -e $PKGNAME'_'$VERSION'_'src.tar.bz2 ]; then wget -c $SOURCE fi # Set compiling FLAGS if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST="i486" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST="i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"; CHOST="x86_64" fi rm -rf $PKG mkdir -p $TMP $PKG # Decompress the source tarball cd $TMP tar xjvf $CWD/$PKGNAME'_'$VERSION'_'src.tar.bz2 echo -e "\E[0;32m+----------------------------+\E[0;0m" echo -e "\E[0;32m| Start SlackBuild FileZilla |\E[0;0m" echo -e "\E[0;32m+----------------------------+\E[0;0m" # Adjust permissions and ownerships cd filezilla-$VERSION chmod -R u+w,go+r-w,a-s . chown -R root:root . LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --with-tinyxml=builtin \ --disable-static \ --program-prefix= \ --program-suffix= \ --build=$CHOST-slackware-linux make make install DESTDIR=$PKG # Strip binaries and shared objects, if present ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true ) #Add documentation files: readme, changelog and so on mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION/SlackBuild cp -a AUTHORS ChangeLog COPYING README INSTALL \ $PKG/usr/doc/$PKGNAME-$VERSION chmod 644 $PKG/usr/doc/$PKGNAME-$VERSION/* # Also add the slack-desk file and this slackbuild to the package mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/usr/doc/$PKGNAME-$VERSION/SlackBuild/slack-desc cat $CWD/$PKGNAME.SlackBuild > $PKG/usr/doc/$PKGNAME-$VERSION/SlackBuild/$PKGNAME.SlackBuild echo "if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database &> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh echo "if [ -x /usr/bin/gtk-update-icon-cache ]; then /usr/bin/gtk-update-icon-cache -f -q /usr/share/icons/hicolor &> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh # Compress the man pages if present if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done ) fi # Find and print dependencies into slack-required file cd $PKG chown -R root:root $PKG if [ -x "$(which requiredbuilder 2>/dev/null)" ];then requiredbuilder -y -v -s $CWD $PKG fi # Create txz package /sbin/makepkg -l y -c n $CWD/filezilla-$VERSION-$ARCH-$BUILD$TAG.txz # Cleanup if enabled if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi