9menu.SlackBuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/bash
  2. # Slackware build script for 9menu
  3. # Copyright 2014 Leonard Schmidt <email removed>
  4. # All rights reserved.
  5. #
  6. # Permission to use, copy, modify, and distribute this software for any purpose
  7. # with or without fee is hereby granted, provided that the above copyright
  8. # notice and this permission notice appear in all copies.
  9. #
  10. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  11. # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  12. # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  13. # AUTHORS AND COPYRIGHT HOLDERS AND THEIR CONTRIBUTORS BE LIABLE FOR ANY
  14. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  15. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  16. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  17. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  18. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  19. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20. # Now maintained by B. Watson <yalhcru@gmail.com>.
  21. # 20200708 bkw:
  22. # - Update for v1.10
  23. # 20180628 bkw:
  24. # - Take over maintenance.
  25. # - Use github .tar.gz release. NO WAY am I leaving this:
  26. # zcat $CWD/$PRGNAM-$VERSION.shar.gz | sh
  27. # ...in a scipt to be run by root!
  28. # - Include ChangeLog in doc dir, bump BUILD to 2.
  29. cd $(dirname $0) ; CWD=$(pwd)
  30. PRGNAM=9menu
  31. VERSION=${VERSION:-1.10}
  32. BUILD=${BUILD:-1}
  33. TAG=${TAG:-_SBo}
  34. PKGTYPE=${PKGTYPE:-tgz}
  35. if [ -z "$ARCH" ]; then
  36. case "$( uname -m )" in
  37. i?86) ARCH=i586 ;;
  38. arm*) ARCH=arm ;;
  39. *) ARCH=$( uname -m ) ;;
  40. esac
  41. fi
  42. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  43. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  44. exit 0
  45. fi
  46. TMP=${TMP:-/tmp/SBo}
  47. PKG=$TMP/package-$PRGNAM
  48. OUTPUT=${OUTPUT:-/tmp}
  49. if [ "$ARCH" = "i586" ]; then
  50. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  51. LIBDIRSUFFIX=""
  52. elif [ "$ARCH" = "i686" ]; then
  53. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. elif [ "$ARCH" = "x86_64" ]; then
  56. SLKCFLAGS="-O2 -fPIC"
  57. LIBDIRSUFFIX="64"
  58. else
  59. SLKCFLAGS="-O2"
  60. LIBDIRSUFFIX=""
  61. fi
  62. set -e
  63. # Perfidious misuse of tags, I say! Harrumph!
  64. TARNAM=$PRGNAM-$PRGNAM-release-$VERSION
  65. rm -rf $PKG
  66. mkdir -p $TMP $PKG $OUTPUT
  67. cd $TMP
  68. rm -rf $TARNAM
  69. tar xvf $CWD/$TARNAM.tar.gz
  70. cd $TARNAM
  71. ln -s 9menu.1 9menu.man
  72. chown -R root:root .
  73. chmod 644 *
  74. xmkmf -a
  75. make CDEBUGFLAGS="$SLKCFLAGS"
  76. strip $PRGNAM
  77. make install install.man DESTDIR=$PKG
  78. gzip -9 $PKG/usr/man/man?/*.*
  79. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  80. cp -a README* ChangeLog* $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. cd $PKG
  85. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE