moneydance.SlackBuild 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # Slackware build script for moneydance
  3. # Copyright 2008-2021 Robby Workman, Tuscaloosa, AL, USA
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. cd $(dirname $0) ; CWD=$(pwd)
  23. PRGNAM=moneydance
  24. VERSION=${VERSION:-2021.1.3069}
  25. BUILD=${BUILD:-1}
  26. TAG=${TAG:-_SBo}
  27. PKGTYPE=${PKGTYPE:-tgz}
  28. case "$( uname -m )" in
  29. i?86) ARCH=i586 ;;
  30. arm*) ARCH=arm ;;
  31. *) ARCH=$( uname -m ) ;;
  32. esac
  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" = "x86_64" ]; then
  44. MDARCH=amd64
  45. else
  46. printf "$ARCH is not supported.\n"; exit 1
  47. fi
  48. set -e
  49. rm -rf $TMP/$PRGNAM $PKG
  50. mkdir -p $TMP/$PRGNAM $PKG
  51. cd $TMP/$PRGNAM
  52. ar -x $CWD/${PRGNAM}_linux_amd64.deb
  53. tar xvf data.tar.bz2 -C $PKG
  54. rm -f $PKG/opt/Moneydance/create_desktop_file.sh
  55. mkdir -p $PKG/usr/bin
  56. ln -s /opt/Moneydance/Moneydance $PKG/usr/bin/moneydance
  57. ln -s /opt/Moneydance/Moneydance $PKG/usr/bin/Moneydance
  58. mkdir -p $PKG/usr/share/applications
  59. cat $CWD/moneydance.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  60. rm -f $PKG/opt/Moneydance/resources/moneydance.desktop
  61. mkdir -p $PKG/usr/share/pixmaps
  62. ln -s /opt/Moneydance/resources/moneydance_icon32.png \
  63. $PKG/usr/share/pixmaps/$PRGNAM.png
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. mv $PKG/opt/Moneydance/README.md $PKG/usr/doc/$PRGNAM-$VERSION
  66. ln -s /opt/Moneydance/resources/license.txt \
  67. $PKG/usr/doc/$PRGNAM-$VERSION/license.txt
  68. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  69. mkdir -p $PKG/install
  70. cat $CWD/slack-desc > $PKG/install/slack-desc
  71. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  72. cd $PKG
  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. /sbin/makepkg -c n -l y $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE