musique.SlackBuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/bash
  2. # Slackware build script for musique
  3. # Formerly maintained by Ryan P.C. McQuen <email removed>
  4. # Now maintained by B. Watson <yalhcru@gmail.com>
  5. # Copyright 2010, 2012 Binh Nguyen <email removed>
  6. # All rights reserved.
  7. #
  8. # Redistribution and use of this script, with or without modification, is
  9. # permitted provided that the following conditions are met:
  10. #
  11. # 1. Redistributions of this script must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  15. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  17. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  22. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  23. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. # 20210910 bkw: update for v1.10.1 (-current and qt5).
  25. # 20170326 bkw:
  26. # - take over maintenance.
  27. # - i486=>i586.
  28. # - don't install INSTALL to docdir.
  29. # - actually use SLKCFLAGS.
  30. # - add some notes to README.
  31. # - BUILD=2.
  32. cd $(dirname $0) ; CWD=$(pwd)
  33. PRGNAM=musique
  34. VERSION=${VERSION:-1.10.1}
  35. BUILD=${BUILD:-1}
  36. TAG=${TAG:-_SBo}
  37. PKGTYPE=${PKGTYPE:-tgz}
  38. if [ -z "$ARCH" ]; then
  39. case "$( uname -m )" in
  40. i?86) ARCH=i586 ;;
  41. arm*) ARCH=arm ;;
  42. *) ARCH=$( uname -m ) ;;
  43. esac
  44. fi
  45. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  46. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  47. exit 0
  48. fi
  49. TMP=${TMP:-/tmp/SBo}
  50. PKG=$TMP/package-$PRGNAM
  51. OUTPUT=${OUTPUT:-/tmp}
  52. if [ "$ARCH" = "i586" ]; then
  53. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. elif [ "$ARCH" = "i686" ]; then
  56. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  57. LIBDIRSUFFIX=""
  58. elif [ "$ARCH" = "x86_64" ]; then
  59. SLKCFLAGS="-O2 -fPIC"
  60. LIBDIRSUFFIX="64"
  61. else
  62. SLKCFLAGS="-O2"
  63. LIBDIRSUFFIX=""
  64. fi
  65. set -eu
  66. rm -rf $PKG
  67. mkdir -p $TMP $PKG $OUTPUT
  68. cd $TMP
  69. rm -rf $PRGNAM-$VERSION
  70. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  71. cd $PRGNAM-$VERSION
  72. chown -R root:root .
  73. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  74. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  75. # I don't see how to force our flags via qmake, hence the sed stuff.
  76. qmake-qt5 PREFIX=/usr
  77. sed -i "/C.*FLAGS/s,-O3,$SLKCFLAGS," Makefile
  78. make
  79. make INSTALL_ROOT=$PKG install
  80. strip $PKG/usr/bin/$PRGNAM
  81. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  82. cp -a CHANGES COPYING TODO $PKG/usr/doc/$PRGNAM-$VERSION
  83. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  84. mkdir -p $PKG/install
  85. cat $CWD/slack-desc > $PKG/install/slack-desc
  86. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  87. cd $PKG
  88. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE