snd.SlackBuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #!/bin/bash
  2. # SlackBuild for Snd, 5 June 2020
  3. # E. axillaris <elanus@i2pmail.org>
  4. # All rights reserved.
  5. #
  6. # Permission to use, copy, modify, or distribute this software for any
  7. # purpose with or without fee is hereby granted, provided that this
  8. # notice of copyright and permission appear in all copies.
  9. #
  10. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. # WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. # WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. # AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. # DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. # PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. # PERFORMANCE OF THIS SOFTWARE.
  18. #
  19. # Please see the Snd license for more information.
  20. cd $(dirname $0) ; CWD=$(pwd)
  21. PRGNAM=snd
  22. VERSION=${VERSION:-20.3}
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_SBo}
  25. PKGTYPE=${PKGTYPE:-tgz}
  26. if [ -z "$ARCH" ]; then
  27. case "$( uname -m )" in
  28. i?86) ARCH=i586 ;;
  29. arm*) ARCH=arm ;;
  30. *) ARCH=$( uname -m ) ;;
  31. esac
  32. fi
  33. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  34. # the name of the created package would be, and then exit. This information
  35. # could be useful to other scripts.
  36. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  37. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  38. exit 0
  39. fi
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM
  42. OUTPUT=${OUTPUT:-/tmp}
  43. if [ "$ARCH" = "i586" ]; then
  44. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  45. LIBDIRSUFFIX=""
  46. elif [ "$ARCH" = "i686" ]; then
  47. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  48. LIBDIRSUFFIX=""
  49. elif [ "$ARCH" = "x86_64" ]; then
  50. SLKCFLAGS="-O2 -fPIC"
  51. LIBDIRSUFFIX="64"
  52. else
  53. SLKCFLAGS="-O2"
  54. LIBDIRSUFFIX=""
  55. fi
  56. if [ "${GTK:-no}" = "yes" ]; then
  57. GUITK="with-gtk"
  58. else
  59. GUITK="with-motif"
  60. fi
  61. if [ "${OPENGL:-no}" = "yes" ]; then
  62. OPENGL="with-gl"
  63. else
  64. OPENGL="without-gl"
  65. fi
  66. set -e
  67. rm -rf $PKG
  68. mkdir -p $TMP $PKG $OUTPUT
  69. cd $TMP
  70. rm -rf $PRGNAM-$VERSION
  71. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  72. cd $PRGNAM-$VERSION
  73. chown -R root:root .
  74. find -L . \
  75. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  76. -o -perm 511 \) -exec chmod 755 {} \; -o \
  77. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  78. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  79. CFLAGS="$SLKCFLAGS" \
  80. CXXFLAGS="$SLKCFLAGS" \
  81. ./configure \
  82. --prefix=/usr \
  83. --libdir=/usr/lib${LIBDIRSUFFIX} \
  84. --sysconfdir=/etc \
  85. --localstatedir=/var \
  86. --mandir=/usr/man \
  87. --with-s7 \
  88. --$GUITK \
  89. --$OPENGL \
  90. --with-fftw \
  91. --with-doc-dir=/usr/doc/$PRGNAM-$VERSION \
  92. --build=$ARCH-slackware-linux
  93. make
  94. make install DESTDIR=$PKG
  95. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  96. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  97. find $PKG/usr/man -type f -exec gzip -9 {} \;
  98. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  99. # documentation.
  100. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION $PKG/usr/doc/$PRGNAM-$VERSION/pix
  101. cp -a COPYING NEWS README.Snd HISTORY.Snd *.html $PKG/usr/doc/$PRGNAM-$VERSION
  102. cp -a pix/*.png $PKG/usr/doc/$PRGNAM-$VERSION/pix
  103. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  104. # emacs mode.
  105. install -D -m 0644 inf-snd.el $PKG/usr/share/emacs/site-lisp/inf-snd.el
  106. # desktop file and menu icon.
  107. install -D -m 0644 $CWD/snd.desktop $PKG/usr/share/applications/snd.desktop
  108. install -D -m 0644 $CWD/snd_48x48.xpm $PKG/usr/share/pixmaps/snd_48x48.xpm
  109. mkdir -p $PKG/install
  110. cat $CWD/slack-desc > $PKG/install/slack-desc
  111. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  112. cd $PKG
  113. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE