diff options
author | Eric Hameleers <alien@slackware.com> | 2014-03-13 11:26:58 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2014-03-13 11:26:58 +0000 |
commit | 0de2026bb8e3f405f5c8c6f38c4c2476579f857a (patch) | |
tree | 88a8a42e60521e6332be707ee14905a37f42168c /ctorrent | |
parent | 65c4106b964ed92f8dc2c29069076d478467724d (diff) | |
download | asb-0de2026bb8e3f405f5c8c6f38c4c2476579f857a.tar.gz asb-0de2026bb8e3f405f5c8c6f38c4c2476579f857a.tar.xz |
Update to the current SB template.
Diffstat (limited to 'ctorrent')
-rwxr-xr-x | ctorrent/build/ctorrent.SlackBuild | 86 |
1 files changed, 58 insertions, 28 deletions
diff --git a/ctorrent/build/ctorrent.SlackBuild b/ctorrent/build/ctorrent.SlackBuild index 60daf49d..bad10637 100755 --- a/ctorrent/build/ctorrent.SlackBuild +++ b/ctorrent/build/ctorrent.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh # $Id$ -# Copyright (c) 2007-2009 Eric Hameleers, Eindhoven, NL +# Copyright 2007, 2009, 2014 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Permission to use, copy, modify, and distribute this software for @@ -36,6 +36,8 @@ # * Update. Configure "--with-ssl=no" so that the package no # longer depends on openssl but instead uses it's own internal # sha-1 routines. +# dnh3.3.2-2: 13/mar/2014 by Eric Hameleers <alien@slackware.com> +# * Rebuilt for Slackware 14. # # Run 'sh ctorrent.SlackBuild' to build a Slackware package. # The package (.tgz) and .txt file as well as build logs are created in /tmp . @@ -43,13 +45,11 @@ # # ----------------------------------------------------------------------------- -# Set initial variables: - PRGNAM=ctorrent VERSION=${VERSION:-3.3.2} PKGVERSION=dnh${VERSION} ARCH=${ARCH:-x86_64} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} NUMJOBS=${NUMJOBS:" -j4 "} TAG=${TAG:-alien} @@ -70,43 +70,74 @@ SRCURL="http://downloads.sourceforge.net/dtorrent/${VERSION}/${PRGNAM}-${PKGVERS ## --- with a little luck, you won't have to edit below this point --- ## ## -# Exit the script on errors: -set -e -trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR -# Catch unitialized variables: -set -u -P1=${1:-1} +# Automatically determine the architecture we're building on: +MARCH=$( uname -m ) +if [ -z "$ARCH" ]; then + case "$MARCH" in + i?86) export ARCH=i486 ;; + armv7hl) export ARCH=$MARCH ;; + armv6hl) export ARCH=$MARCH ;; + armv5hl) export ARCH=$MARCH ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$MARCH ;; + esac +fi case "$ARCH" in i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; - s390) SLKCFLAGS="-O2" + x86_64) SLKCFLAGS="-O2 -fPIC" + SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" + ;; + armv7hl) SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; - powerpc) SLKCFLAGS="-O2" + armv6hl) SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; - x86_64) SLKCFLAGS="-O2 -fPIC" - SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" + armv5hl) SLKCFLAGS="-O2 -mthumb -march=armv5te -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp" + SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; + *) SLKCFLAGS=${SLKCFLAGS:-"O2"} + SLKLDFLAGS=${SLKLDFLAGS:-""}; LIBDIRSUFFIX=${LIBDIRSUFFIX:-""} + ;; +esac + +case "$ARCH" in + arm*) TARGET=$ARCH-slackware-linux-gnueabi ;; + *) TARGET=$ARCH-slackware-linux ;; esac + +# Exit the script on errors: +set -e +trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR +# Catch unitialized variables: +set -u +P1=${1:-1} + +# Save old umask and set to 0022: +_UMASK_=$(umask) +umask 0022 + # Create working directories: mkdir -p $OUTPUT # place for the package to be saved mkdir -p $TMP/tmp-$PRGNAM # location to build the source mkdir -p $PKG # place for the package to be built rm -rf $PKG/* # always erase old package's contents rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build -rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log +rm -rf $OUTPUT/{configure,make,install,error,makepkg,patch}-$PRGNAM.log # remove old log files # Source file availability: if ! [ -f ${SOURCE} ]; then + echo "Source '$(basename ${SOURCE})' not available yet..." + # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT + [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)" + if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi if ! [ "x${SRCURL}" == "x" ]; then - # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT - [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)" - echo "Source '$(basename ${SOURCE})' not available yet..." echo "Will download file to $(dirname $SOURCE)" wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then @@ -136,7 +167,7 @@ echo "Extracting the source archive(s) for $PRGNAM..." tar -xvf ${SOURCE} cd ${PRGNAM}-${PKGVERSION} chown -R root:root . -chmod -R u+w,go+r-w,a-s . +chmod -R u+w,go+r-w,a+rX-st . echo Building ... LDFLAGS="$SLKLDFLAGS" \ @@ -151,7 +182,7 @@ CFLAGS="$SLKCFLAGS" \ --with-ssl=no \ --program-prefix= \ --program-suffix= \ - --build=$ARCH-slackware-linux \ + --build=$TARGET \ 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log make 2>&1 | tee $OUTPUT/make-${PRGNAM}.log @@ -160,11 +191,7 @@ make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log # Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$PKGVERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$PKGVERSION || true -cat $SRCDIR/$(basename $0) | sed \ - -e "/^VERSION=/s/:-.*}/:-$VERSION}/" \ - -e "/^ARCH=/s/:-.*}/:-$ARCH}/" \ - -e "/^BUILD=/s/:-.*}/:-$BUILD}/" \ - > $PKG/usr/doc/$PRGNAM-$PKGVERSION/$PRGNAM.SlackBuild +cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild chown -R root:root $PKG/usr/doc/$PRGNAM-$PKGVERSION find $PKG/usr/doc -type f -exec chmod 644 {} \; @@ -174,9 +201,9 @@ if [ -d $PKG/usr/man ]; then for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done fi -# Strip binaries: -find $PKG | xargs file | grep -e "executable" -e "shared object" \ - | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +# Strip binaries (if any): +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true # Add a package description: mkdir -p $PKG/install @@ -190,3 +217,6 @@ md5sum ${PRGNAM}-${PKGVERSION}-${ARCH}-${BUILD}${TAG}.tgz > ${PRGNAM}-${PKGVERSI cd - cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${PKGVERSION}-${ARCH}-${BUILD}${TAG}.txt +# Restore the original umask: +umask ${_UMASK_} + |