dxcc.SlackBuild 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. # Slackbuild for dxcc
  3. # Written by JK Wood <joshuakwood@gmail.com>
  4. # Slackbuild is released under the Dog-on-Fire License:
  5. # If use of this script causes your dog to catch on fire,
  6. # you agree to send me five dollars. Or a picture
  7. # of the dog on fire.
  8. # Otherwise, you're on your own. I've tested the script
  9. # on my own computer, and it hasn't broken anything.
  10. # So if it does it on your computer, that falls in
  11. # the realm of "Not my problem."
  12. #
  13. # Of course, if you'll send a bug report to the above
  14. # email address, I may be able to see what you did
  15. # wrong and prevent it from happening in the future.
  16. # In which case, I may just send YOU five dollars.
  17. # Oh, and feel free to copy it and modify it as you
  18. # see fit. Or as I see fit. Or as I fit. Although
  19. # that is unlikely, as I am rather tall.
  20. cd $(dirname $0) ; CWD=$(pwd)
  21. PRGNAM=dxcc
  22. VERSION=${VERSION:-20191204}
  23. BUILD=${BUILD:-2}
  24. TAG=${TAG:-_SBo}
  25. PKGTYPE=${PKGTYPE:-tgz}
  26. # This is a Perl script, architecture agnostic
  27. ARCH=noarch
  28. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  29. # the name of the created package would be, and then exit. This information
  30. # could be useful to other scripts.
  31. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  32. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  33. exit 0
  34. fi
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=$TMP/package-$PRGNAM
  37. OUTPUT=${OUTPUT:-/tmp}
  38. set -e
  39. rm -rf $PKG
  40. mkdir -p $TMP $PKG $OUTPUT
  41. cd $TMP
  42. rm -rf $PRGNAM-$VERSION
  43. tar -xvf $CWD/$PRGNAM-$VERSION.tar.gz
  44. cd $PRGNAM-$VERSION
  45. # Apply patch to allow make install to succeed
  46. patch -p0 < $CWD/Makefile.patch
  47. chown -R root:root .
  48. find -L . \
  49. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  50. -o -perm 511 \) -exec chmod 755 {} \; -o \
  51. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  52. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  53. # Fix man path
  54. sed -i s#/share/man#/man#g Makefile
  55. make install DESTDIR=$PKG/usr
  56. find $PKG/usr/man -type f -exec gzip -9 {} \;
  57. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  58. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  59. cp -a COPYING ChangeLog README $PKG/usr/doc/$PRGNAM-$VERSION
  60. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  61. find $PKG/usr/doc -name "Makefile" -exec rm {} \;
  62. find $PKG/usr/doc -type f -exec chmod 644 {} \;
  63. cat $CWD/cty.dat > $PKG/usr/share/$PRGNAM/cty.dat
  64. mkdir -p $PKG/install
  65. cat $CWD/slack-desc > $PKG/install/slack-desc
  66. cd $PKG
  67. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE