summaryrefslogtreecommitdiffstats
path: root/academic/ngspice
diff options
context:
space:
mode:
Diffstat (limited to 'academic/ngspice')
-rw-r--r--academic/ngspice/ngspice.SlackBuild26
1 files changed, 22 insertions, 4 deletions
diff --git a/academic/ngspice/ngspice.SlackBuild b/academic/ngspice/ngspice.SlackBuild
index b30fd4d99e..471f9d9241 100644
--- a/academic/ngspice/ngspice.SlackBuild
+++ b/academic/ngspice/ngspice.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for ngspice and libngspice
# Written by B. Jogai <jogaib {at} comcast [dot] net>
@@ -6,10 +6,13 @@
# Set initial variables:
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=ngspice
VERSION=${VERSION:-34}
-BUILD=${BUILD:-4}
+BUILD=${BUILD:-5}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -19,7 +22,14 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -93,6 +103,8 @@ CFLAGS="$SLKCFLAGS" \
make
make DESTDIR=$PKG install
+# This has installed the configure output file as /usr/include/config.h.
+
cd ..
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
@@ -112,12 +124,18 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/$PRGNAM-$VERSION-manual.pdf \
> $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM-$VERSION-manual.pdf
+# The shared library enabled by "--with-ngshared"
install -Dm755 ./release/src/.libs/libngspice.so.0.0.0 \
"$PKG/usr/lib${LIBDIRSUFFIX}/libngspice.so.0.0.0"
ln -s "libngspice.so.0.0.0" "$PKG/usr/lib${LIBDIRSUFFIX}/libngspice.so.0"
ln -s "libngspice.so.0.0.0" "$PKG/usr/lib${LIBDIRSUFFIX}/libngspice.so"
+# The include file needed to use the shared library enabled by "--with-ngshared"
+install -Dm644 ./src/include/ngspice/sharedspice.h $PKG/usr/include/ngspice/sharedspice.h
+# Move the configure output file.
+mv $PKG/usr/include/config.h $PKG/usr/include/ngspice/
+
install -Dm644 $CWD/$PRGNAM.png $PKG/usr/share/icons/hicolor/48x48/apps/$PRGNAM.png
mkdir -p $PKG/usr/share/applications
@@ -128,4 +146,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE