aboutsummaryrefslogtreecommitdiff
path: root/network/node/node.SlackBuild
diff options
context:
space:
mode:
authorAudrius Kažukauskas <audrius@neutrino.lt>2010-07-01 01:38:54 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-07-01 01:38:54 -0500
commit10a709c2b0a748b613c3d07223ce77002f1f77e4 (patch)
tree907fc8342615c54f4633e4ced32ae7f23adebd37 /network/node/node.SlackBuild
parentee82300714263ac96071cf800576c1e37ad6ef93 (diff)
network/node: Added (JavaScript toolkit)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/node/node.SlackBuild')
-rw-r--r--network/node/node.SlackBuild77
1 files changed, 77 insertions, 0 deletions
diff --git a/network/node/node.SlackBuild b/network/node/node.SlackBuild
new file mode 100644
index 0000000000000..81dcdc6d19750
--- /dev/null
+++ b/network/node/node.SlackBuild
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# Slackware build script for node
+# Written by Audrius Kažukauskas <audrius@neutrino.lt>
+
+PRGNAM=node
+VERSION=${VERSION:-0.1.99}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) 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-$VERSION
+tar xvf $CWD/$PRGNAM-v$VERSION.tar.gz
+cd $PRGNAM-v$VERSION
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+sed -i "s|lib/node|lib$LIBDIRSUFFIX/node|" wscript
+sed -i "s|share/man|man|" wscript
+sed -i "s|\"lib\"|\"lib$LIBDIRSUFFIX\"|" bin/node-waf
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr
+
+make
+make install DESTDIR=$PKG
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a ChangeLog README LICENSE $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.${PKGTYPE:-tgz}