udig.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/sh
  2. #
  3. # SlackBuild for uDig
  4. #
  5. # Copyright 2012 Benjamin Trigona-Harany
  6. #
  7. # Redistribution and use of this script, with or without modification, is
  8. # permitted provided that the following conditions are met:
  9. #
  10. # 1. Redistributions of this script must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  14. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  16. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  19. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  20. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  21. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  22. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. PRGNAM=udig
  24. VERSION=${VERSION:-1.4.0}
  25. BUILD=${BUILD:-2}
  26. TAG=${TAG:-_SBo}
  27. if [ -z "$ARCH" ]; then
  28. case "$( uname -m )" in
  29. i?86) ARCH=i486 ;;
  30. arm*) ARCH=arm ;;
  31. *) ARCH=$( uname -m ) ;;
  32. esac
  33. fi
  34. CWD=$(pwd)
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=$TMP/package-$PRGNAM
  37. OUTPUT=${OUTPUT:-/tmp}
  38. if [ "$ARCH" = "x86_64" ]; then
  39. LIBDIRSUFFIX="64"
  40. ZIPSUFFIX="x86_64"
  41. GDALDIR="amd64"
  42. else
  43. LIBDIRSUFFIX=""
  44. ZIPSUFFIX="x86"
  45. GDALDIR="i386"
  46. fi
  47. set -e
  48. rm -rf $PKG
  49. mkdir -p $TMP $PKG $OUTPUT
  50. rm -rf $TMP/$PRGNAM
  51. cd $TMP
  52. unzip $CWD/$PRGNAM-$VERSION.linux.gtk.$ZIPSUFFIX.zip
  53. cd $PRGNAM
  54. chown -R root:root .
  55. find -L . \
  56. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  57. -exec chmod 755 {} \; -o \
  58. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  59. -exec chmod 644 {} \;
  60. # the GDAL libs need to be extracted from the JRE directory and placed in the LD_LIBRARY_PATH
  61. # at uDig runtime
  62. mkdir -p $PKG/usr/share/$PRGNAM
  63. cp -a jre/lib/${GDALDIR}/libgdaljni.so{,.1} $PKG/usr/share/$PRGNAM
  64. sed -i '2i\
  65. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/bin/share/udig
  66. ' udig.sh
  67. mkdir -p $PKG/usr/share/$PRGNAM
  68. cp -a configuration dropins features libcairo-swt.so p2 plugins *.sh udig_internal* $PKG/usr/share/$PRGNAM
  69. # gdal_data doesn't come with x86
  70. if [ "$ARCH" = "x86_64" ]; then
  71. cp -a gdal_data $PKG/usr/share/$PRGNAM
  72. fi
  73. mkdir -p $PKG/usr/bin
  74. ln -s /usr/share/$PRGNAM/$PRGNAM.sh $PKG/usr/bin/$PRGNAM
  75. mkdir -p $PKG/usr/share/applications
  76. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  77. mkdir -p $PKG/usr/share/pixmaps/
  78. cp -a icon.xpm $PKG/usr/share/pixmaps/udig.xpm
  79. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  80. cp -a LICENSE.txt epl-v10.html notice.html readme/* udig-$VERSION.html $PKG/usr/doc/$PRGNAM-$VERSION
  81. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  82. mkdir -p $PKG/install
  83. cat $CWD/slack-desc > $PKG/install/slack-desc
  84. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  85. cd $PKG
  86. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}