dssi.SlackBuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/bash
  2. # Slackware build script for <dssi>
  3. # Written by Michales Michaloudes korgie@gmail.com
  4. # Updated by Heinz Wiesinger pprkut@liwjatan.at - Added profile.d scripts
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=dssi
  7. VERSION=${VERSION:-1.1.1}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  19. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  20. exit 0
  21. fi
  22. TMP=${TMP:-/tmp/SBo}
  23. PKG=$TMP/package-$PRGNAM
  24. OUTPUT=${OUTPUT:-/tmp}
  25. if [ "$ARCH" = "i586" ]; then
  26. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  27. LIBDIRSUFFIX=""
  28. elif [ "$ARCH" = "i686" ]; then
  29. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "x86_64" ]; then
  32. SLKCFLAGS="-O2 -fPIC"
  33. LIBDIRSUFFIX="64"
  34. else
  35. SLKCFLAGS="-O2"
  36. LIBDIRSUFFIX=""
  37. fi
  38. set -e
  39. rm -rf $PKG
  40. mkdir -p $TMP $PKG $OUTPUT
  41. cd $TMP
  42. rm -rf $PRGNAM-$VERSION
  43. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  44. cd $PRGNAM-$VERSION
  45. chown -R root:root .
  46. find -L . \
  47. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  48. -exec chmod 755 {} \+ -o \
  49. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  50. -exec chmod 644 {} \+
  51. CFLAGS="$SLKCFLAGS" \
  52. CXXFLAGS="$SLKCFLAGS" \
  53. ./configure \
  54. --prefix=/usr \
  55. --libdir=/usr/lib${LIBDIRSUFFIX} \
  56. --sysconfdir=/etc \
  57. --localstatedir=/var \
  58. --mandir=/usr/man \
  59. --docdir=/usr/doc/$PRGNAM-$VERSION \
  60. --build=$ARCH-slackware-linux
  61. make
  62. make install DESTDIR=$PKG
  63. mkdir -p $PKG/etc/profile.d/
  64. cat << EOF > $PKG/etc/profile.d/dssi.csh
  65. #!/bin/csh
  66. setenv DSSI_PATH /usr/lib${LIBDIRSUFFIX}/dssi
  67. EOF
  68. cat << EOF > $PKG/etc/profile.d/dssi.sh
  69. #!/bin/sh
  70. export DSSI_PATH=/usr/lib${LIBDIRSUFFIX}/dssi
  71. EOF
  72. chmod 0755 $PKG/etc/profile.d/*
  73. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  74. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  75. find $PKG/usr/man -type f -exec gzip -9 {} \;
  76. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  77. cd $TMP/$PRGNAM-$VERSION/doc/
  78. cp -a RFC* why-use* midi-controllers.txt TODO $PKG/usr/doc/$PRGNAM-$VERSION
  79. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  80. mkdir -p $PKG/install
  81. cat $CWD/slack-desc > $PKG/install/slack-desc
  82. cd $PKG
  83. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE