g15composer.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #!/bin/bash
  2. # Slackware build script for g15composer
  3. # Copyright (c) 2009 Alan Alberghini <414N@slacky.it>
  4. # All rights reserved.
  5. #
  6. # Permission to use, copy, modify, and distribute this software for
  7. # any purpose with or without fee is hereby granted, provided that
  8. # the above copyright notice and this permission notice appear in all
  9. # copies.
  10. #
  11. # THIS SOFTWARE IS PROVIDED AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. # IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. # SUCH DAMAGE.
  23. cd $(dirname $0) ; CWD=$(pwd)
  24. PRGNAM=g15composer
  25. VERSION=${VERSION:-3.2}
  26. BUILD=${BUILD:-1}
  27. TAG=${TAG:-_SBo}
  28. PKGTYPE=${PKGTYPE:-tgz}
  29. DOCS="README AUTHORS ChangeLog NEWS COPYING"
  30. if [ -z "$ARCH" ]; then
  31. case "$( uname -m )" in
  32. i?86) ARCH=i486 ;;
  33. arm*) ARCH=arm ;;
  34. *) ARCH=$( uname -m ) ;;
  35. esac
  36. fi
  37. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  38. # the name of the created package would be, and then exit. This information
  39. # could be useful to other scripts.
  40. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  41. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  42. exit 0
  43. fi
  44. TMP=${TMP:-/tmp/SBo}
  45. PKG=$TMP/package-$PRGNAM
  46. OUTPUT=${OUTPUT:-/tmp}
  47. if [ "$ARCH" = "i486" ]; then
  48. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  49. LIBDIRSUFFIX=""
  50. elif [ "$ARCH" = "s390" ]; then
  51. SLKCFLAGS="-O2"
  52. LIBDIRSUFFIX=""
  53. elif [ "$ARCH" = "x86_64" ]; then
  54. SLKCFLAGS="-O2 -fPIC"
  55. LIBDIRSUFFIX="64"
  56. else
  57. SLKCFLAGS="-O2"
  58. LIBDIRSUFFIX=""
  59. fi
  60. set -e
  61. rm -rf $PKG
  62. mkdir -p $TMP $PKG $OUTPUT
  63. cd $TMP
  64. rm -rf $PRGNAM-$VERSION
  65. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  66. cd $PRGNAM-$VERSION
  67. chown -R root:root .
  68. find -L . \
  69. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  70. -exec chmod 755 {} \; -o \
  71. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  72. -exec chmod 644 {} \;
  73. CFLAGS="$SLKCFLAGS" \
  74. CXXFLAGS="$SLKCFLAGS" \
  75. ./configure \
  76. --prefix=/usr \
  77. --libdir=/usr/lib${LIBDIRSUFFIX} \
  78. --sysconfdir=/etc \
  79. --localstatedir=/var \
  80. --mandir=/usr/man \
  81. --docdir=/usr/doc/$PRGNAM-$VERSION \
  82. --build=$ARCH-slackware-linux
  83. make install-strip docdir=/usr/doc/$PRGNAM-$VERSION DESTDIR=$PKG
  84. ( cd $PKG/usr/man
  85. find . -type f -exec gzip -9 {} \;
  86. for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  87. )
  88. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  89. mkdir -p $PKG/install
  90. cat $CWD/slack-desc > $PKG/install/slack-desc
  91. cd $PKG
  92. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE