summaryrefslogtreecommitdiff
path: root/development/astyle/astyle.SlackBuild
diff options
context:
space:
mode:
authorDaniel Jordan <daniel dot budd dot j at gmail dot com>2013-03-16 15:37:52 -0400
committerdsomero <xgizzmo@slackbuilds.org>2013-03-22 07:16:48 -0400
commitc2a57f882ce5d2e4060356e2f272c710dfed96fe (patch)
treef3239d7f25be8bd5a3673616d3ac833bddc65780 /development/astyle/astyle.SlackBuild
parent1828f35dd38c740ab23af91951099fce8fc3f547 (diff)
downloadslackbuilds-c2a57f882ce5d2e4060356e2f272c710dfed96fe.tar.gz
development/astyle: Added (Artistic Style code beautifier)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'development/astyle/astyle.SlackBuild')
-rw-r--r--development/astyle/astyle.SlackBuild82
1 files changed, 82 insertions, 0 deletions
diff --git a/development/astyle/astyle.SlackBuild b/development/astyle/astyle.SlackBuild
new file mode 100644
index 0000000000..af6fef63a2
--- /dev/null
+++ b/development/astyle/astyle.SlackBuild
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+# Slackware build script for Artistic Style
+
+# Maintained by Daniel Jordan, daniel.budd.j@gmail.com
+# - updated version number
+# - added default variable options
+# - auto detect ARCH
+# - build and install shared libraries
+#
+# Originally by Dugan Chen (dugan_c@fastmail.fm)
+
+
+PRGNAM=${PRGNAM:-astyle}
+VERSION=${VERSION:-2.02.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+SRCPK=astyle_$VERSION\_linux.tar.gz
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM
+tar -xzvf $CWD/$SRCPK
+cd $PRGNAM
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+cd build/gcc
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+make release shared
+
+install -D -m0755 bin/astyle $PKG/usr/bin/astyle
+install -D -m0755 bin/libastyle.so $PKG/usr/lib$LIBDIRSUFFIX/libastyle.so
+
+find $PKG -print0 | xargs -0 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 $TMP/$PRGNAM/doc/* $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