summaryrefslogtreecommitdiffstats
path: root/development/sloccount/sloccount.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/sloccount/sloccount.SlackBuild')
-rw-r--r--development/sloccount/sloccount.SlackBuild47
1 files changed, 23 insertions, 24 deletions
diff --git a/development/sloccount/sloccount.SlackBuild b/development/sloccount/sloccount.SlackBuild
index 0ecf82bf0e..7c6c105ebf 100644
--- a/development/sloccount/sloccount.SlackBuild
+++ b/development/sloccount/sloccount.SlackBuild
@@ -1,14 +1,16 @@
#!/bin/sh
# Slackware build script for SLOCcount
-# Written by Aleksandar B. Samardzic <asamardzic@matf.bg.ac.yu>
+# Written by Aleksandar B. Samardzic <asamardzic@math.rs>
# Modified by the SlackBuilds.org project
+# Updated for Slackware 13.0 by Heinz Wiesinger <pprkut@liwjatan.at>
PRGNAM=sloccount
VERSION=2.26
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
@@ -16,8 +18,13 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
-elif [ "$ARCH" = "i686" ]; then
+ LIBDIRSUFFIX=""
+ elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+ elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
fi
set -e
@@ -31,35 +38,27 @@ cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
-# Patching makefile; patch posted upstream, so following line should be
-# (hopefully) deleted sometimes.
-sed -i \
- -e '40s/$/ $(CFLAGS)/' \
- -e '73s/share/usr/' \
- -e '166a\\t$(INSTALL_A_DIR) $(INSTALL_DIR)' \
- -e '187s/ install_docs//' \
- makefile
+make \
+ CC="gcc -Wall $SLKCFLAGS"
-CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLCKCFLAGS" make
-make install PREFIX=$PKG
+# avoid make install error
+mkdir -p $PKG/usr/bin
-( 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
-)
+make \
+ CC="gcc -Wall $SLKCFLAGS" \
+ PREFIX="$PKG/usr" \
+ MAN_DIR="$PKG/usr/man" \
+ DOC_DIR="$PKG/usr/doc/$PRGNAM-$VERSION" \
+ install
-( 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
-)
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a COPYING ChangeLog README SOURCES TODO sloccount.html table.html \
- $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a COPYING SOURCES $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}