summaryrefslogtreecommitdiffstats
path: root/slang/build/slang.SlackBuild
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2008-01-26 22:32:00 +0000
committer Eric Hameleers <alien@slackware.com>2008-01-26 22:32:00 +0000
commitacdb783b3208b13047cb12c26e8c44c37e4701eb (patch)
tree7200526c4342fc4af8385d9a3f2f3d9da8c8ec56 /slang/build/slang.SlackBuild
parent255b272a8b2c7f9e3cbd1c31fc325aa08f699fef (diff)
downloadasb-acdb783b3208b13047cb12c26e8c44c37e4701eb.tar.gz
asb-acdb783b3208b13047cb12c26e8c44c37e4701eb.tar.xz
Initial revision
Diffstat (limited to 'slang/build/slang.SlackBuild')
-rwxr-xr-xslang/build/slang.SlackBuild86
1 files changed, 86 insertions, 0 deletions
diff --git a/slang/build/slang.SlackBuild b/slang/build/slang.SlackBuild
new file mode 100755
index 00000000..80700396
--- /dev/null
+++ b/slang/build/slang.SlackBuild
@@ -0,0 +1,86 @@
+#!/bin/sh
+CWD=`pwd`
+if [ "$TMP" = "" ]; then
+ TMP=/tmp
+fi
+
+VERSION=${VERSION:-2.0.7}
+DOCV=${DOCV:-2.0.4}
+ARCH=${ARCH:-i486}
+BUILD=${BUILD:-1}
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2"
+fi
+
+PKG=$TMP/package-slang
+rm -rf $PKG
+mkdir -p $PKG
+
+cd $TMP
+rm -rf slang-$VERSION
+tar xjvf $CWD/slang-$VERSION.tar.bz2 || exit 1
+cd slang-$VERSION
+chown -R root:root .
+CFLAGS="$SLKCFLAGS" \
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --includedir=/usr/include \
+ $ARCH-slackware-linux
+
+make -j4 || exit 1
+make install DESTDIR=$PKG
+make -j4 elf || exit 1
+make install-elf DESTDIR=$PKG
+
+chmod 755 $PKG/usr/lib/libslang.so.$VERSION
+# --disable-static doesn't always work, but this is guaranteed:
+#rm -f $PKG/usr/lib/*.a
+
+( 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
+)
+
+# Compress and if needed symlink the man pages:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+# Prepare the documentation:
+rm -r $PKG/usr/share/doc/slang
+rm -r $PKG/usr/share/doc
+rmdir $PKG/usr/share/doc
+
+mkdir -p $PKG/usr/doc/slang-$VERSION
+cp -a \
+ COPYING INSTALL.pc INSTALL.unx INSTALL.vms NEWS README UPGRADE.txt \
+ $PKG/usr/doc/slang-$VERSION
+# Add some additional documentation:
+tar xjvf $CWD/slangdoc-$DOCV.tar.bz2
+chown -R root:root doc
+cp -a doc/html $PKG/usr/doc/slang-$VERSION
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+makepkg -l y -c n $TMP/slang-${VERSION}_static-$ARCH-$BUILD.tgz
+