diff options
author | Eric Hameleers <alien@slackware.com> | 2008-05-21 08:33:08 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2008-05-21 08:33:08 +0000 |
commit | 089111a7511a1244da20c15461c5f513671a3b8c (patch) | |
tree | a6cde21cd6b0776aac319f1929a8db9bad0a8794 /madwifi/build | |
parent | c4747d406a7b62573224d4a6c00609349cf86cf6 (diff) | |
download | asb-089111a7511a1244da20c15461c5f513671a3b8c.tar.gz asb-089111a7511a1244da20c15461c5f513671a3b8c.tar.xz |
Fix support for downloading/building of SVN snapshots.
Diffstat (limited to 'madwifi/build')
-rwxr-xr-x | madwifi/build/madwifi.SlackBuild | 82 |
1 files changed, 34 insertions, 48 deletions
diff --git a/madwifi/build/madwifi.SlackBuild b/madwifi/build/madwifi.SlackBuild index c1f112a3..04a9e46b 100755 --- a/madwifi/build/madwifi.SlackBuild +++ b/madwifi/build/madwifi.SlackBuild @@ -68,9 +68,13 @@ # Everyone is urged to upgrade to this version. # 0.9.4.1: 23/feb/2008 by Eric Hameleers <alien@slackware.com> # * Upgrade. +# 20080521: 21/may/2008 by Eric Hameleers <alien@slackware.com> +# * Fixed the SlackBuild so that it builds SVN snapshots again, +# just set SNAPSHOT to "yes" # ----------------------------------------------------------------------------- # Change SNAPSHOT from "" to "yes" below if you're building a snapshot release. +# Always keep it empty (SNAPSHOT="") if you compile stable releases! SNAPSHOT=${SNAPSHOT:-""} PRGNAM=madwifi @@ -86,9 +90,7 @@ KSRC=${KSRC:-/lib/modules/${KVER}/build} PATCHLEVEL=`echo $KVER|cut -f 2 -d '.'` # Where do we look for sources? -CWD=`pwd` -SRCDIR=`dirname $0` -[ "${SRCDIR:0:1}" == "." ] && SRCDIR=${CWD}/${SRCDIR} +SRCDIR=$(cd $(dirname $0); pwd) # Place to build (TMP) package (PKG) and output (OUTPUT) the program: TMP=${TMP:-/tmp/build} @@ -98,9 +100,9 @@ OUTPUT=${OUTPUT:-/tmp} if [ -z $SNAPSHOT ]; then # build a stable release SOURCE="$SRCDIR/${PRGNAM}-${SRCVER}.tar.gz" SRCURL="http://downloads.sourceforge.net/${PRGNAM}/${PRGNAM}-${SRCVER}.tar.gz" -else - SOURCE="$SRCDIR/${PRGNAM}-ng-current.tar.gz" - SRCURL="http://snapshots.madwifi.org/${PRGNAM}-ng-current.tar.gz" +else # build a SVN snapshot + SOURCE="$SRCDIR/${PRGNAM}-trunk-current.tar.gz" + SRCURL="http://snapshots.madwifi.org/${PRGNAM}-trunk-current.tar.gz" fi ## @@ -122,9 +124,6 @@ else fi case "$ARCH" in - i386) SLKCFLAGS="-O2 -march=i386 -m${MOPT}=i686" - SLKLDFLAGS=""; LIBDIRSUFFIX="" - ;; i486) SLKCFLAGS="-O2 -march=i486 -m${MOPT}=i686" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; @@ -143,31 +142,29 @@ case "$ARCH" in esac # Prepare the build environment: -mkdir -p $TMP/tmp-$PRGNAM # location to build the source -rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build -mkdir -p $PKG # place for the package to be built -rm -rf $PKG/* # We always erase old package's contents: -mkdir -p $OUTPUT # place for the package to be saved +mkdir -p $TMP/tmp-$PRGNAM # location to build the source +rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build +mkdir -p $PKG # place for the package to be built +rm -rf $PKG/* # erase old package's contents +mkdir -p $OUTPUT # place for the package to be saved rm -f $OUTPUT/*${PRGNAM}*.log # clean out old logfiles # Source file availability: -if [ -z $SNAPSHOT ]; then # download stable release - if ! [ -f ${SOURCE} ]; then - 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 - echo "Downloading '`basename ${SOURCE}`' failed... aborting the build." - mv -f "${SOURCE}" "${SOURCE}".FAIL - exit 1 - fi - else - echo "File '`basename ${SOURCE}`' not available... aborting the build." +if ! [ -f ${SOURCE} ]; then + 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 + echo "Downloading '`basename ${SOURCE}`' failed... aborting the build." + mv -f "${SOURCE}" "${SOURCE}".FAIL exit 1 fi + else + echo "File '`basename ${SOURCE}`' not available... aborting the build." + exit 1 fi fi if [ "$P1" == "--download" ]; then @@ -178,8 +175,10 @@ fi # --- PACKAGE BUILDING --- # For snapshots we can only determine the VERSION using the tarball: if [ ! -z $SNAPSHOT ]; then + echo -n "Changing VERSION from '$VERSION' to " SRCVER=`tar tf $SOURCE |head -1|cut -d- -f3-|cut -d/ -f1` VERSION=`echo $SRCVER|tr '-' '_'` + echo "'$VERSION'" fi echo "+=================+" @@ -187,18 +186,6 @@ echo "| $PRGNAM-$VERSION |" echo "+=================+" cd $TMP/tmp-$PRGNAM - -# Actually to build a snapshot (not the stable release) you must get -# the sources from SVN: -# $ svn checkout http://svn.madwifi.org/trunk madwifi-ng -# The above command stores the source in a subdirectory called madwifi-ng. -# To update to the current version of the source at a later time you just need -# to change to that subdirectory and type: -# $ svn update -# Then pack the source tree into madwifi-ng-yyyymmdd.tar.gz -# -# ... or get a snapshot at http://snapshots.madwifi.org/ - echo "Extracting the source tarball..." tar -xzvf "$SOURCE" @@ -214,7 +201,7 @@ cd - if [ -z $SNAPSHOT ]; then cd ${PRGNAM}-${SRCVER} else - cd ${PRGNAM}-ng-${SRCVER} + cd ${PRGNAM}-trunk-${SRCVER} fi chown -R root:root * chmod -R u+w,go+r-w,a-s * @@ -230,6 +217,7 @@ echo Building ... LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ make clean all KERNELPATH=${KSRC} KERNELRELEASE=${KVER} \ 2>&1 | tee $OUTPUT/make-${PRGNAM}.log @@ -261,7 +249,8 @@ cp -a hal/README $PKG/usr/doc/$PRGNAM-$VERSION/README.hal || true cp -a patches/README $PKG/usr/doc/$PRGNAM-$VERSION/README.patches || true cp -a docs/WEP-HOWTO.txt docs/users-guide.pdf $PKG/usr/doc/$PRGNAM-$VERSION/ || true cp -a scripts $PKG/usr/doc/$PRGNAM-$VERSION/ || true -chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* +cp -a $SRCDIR/$(basename $0) $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +find $PKG/usr/doc -type f -exec chmod 644 {} \; # Compress the man pages [ -d $PKG/usr/man ] && find $PKG/usr/man -name "*.?" -type f -exec gzip -9f {} \; @@ -292,13 +281,10 @@ cat <<-EEOOTT > $PKG/install/doinst.sh # Strip binaries ( 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 + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true ) -# Permissions -chmod -R o-w $PKG - # Create the package cd $PKG makepkg -l y -c n $OUTPUT/$PRGNAM-${VERSION}_$(echo $KVER | tr - _)-$ARCH-$BUILD$TAG.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log |