You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
3.4 KiB

  1. #!/bin/sh
  2. # SlackBuild for Snd, 16 July 2018
  3. # awg <awg@cock.li>
  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. ## Snd itself remains a copyrighted work. Please see the file COPYING
  19. ## in the Snd source distribution.
  20. PRGNAM=snd
  21. VERSION=${VERSION:-18.5}
  22. BUILD=${BUILD:-1}
  23. TAG=${TAG:-_SBo}
  24. if [ -z "$ARCH" ]; then
  25. case "$( uname -m )" in
  26. i?86) ARCH=i586 ;;
  27. arm*) ARCH=arm ;;
  28. *) ARCH=$( uname -m ) ;;
  29. esac
  30. fi
  31. CWD=$(pwd)
  32. TMP=${TMP:-/tmp/SBo}
  33. PKG=$TMP/package-$PRGNAM
  34. OUTPUT=${OUTPUT:-/tmp}
  35. if [ "$ARCH" = "i586" ]; then
  36. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  37. LIBDIRSUFFIX=""
  38. elif [ "$ARCH" = "i686" ]; then
  39. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  40. LIBDIRSUFFIX=""
  41. elif [ "$ARCH" = "x86_64" ]; then
  42. SLKCFLAGS="-O2 -fPIC"
  43. LIBDIRSUFFIX="64"
  44. else
  45. SLKCFLAGS="-O2"
  46. LIBDIRSUFFIX=""
  47. fi
  48. if [ "${GTK:-no}" = "yes" ]; then
  49. GUITK="with-gtk"
  50. else
  51. GUITK="with-motif"
  52. fi
  53. if [ "${OPENGL:-no}" = "yes" ]; then
  54. OPENGL="with-gl"
  55. else
  56. OPENGL="without-gl"
  57. fi
  58. set -e
  59. rm -rf $PKG
  60. mkdir -p $TMP $PKG $OUTPUT
  61. cd $TMP
  62. rm -rf $PRGNAM-$VERSION
  63. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  64. cd $PRGNAM-$VERSION
  65. chown -R root:root .
  66. find -L . \
  67. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  68. -o -perm 511 \) -exec chmod 755 {} \; -o \
  69. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  70. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  71. CFLAGS="$SLKCFLAGS" \
  72. CXXFLAGS="$SLKCFLAGS" \
  73. ./configure \
  74. --prefix=/usr \
  75. --libdir=/usr/lib${LIBDIRSUFFIX} \
  76. --sysconfdir=/etc \
  77. --localstatedir=/var \
  78. --mandir=/usr/man \
  79. --with-s7 \
  80. --$GUITK \
  81. --$OPENGL \
  82. --with-fftw \
  83. --with-doc-dir=/usr/doc/$PRGNAM-$VERSION \
  84. --build=$ARCH-slackware-linux
  85. make
  86. make install DESTDIR=$PKG
  87. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  88. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  89. find $PKG/usr/man -type f -exec gzip -9 {} \;
  90. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  91. # documentation.
  92. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION $PKG/usr/doc/$PRGNAM-$VERSION/pix
  93. cp -a COPYING NEWS README.Snd HISTORY.Snd *.html $PKG/usr/doc/$PRGNAM-$VERSION
  94. cp -a pix/*.png $PKG/usr/doc/$PRGNAM-$VERSION/pix
  95. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  96. # emacs mode.
  97. install -D -m 0644 inf-snd.el $PKG/usr/share/emacs/site-lisp/inf-snd.el
  98. # desktop file and menu icon.
  99. install -D -m 0644 $CWD/snd.desktop $PKG/usr/share/applications/snd.desktop
  100. install -D -m 0644 $CWD/snd_48x48.xpm $PKG/usr/share/pixmaps/snd_48x48.xpm
  101. mkdir -p $PKG/install
  102. cat $CWD/slack-desc > $PKG/install/slack-desc
  103. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  104. cd $PKG
  105. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}