bibus.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/bin/bash
  2. # Slackware build script for bibus
  3. # Written by David Miller dave@frop.net
  4. # Modified by the SlackBuilds.org project
  5. # Rewritten by Ryan P.C. McQuen
  6. # Copyright 2014 Ryan P.C. McQuen, WA, ryanpcmcquen@member.fsf.org
  7. # Copyright 2017 Dhaby Xiloj <slack.dhabyx@gmail.com>
  8. # All rights reserved.
  9. #
  10. # Redistribution and use of this script, with or without modification, is
  11. # permitted provided that the following conditions are met:
  12. #
  13. # 1. Redistributions of this script must retain the above copyright
  14. # notice, this list of conditions and the following disclaimer.
  15. #
  16. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  17. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  19. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  22. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  23. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  24. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  25. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. cd $(dirname $0) ; CWD=$(pwd)
  27. PRGNAM=bibus
  28. VERSION=${VERSION:-1.5.2}
  29. ARCH=noarch
  30. BUILD=${BUILD:-1}
  31. TAG=${TAG:-_SBo}
  32. PKGTYPE=${PKGTYPE:-tgz}
  33. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  34. # the name of the created package would be, and then exit. This information
  35. # could be useful to other scripts.
  36. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  37. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  38. exit 0
  39. fi
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM
  42. OUTPUT=${OUTPUT:-/tmp}
  43. set -e
  44. rm -rf $PKG
  45. mkdir -p $TMP $PKG $OUTPUT
  46. cd $TMP
  47. rm -rf $PRGNAM-$VERSION
  48. tar xvf $CWD/$PRGNAM\_$VERSION.orig.tar.gz
  49. cd $PRGNAM-$VERSION
  50. chown -R root:root .
  51. find -L . \
  52. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  53. -o -perm 511 \) -exec chmod 755 {} \; -o \
  54. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  55. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  56. make \
  57. PKGDIR=$PKG \
  58. DESTDIR=$PKG/usr \
  59. mandir=$PKG/usr/man \
  60. sysconfdir=$PKG/etc \
  61. docdir=$PKG/usr/doc/$PRGNAM-$VERSION \
  62. oopath=$PKG/opt/openoffice4/program \
  63. ooure=$PKG/opt/openoffice4/basis-link/ure-link/lib \
  64. oobasis=$PKG/opt/openoffice4/basis-link/program
  65. # Don't clobber the config file
  66. mv $PKG/etc/bibus.config $PKG/etc/bibus.config.new
  67. (
  68. cd $PKG/usr/man/
  69. find . -type f -exec gzip -9 {} \;
  70. for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  71. )
  72. rm -f $PKG/usr/share/bibus/*/*.{csv,py}~
  73. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  74. cp -a -r Docs/* $PKG/usr/doc/$PRGNAM-$VERSION
  75. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  76. mkdir -p $PKG/install
  77. cat $CWD/slack-desc > $PKG/install/slack-desc
  78. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  79. cd $PKG
  80. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE