tuxguitar.SlackBuild 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #!/bin/bash
  2. #
  3. # Slackware build script for TuxGuitar
  4. #
  5. # Copyright 2009-2013 Erik W. Hanson, Minneapolis, MN, USA
  6. # Copyright 2017 Ekin Akoglu, Erdemli, Mersin, Turkey
  7. # All rights reserved.
  8. #
  9. # Redistribution and use of this script, with or without modification, is
  10. # permitted provided that the following conditions are met:
  11. #
  12. # 1. Redistributions of this script must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  16. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  18. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  21. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  22. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  23. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  24. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. cd $(dirname $0) ; CWD=$(pwd)
  26. PRGNAM=tuxguitar
  27. VERSION=${VERSION:-1.5.1}
  28. BUILD=${BUILD:-1}
  29. TAG=${TAG:-_SBo}
  30. PKGTYPE=${PKGTYPE:-tgz}
  31. if [ -z "$ARCH" ]; then
  32. case "$( uname -m )" in
  33. i?86) ARCH=i586 ;;
  34. *) ARCH=$( uname -m ) ;;
  35. esac
  36. fi
  37. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  38. # the name of the created package would be, and then exit. This information
  39. # could be useful to other scripts.
  40. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  41. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  42. exit 0
  43. fi
  44. TMP=${TMP:-/tmp/SBo}
  45. PKG=$TMP/package-$PRGNAM
  46. OUTPUT=${OUTPUT:-/tmp}
  47. set -eu
  48. case "$ARCH" in
  49. i?86) BINARCH=x86 ; LIBDIRSUFFIX= ;;
  50. x86_64) BINARCH=x86_64 ; LIBDIRSUFFIX=64 ;;
  51. esac
  52. rm -rf $PKG
  53. mkdir -p $TMP $PKG $OUTPUT
  54. cd $TMP
  55. rm -rf $PRGNAM-$VERSION-linux-$BINARCH
  56. tar xvf $CWD/$PRGNAM-$VERSION-linux-$BINARCH.tar.gz
  57. cd $PRGNAM-$VERSION-linux-$BINARCH
  58. chown -R root:root .
  59. find -L . \
  60. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  61. -o -perm 511 \) -exec chmod 755 {} \; -o \
  62. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  63. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  64. # Manual install
  65. mkdir -p $PKG/usr/bin
  66. if [ "$ARCH" == "x86_64" ] ; then
  67. sed -i 's|/lib|/lib64|g' tuxguitar.sh
  68. sed -i 's|lib/|lib64/|g' tuxguitar.sh
  69. sed -i 's|\./lib64|/usr/lib64|g' tuxguitar.sh
  70. else
  71. sed -i 's|\./lib/|/usr/lib/|g' tuxguitar.sh
  72. fi
  73. sed -i 's|./share/|/usr/share/tuxguitar/|g' tuxguitar.sh
  74. sed -i 's|./dist/|/usr/share/tuxguitar/dist/|g' tuxguitar.sh
  75. sed -i 's|\"share/\"|\"/usr/share/tuxguitar/\"|g' tuxguitar.sh
  76. install -m 0755 tuxguitar.sh $PKG/usr/bin/tuxguitar
  77. mkdir -p $PKG/usr/share/{applications,pixmaps}
  78. mkdir -p $PKG/usr/share/tuxguitar/{dist,help,lang,plugins,scales,soundfont,templates}
  79. mkdir $PKG/usr/lib${LIBDIRSUFFIX}
  80. cp -r share/* $PKG/usr/share/tuxguitar/
  81. cp -r dist/* $PKG/usr/share/tuxguitar/dist/
  82. install -m 0644 lib/gervill.jar $PKG/usr/lib${LIBDIRSUFFIX}/gervill.jar
  83. install -m 0644 lib/itext-pdf.jar $PKG/usr/lib${LIBDIRSUFFIX}/itext-pdf.jar
  84. install -m 0644 lib/itext-xmlworker.jar $PKG/usr/lib${LIBDIRSUFFIX}/itext-xmlworker.jar
  85. install -m 0644 lib/swt.jar $PKG/usr/lib${LIBDIRSUFFIX}/swt.jar
  86. install -m 0644 lib/tuxguitar-awt-graphics.jar $PKG/usr/lib${LIBDIRSUFFIX}/tuxguitar-awt-graphics.jar
  87. install -m 0644 lib/tuxguitar-editor-utils.jar $PKG/usr/lib${LIBDIRSUFFIX}/tuxguitar-editor-utils.jar
  88. install -m 0644 lib/tuxguitar-gm-utils.jar $PKG/usr/lib${LIBDIRSUFFIX}/tuxguitar-gm-utils.jar
  89. install -m 0644 lib/tuxguitar-lib.jar $PKG/usr/lib${LIBDIRSUFFIX}/tuxguitar-lib.jar
  90. install -m 0644 lib/tuxguitar-ui-toolkit-swt.jar $PKG/usr/lib${LIBDIRSUFFIX}/tuxguitar-ui-toolkit-swt.jar
  91. install -m 0644 lib/tuxguitar-ui-toolkit.jar $PKG/usr/lib${LIBDIRSUFFIX}/tuxguitar-ui-toolkit.jar
  92. install -m 0644 lib/tuxguitar.jar $PKG/usr/lib${LIBDIRSUFFIX}/tuxguitar.jar
  93. install -m 0644 share/plugins/tuxguitar-alsa.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-alsa.jar
  94. install -m 0644 share/plugins/tuxguitar-ascii.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-ascii.jar
  95. install -m 0644 share/plugins/tuxguitar-browser-ftp.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-browser-ftp.jar
  96. install -m 0644 share/plugins/tuxguitar-community.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-community.jar
  97. install -m 0644 share/plugins/tuxguitar-compat.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-compat.jar
  98. install -m 0644 share/plugins/tuxguitar-converter.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-converter.jar
  99. install -m 0644 share/plugins/tuxguitar-fluidsynth.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-fluidsynth.jar
  100. install -m 0644 share/plugins/tuxguitar-gervill.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-gervill.jar
  101. install -m 0644 share/plugins/tuxguitar-gpx.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-gpx.jar
  102. install -m 0644 share/plugins/tuxguitar-gtp-ui.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-gtp-ui.jar
  103. install -m 0644 share/plugins/tuxguitar-gtp.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-gtp.jar
  104. install -m 0644 share/plugins/tuxguitar-image.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-image.jar
  105. install -m 0644 share/plugins/tuxguitar-jack-ui.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-jack-ui.jar
  106. install -m 0644 share/plugins/tuxguitar-jack.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-jack.jar
  107. install -m 0644 share/plugins/tuxguitar-jsa.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-jsa.jar
  108. install -m 0644 share/plugins/tuxguitar-lilypond.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-lilypond.jar
  109. install -m 0644 share/plugins/tuxguitar-midi.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-midi.jar
  110. install -m 0644 share/plugins/tuxguitar-musicxml.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-musicxml.jar
  111. install -m 0644 share/plugins/tuxguitar-oss.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-oss.jar
  112. install -m 0644 share/plugins/tuxguitar-pdf.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-pdf.jar
  113. install -m 0644 share/plugins/tuxguitar-ptb.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-ptb.jar
  114. install -m 0644 share/plugins/tuxguitar-svg.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-svg.jar
  115. install -m 0644 share/plugins/tuxguitar-tef.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-tef.jar
  116. install -m 0644 share/plugins/tuxguitar-tuner.jar $PKG/usr/share/tuxguitar/plugins/tuxguitar-tuner.jar
  117. install -m 0644 $CWD/tuxguitar.desktop $PKG/usr/share/applications/tuxguitar.desktop
  118. install -m 0644 $CWD/tuxguitar.xpm $PKG/usr/share/pixmaps/tuxguitar.xpm
  119. mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
  120. install -m 0755 lib/libtuxguitar-alsa-jni.so $PKG/usr/lib${LIBDIRSUFFIX}/libtuxguitar-alsa-jni.so
  121. install -m 0755 lib/libtuxguitar-fluidsynth-jni.so $PKG/usr/lib${LIBDIRSUFFIX}/libtuxguitar-fluidsynth-jni.so
  122. install -m 0755 lib/libtuxguitar-jack-jni.so $PKG/usr/lib${LIBDIRSUFFIX}/libtuxguitar-jack-jni.so
  123. install -m 0755 lib/libtuxguitar-oss-jni.so $PKG/usr/lib${LIBDIRSUFFIX}/libtuxguitar-oss-jni.so
  124. mkdir -p $PKG/usr/man/man1
  125. install -m 0644 $CWD/tuxguitar.1.gz $PKG/usr/man/man1/tuxguitar.1.gz
  126. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  127. cp -r doc/* $PKG/usr/doc/$PRGNAM-$VERSION
  128. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  129. mkdir -p $PKG/install
  130. cat $CWD/slack-desc > $PKG/install/slack-desc
  131. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  132. cd $PKG
  133. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE