summaryrefslogtreecommitdiffstats
path: root/system/nbench
diff options
context:
space:
mode:
author Niels Horn2011-12-13 04:34:00 +0100
committer Niels Horn2011-12-18 03:07:47 +0100
commit11302d0f2c489542fe9952af5eadab13a2a4e620 (patch)
tree7f0a2d999344b4301875bb496b8118e817b43e69 /system/nbench
parent7ebc1de42aec2506f674636092f248520941b4ca (diff)
downloadslackbuilds-11302d0f2c489542fe9952af5eadab13a2a4e620.tar.gz
system/nbench: Miscellaneous script cleanup
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/nbench')
-rw-r--r--system/nbench/README4
-rw-r--r--system/nbench/cflags.patch11
-rw-r--r--system/nbench/nbench.SlackBuild43
-rw-r--r--system/nbench/nbench.info2
-rw-r--r--system/nbench/nbench_cflags_pointer.patch20
5 files changed, 51 insertions, 29 deletions
diff --git a/system/nbench/README b/system/nbench/README
index 50337a22ca..51fcd365f9 100644
--- a/system/nbench/README
+++ b/system/nbench/README
@@ -1,5 +1,5 @@
-These are Native Mode (a.k.a. Algorithm Level) tests; benchmarks designed to
-expose the capabilities of a system's CPU, FPU, and memory system.
+These are Native Mode (a.k.a. Algorithm Level) tests; benchmarks designed
+to expose the capabilities of a system's CPU, FPU, and memory system.
This can be compiled on various operating systems, including SunOS,
DEC Unix 4.0, DEC OSF1, HP-UX, DEC Ultrix, MS-DOS, and of course Linux.
diff --git a/system/nbench/cflags.patch b/system/nbench/cflags.patch
deleted file mode 100644
index 3c3fc026e0..0000000000
--- a/system/nbench/cflags.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- nbench-byte-2.2.3_orig/Makefile 2004-12-30 00:23:30.000000000 -0200
-+++ nbench-byte-2.2.3/Makefile 2010-02-15 13:05:24.000000000 -0200
-@@ -22,7 +22,7 @@
- CC = gcc
-
- # generic options for gcc
--CFLAGS = -s -static -Wall -O3
-+CFLAGS = -s -static -Wall -O3 @XTRACFLAGS@
-
- # if your gcc lets you do it, then try this one
- #CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops
diff --git a/system/nbench/nbench.SlackBuild b/system/nbench/nbench.SlackBuild
index db7b4bb193..95ddf766ef 100644
--- a/system/nbench/nbench.SlackBuild
+++ b/system/nbench/nbench.SlackBuild
@@ -2,21 +2,38 @@
# Slackware build script for nbench
-# Written by Niels Horn <niels.horn@gmail.com>
-# Revision date: 2010-02-15
+# Copyright 2010-2011 Niels Horn, Rio de Janeiro, RJ, Brazil
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Revision date: 2011/12/09
PRGNAM=nbench
VERSION=${VERSION:-2.2.3}
SRCVERSION="byte-$VERSION"
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
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
@@ -55,13 +72,12 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# "Configure" manually altering the Makefile
-patch -p1 < $CWD/cflags.patch
-sed -i "s/@XTRACFLAGS@/$SLKCFLAGS/" Makefile
+# Patch makefile to accept our CFLAGS + resolve pointer problem
+# Source: http://www.tux.org/~mayer/linux/gcc-4.3.3.txt
+patch -p1 < $CWD/nbench_cflags_pointer.patch
-# Since pointer.h is created by the Makefile, we cannot use anything better
-# than -j1
-make -j1
+CFLAGS=$SLKCFLAGS \
+ make
strip --strip-unneeded nbench
@@ -78,9 +94,8 @@ cat > $PKG/usr/bin/$PRGNAM << EOF
cd /usr/share/$PRGNAM
${PRGNAM}_bin
EOF
-chmod +x $PKG/usr/bin/$PRGNAM
+chmod 0755 $PKG/usr/bin/$PRGNAM
-# Copy program documentation into the package
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
Changes README* RESULTS bdoc.txt \
@@ -92,5 +107,3 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
-
-
diff --git a/system/nbench/nbench.info b/system/nbench/nbench.info
index 6e35c64470..4624803fa7 100644
--- a/system/nbench/nbench.info
+++ b/system/nbench/nbench.info
@@ -7,4 +7,4 @@ DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Niels Horn"
EMAIL="niels.horn@gmail.com"
-APPROVED="dsomero"
+APPROVED="rworkman"
diff --git a/system/nbench/nbench_cflags_pointer.patch b/system/nbench/nbench_cflags_pointer.patch
new file mode 100644
index 0000000000..6bfd86e1c0
--- /dev/null
+++ b/system/nbench/nbench_cflags_pointer.patch
@@ -0,0 +1,20 @@
+--- nbench-byte-2.2.3/Makefile 2004-12-30 00:23:30.000000000 -0200
++++ nbench-byte-2.2.3_patched/Makefile 2011-03-17 10:31:07.000000000 -0300
+@@ -22,7 +22,7 @@
+ CC = gcc
+
+ # generic options for gcc
+-CFLAGS = -s -static -Wall -O3
++CFLAGS += -s -static -Wall -O3
+
+ # if your gcc lets you do it, then try this one
+ #CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops
+@@ -126,7 +126,7 @@
+ if [ "4" = `./pointer` ] ; then touch pointer.h ;\
+ else echo "#define LONG64" >pointer.h ; fi
+
+-misc.o: misc.h misc.c Makefile
++misc.o: misc.h misc.c pointer.h Makefile
+ $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
+ -c misc.c
+