diff options
Diffstat (limited to 'development/simulavr/simulavr.SlackBuild')
-rw-r--r-- | development/simulavr/simulavr.SlackBuild | 61 |
1 files changed, 38 insertions, 23 deletions
diff --git a/development/simulavr/simulavr.SlackBuild b/development/simulavr/simulavr.SlackBuild index 981dc4f1e9..05d23af92b 100644 --- a/development/simulavr/simulavr.SlackBuild +++ b/development/simulavr/simulavr.SlackBuild @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for SimulAVR @@ -22,10 +22,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=simulavr -VERSION=${VERSION:-git20170521} +VERSION=${VERSION:-20201006_32985f7} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -35,7 +38,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} @@ -60,7 +70,7 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +tar xvf $CWD/$PRGNAM-$VERSION.tar.?z cd $PRGNAM-$VERSION chown -R root:root . find -L . \ @@ -69,33 +79,38 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -./bootstrap - -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --mandir=/usr/man \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - --build=$ARCH-slackware-linux \ - --with-tclconfig=/usr/lib${LIBDIRSUFFIX} -make -make install DESTDIR=$PKG +# Respect standard locations and avoid overwriting system headers +sed -i \ + -e "s|DESTINATION\ \"lib|DESTINATION \"lib$LIBDIRSUFFIX|" \ + -e "s|DESTINATION\ \"include|DESTINATION \"include/$PRGNAM|" \ + libsim{,ulavr}/CMakeLists.txt +sed -i \ + -e "s|share/man|man|" \ + -e "s|share/doc/common|doc/$PRGNAM-$VERSION|" \ + {app,doc}/CMakeLists.txt + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_TCL=ON \ + -DBUILD_PYTHON=ON \ + -DCMAKE_BUILD_TYPE=Release .. + make -j1 + make -j1 progdoc + make install DESTDIR=$PKG +cd .. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -# Compress info pages and remove the package's dir file -# If no info pages are installed by the software, don't leave this in the script mv $PKG/usr/share/info $PKG/usr rm -f $PKG/usr/info/dir gzip -9 $PKG/usr/info/*.info* mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING README.* INSTALL $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install @@ -103,4 +118,4 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc 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 |