aprx.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #!/bin/sh
  2. # Slackbuild for aprx
  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. PRGNAM=aprx
  21. VERSION=${VERSION:-2.08.svn593}
  22. BUILD=${BUILD:-1}
  23. TAG=${TAG:-_SBo}
  24. if [ -z "$ARCH" ]; then
  25. case "$( uname -m )" in
  26. i?86) ARCH=i486 ;;
  27. arm*) ARCH=arm ;;
  28. *) ARCH=$( uname -m ) ;;
  29. esac
  30. fi
  31. CWD=$(pwd)
  32. TMP=${TMP:-/tmp/SBo}
  33. PKG=$TMP/package-$PRGNAM
  34. OUTPUT=${OUTPUT:-/tmp}
  35. if [ "$ARCH" = "i486" ]; then
  36. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  37. LIBDIRSUFFIX=""
  38. elif [ "$ARCH" = "i686" ]; then
  39. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  40. LIBDIRSUFFIX=""
  41. elif [ "$ARCH" = "x86_64" ]; then
  42. SLKCFLAGS="-O2 -fPIC"
  43. LIBDIRSUFFIX="64"
  44. else
  45. SLKCFLAGS="-O2"
  46. LIBDIRSUFFIX=""
  47. fi
  48. set -e
  49. rm -rf $PKG
  50. mkdir -p $TMP $PKG $OUTPUT
  51. cd $TMP
  52. rm -rf $PRGNAM-$VERSION
  53. tar -xvf $CWD/$PRGNAM-$VERSION.tar.gz
  54. cd $PRGNAM-$VERSION
  55. chown -R root:root .
  56. find -L . \
  57. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  58. -o -perm 511 \) -exec chmod 755 {} \; -o \
  59. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  60. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  61. CFLAGS="$SLKCFLAGS" \
  62. CXXFLAGS="$SLKCFLAGS" \
  63. ./configure \
  64. --prefix=/usr \
  65. --sysconfdir=/etc \
  66. --docdir=/usr/doc/$PRGNAM-$VERSION \
  67. --mandir=/usr/man \
  68. --libdir=/usr/lib${LIBDIRSUFFIX} \
  69. --build=$ARCH-slackware-linux
  70. make
  71. make install DESTDIR=$PKG
  72. mv $PKG/etc/aprx.conf $PKG/etc/aprx.conf.new
  73. mkdir -p $PKG/etc/rc.d
  74. install -m 644 $CWD/rc.aprx.new $PKG/etc/rc.d
  75. mkdir -p $PKG/usr/share/$PRGNAM/
  76. cp -a firmware $PKG/usr/share/$PRGNAM
  77. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  78. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  79. find $PKG/usr/man -type f -exec gzip -9 {} \;
  80. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  81. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  82. cp -a ChangeLog INSTALL LICENSE PROTOCOLS README ROADMAP TIMESTAMP-AT-APRSIS TODO \
  83. ViscousDigipeater.README ViscousDigipeaterTxEffect.png aprx-complex.conf doc/* \
  84. $PKG/usr/doc/$PRGNAM-$VERSION
  85. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  86. find $PKG/usr/doc -name "Makefile" -exec rm {} \;
  87. find $PKG/usr/doc -type f -exec chmod 644 {} \;
  88. mkdir -p $PKG/install
  89. cat $CWD/slack-desc > $PKG/install/slack-desc
  90. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  91. cd $PKG
  92. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}