#!/bin/bash # # ngspice.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # ngspice.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="ngspice" PACKAGE_EXT="gz" VERSION=${VERSION:=37} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION-manual.pdf" URL="https://sourceforge.net/projects/ngspice/files/ng-spice-rework/$VERSION/$SRC" get_source $SRC $URL SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="https://sourceforge.net/projects/ngspice/files/ng-spice-rework/$VERSION/$SRC" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION # Fix the lib path to the code modules if [ "$ARCH" = "x86_64" ]; then sed -i "s%/lib/%/lib${LIBDIRSUFFIX}/%g" src/spinit.in fi mkdir release cd release ../configure \ --prefix=/usr \ --mandir=/usr/man \ --infodir=/usr/info \ --with-readline=no \ --enable-xspice \ --enable-cider \ --enable-openmp \ --with-x \ --disable-debug \ --with-ngshared make $NUMJOBS || exit 1 CFLAGS="$SLKCFLAGS" \ ../configure --prefix=/usr \ --bindir=/usr/bin \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --infodir=/usr/info \ --with-readline=no \ --disable-debug \ --enable-xspice \ --enable-cider \ --enable-shared \ --disable-static \ --enable-ndev \ --enable-openmp \ --with-x \ --build=$ARCH-slackware-linux make $NUMJOBS || exit 1 make DESTDIR=$PKG install # This has installed the configure output file as /usr/include/config.h. cd .. mkdir -p $DOCS cp -a ANALYSES AUTHORS BUGS COPYING ChangeLog DEVICES FAQ INSTALL NEWS README* examples/ $DOCS chmod 644 $DOCS/NEWS cat $CWD/$PACKAGE-$VERSION-manual.pdf > $DOCS/$PACKAGE-$VERSION-manual.pdf # The shared library enabled by "--with-ngshared" install -Dm755 ./release/src/.libs/libngspice.so.0.0.4 \ "$PKG/usr/lib${LIBDIRSUFFIX}/libngspice.so.0.0.4" ln -s "libngspice.so.0.0.4" "$PKG/usr/lib${LIBDIRSUFFIX}/libngspice.so.0" ln -s "libngspice.so.0.0.4" "$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. install -Dm644 ./release/src/include/ngspice/config.h $PKG/usr/include/ngspice/ install -Dm644 ./release/ngspice.pc "$PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/ngspice.pc" install -Dm644 $CWD/$PACKAGE.png $PKG/usr/share/icons/hicolor/48x48/apps/$PACKAGE.png mkdir -p $PKG/usr/share/applications cat $CWD/$PACKAGE.desktop > $PKG/usr/share/applications/$PACKAGE.desktop fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi