Data2FCS.SlackBuild 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # Slackware build script for Data2FCS
  3. # Copyright 2017-2021 Petar Petrov slackalaxy@gmail.com
  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=Data2FCS
  24. PRGADD=FCS2Data
  25. VERSION=${VERSION:-1.0}
  26. BUILD=${BUILD:-1}
  27. TAG=${TAG:-_SBo}
  28. PKGTYPE=${PKGTYPE:-tgz}
  29. ARCH=noarch
  30. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  31. # the name of the created package would be, and then exit. This information
  32. # could be useful to other scripts.
  33. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  34. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  35. exit 0
  36. fi
  37. TMP=${TMP:-/tmp/SBo}
  38. PKG=$TMP/package-$PRGNAM
  39. OUTPUT=${OUTPUT:-/tmp}
  40. set -e
  41. rm -rf $PKG
  42. mkdir -p $TMP $PKG $OUTPUT
  43. cd $TMP
  44. rm -rf $PRGNAM-$VERSION
  45. mkdir $PRGNAM-$VERSION
  46. cd $PRGNAM-$VERSION
  47. # This is Data2FCS
  48. mkdir $PRGNAM
  49. cd $PRGNAM
  50. unzip $CWD/${PRGNAM}\ ${VERSION}.zip || unzip $CWD/${PRGNAM}%20${VERSION}.zip
  51. install -D -m755 $PRGNAM.jar $PKG/usr/bin/$PRGNAM.jar
  52. # Rename these, so we include them as documentation
  53. mv How\ to\ use.txt HOWTO-$PRGNAM.txt
  54. mv Readme.txt Readme-$PRGNAM.txt
  55. cd ..
  56. # This is FCS2Data
  57. mkdir $PRGADD
  58. cd $PRGADD
  59. unzip $CWD/${PRGADD}\ ${VERSION}.zip || unzip $CWD/${PRGADD}%20${VERSION}.zip
  60. install -D -m755 $PRGADD.jar $PKG/usr/bin/$PRGADD.jar
  61. # Rename these, so we include them as documentation, too
  62. mv How\ to\ use.txt HOWTO-$PRGADD.txt
  63. mv Readme.txt Readme-$PRGADD.txt
  64. cd ..
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cp -a \
  67. $PRGNAM/{HOWTO-$PRGNAM.txt,Readme-$PRGNAM.txt} \
  68. $PRGADD/{HOWTO-$PRGADD.txt,Readme-$PRGADD.txt}\
  69. $PKG/usr/doc/$PRGNAM-$VERSION
  70. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  71. mkdir -p $PKG/usr/share/{applications,pixmaps}
  72. cp $CWD/$PRGNAM.desktop $PKG/usr/share/applications
  73. cp $CWD/$PRGADD.desktop $PKG/usr/share/applications
  74. cp $CWD/$PRGNAM.png $PKG/usr/share/pixmaps
  75. cp $CWD/$PRGADD.png $PKG/usr/share/pixmaps
  76. mkdir -p $PKG/install
  77. cat $CWD/slack-desc > $PKG/install/slack-desc
  78. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  79. cd $PKG
  80. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE