gchemutils.SlackBuild 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #!/bin/bash
  2. # Slackware build script for gchemutils
  3. # Copyright 2011-2021 Petar Petrov slackalaxy@gmail.com
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. # 20220308 bkw: Modified by SlackBuilds.org, BUILD=3:
  23. # - disable the mozilla plugin, since it doesn't build.
  24. # - disable the gnumeric plugin, since it doesn't build either.
  25. # - update the README to explain the above.
  26. # - do not install useless INSTALL in doc dir.
  27. cd $(dirname $0) ; CWD=$(pwd)
  28. PRGNAM=gchemutils
  29. VERSION=${VERSION:-0.14.17}
  30. BUILD=${BUILD:-3}
  31. TAG=${TAG:-_SBo}
  32. PKGTYPE=${PKGTYPE:-tgz}
  33. SRCNAM=gnome-chemistry-utils
  34. MOZILLA=${MOZILLA:-NO} # Don't build the Mozilla plugin (it doesn't build)
  35. if [ -z "$ARCH" ]; then
  36. case "$( uname -m )" in
  37. i?86) ARCH=i586 ;;
  38. arm*) ARCH=arm ;;
  39. *) ARCH=$( uname -m ) ;;
  40. esac
  41. fi
  42. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  43. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  44. exit 0
  45. fi
  46. TMP=${TMP:-/tmp/SBo}
  47. PKG=$TMP/package-$PRGNAM
  48. OUTPUT=${OUTPUT:-/tmp}
  49. if [ "$ARCH" = "i586" ]; then
  50. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  51. LIBDIRSUFFIX=""
  52. elif [ "$ARCH" = "i686" ]; then
  53. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. elif [ "$ARCH" = "x86_64" ]; then
  56. SLKCFLAGS="-O2 -fPIC"
  57. LIBDIRSUFFIX="64"
  58. else
  59. SLKCFLAGS="-O2"
  60. LIBDIRSUFFIX=""
  61. fi
  62. set -e
  63. rm -rf $PKG
  64. mkdir -p $TMP $PKG $OUTPUT
  65. cd $TMP
  66. rm -rf $SRCNAM-$VERSION
  67. tar xvf $CWD/$SRCNAM-$VERSION.tar.xz
  68. cd $SRCNAM-$VERSION
  69. chown -R root:root .
  70. find -L . \
  71. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  72. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  73. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  74. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  75. # Disable Mozilla plugin building if anything other than YES
  76. # was given as an argument to MOZILLA= at runtime
  77. #[ ! "$MOZILLA" = "YES" ] && mozplug="disable" || mozplug="enable"
  78. # 20220308 bkw: force-disable, it no longer builds.
  79. mozplug=disable
  80. # 20220308 bkw: dike out the gnumeric support, since it's broken.
  81. sed -i.bak '/\(ver\|libspreadsheet\)/s,1\.12,999.99,g' configure
  82. CFLAGS="$SLKCFLAGS" \
  83. CXXFLAGS="$SLKCFLAGS -std=c++14" \
  84. ./configure \
  85. --prefix=/usr \
  86. --libdir=/usr/lib${LIBDIRSUFFIX} \
  87. --disable-scrollkeeper \
  88. --disable-update-databases \
  89. --$mozplug-mozilla-plugin \
  90. --with-mozilla-libdir=/usr/lib${LIBDIRSUFFIX}/mozilla \
  91. --sysconfdir=/etc \
  92. --localstatedir=/var \
  93. --mandir=/usr/man \
  94. --docdir=/usr/doc/$PRGNAM-$VERSION \
  95. --build=$ARCH-slackware-linux
  96. make
  97. make install-strip DESTDIR=$PKG
  98. gzip -9 $PKG/usr/man/man*/*
  99. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  100. cp -a \
  101. AUTHORS ChangeLog COPYING* NEWS README TODO \
  102. $PKG/usr/doc/$PRGNAM-$VERSION
  103. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  104. rm -f $PKG/usr/lib*/*.la
  105. mkdir -p $PKG/install
  106. cat $CWD/slack-desc > $PKG/install/slack-desc
  107. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  108. cd $PKG
  109. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE