diff options
-rwxr-xr-x | lshw/lshw.SlackBuild | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lshw/lshw.SlackBuild b/lshw/lshw.SlackBuild index 44c34a0e..9cee520f 100755 --- a/lshw/lshw.SlackBuild +++ b/lshw/lshw.SlackBuild @@ -20,6 +20,7 @@ VERSION=${VERSION:=B.02.08.01} BUILD=${BUILD:=1rha} SRC_DIR=${SRC:=$CWD} TMP=${TMP:=/tmp} +REPOS=${REPOS:=$TMP} if [ "$ARCH" == "x86_64" ]; then LIBDIR=/usr/lib64 @@ -38,24 +39,27 @@ else tarflag="z" fi +SRC_DIR="$SRC_DIR/$PACKAGE" +mkdir -p $SRC_DIR + if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then wget "$URL" -O "$SRC_DIR/$SRC" fi +TMP="$TMP/$PACKAGE" +rm -rf $TMP +mkdir -p $TMP cd $TMP -rm -rf package-$PACKAGE -mkdir package-$PACKAGE -cd package-$PACKAGE tar xvf$tarflag $SRC_DIR/$SRC cd $PACKAGE-$VERSION make -make DESTDIR=$TMP/package-$PACKAGE/$PACKAGE install +make DESTDIR=$TMP/package-$PACKAGE install CWD="`pwd`" -cd $TMP/package-$PACKAGE/$PACKAGE +cd $TMP/package-$PACKAGE 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 @@ -90,5 +94,9 @@ for file in COPYING README; do cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/ done -makepkg -c y -l y $TMP/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz +makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz + +if [ "$CLEANUP" == "yes" ]; then + rm -rf $TMP +fi |