funny-manpages.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/sh
  2. # Slackware build script for funny-manpages
  3. # Copyright 2007-2008 Michiel van Wessem, Manchester, United Kingdom
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are
  8. # met:
  9. #
  10. # * Redistributions of source code must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  14. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  17. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  19. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  20. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  21. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. PRGNAM=funny-manpages
  25. VERSION=1.3.5
  26. SRC_VERSION=1.3
  27. DEB_VERSION=1.3-5
  28. ARCH=${ARCH:-noarch}
  29. BUILD=${BUILD:-1}
  30. TAG=${TAG:-_SBo}
  31. CWD=$(pwd)
  32. TMP=${TMP:-/tmp/SBo}
  33. PKG=$TMP/package-$PRGNAM
  34. OUTPUT=${OUTPUT:-/tmp}
  35. set -e
  36. rm -rf $PKG
  37. mkdir -p $TMP $PKG $OUTPUT
  38. cd $TMP
  39. rm -rf $PRGNAM-$VERSION
  40. tar xvf $CWD/${PRGNAM}_$SRC_VERSION.orig.tar.gz
  41. cd $PRGNAM-$SRC_VERSION.orig
  42. chown -R root:root .
  43. find . \
  44. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  45. -exec chmod 755 {} \; -o \
  46. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  47. -exec chmod 644 {} \;
  48. # Patch the manpages to the latest version.
  49. patch -p1 < $CWD/${PRGNAM}_$DEB_VERSION.diff
  50. # Create the directories we need
  51. mkdir -p $PKG/usr/man/man{1,3,6}
  52. for manpage in $(echo *fun); do
  53. section=$(echo $manpage | awk -F. '{print $2}' | colrm 2 4)
  54. install -m 0644 $manpage $PKG/usr/man/man$section/$manpage
  55. done
  56. ( cd $PKG/usr/man/man1
  57. ln -sf grope.1fun egrope.1fun
  58. ln -sf grope.1fun fgrope.1fun
  59. )
  60. ( cd $PKG/usr/man
  61. find . -type f -exec gzip -9 {} \;
  62. for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  63. )
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a debian/README.Debian debian/changelog debian/copyright \
  66. $PKG/usr/doc/$PRGNAM-$VERSION
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cd $PKG
  71. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz