gtypist.SlackBuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #!/bin/sh
  2. # Slackware build script for gtypist
  3. # Copyright 2007-2012 Grigorios Bouzakis <grbzks@imap.cc>
  4. # Copyright 2014 Aaditya Bagga <aaditya_gnulinux@zoho.com>
  5. # All rights reserved.
  6. #
  7. # Permission to use, copy, modify, and distribute this software for any purpose
  8. # with or without fee is hereby granted, provided that the above copyright
  9. # notice and this permission notice appear in all copies.
  10. #
  11. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  12. # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  13. # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  14. # AUTHORS AND COPYRIGHT HOLDERS AND THEIR CONTRIBUTORS BE LIABLE FOR ANY
  15. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  16. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  17. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  19. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  20. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. PRGNAM=gtypist
  22. VERSION=${VERSION:-2.9.5}
  23. BUILD=${BUILD:-3}
  24. TAG=${TAG:-_SBo}
  25. if [ -z "$ARCH" ]; then
  26. case "$( uname -m )" in
  27. i?86) ARCH=i486 ;;
  28. arm*) ARCH=arm ;;
  29. *) ARCH=$( uname -m ) ;;
  30. esac
  31. fi
  32. CWD=$(pwd)
  33. TMP=${TMP:-/tmp/SBo}
  34. PKG=$TMP/package-$PRGNAM
  35. OUTPUT=${OUTPUT:-/tmp}
  36. if [ "$ARCH" = "i486" ]; then
  37. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "i686" ]; then
  40. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  41. LIBDIRSUFFIX=""
  42. elif [ "$ARCH" = "x86_64" ]; then
  43. SLKCFLAGS="-O2 -fPIC"
  44. LIBDIRSUFFIX="64"
  45. else
  46. SLKCFLAGS="-O2"
  47. LIBDIRSUFFIX=""
  48. fi
  49. DOCS="ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS QUESTIONS README THANKS TODO"
  50. set -e
  51. rm -rf $PKG
  52. mkdir -p $TMP $PKG $OUTPUT
  53. cd $TMP
  54. rm -rf $PRGNAM-$VERSION
  55. tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
  56. cd $PRGNAM-$VERSION
  57. chown -R root:root .
  58. find -L . \
  59. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  60. -o -perm 511 \) -exec chmod 755 {} \; -o \
  61. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  62. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  63. CFLAGS="$SLKCFLAGS" \
  64. CXXFLAGS="$SLKCFLAGS" \
  65. ./configure \
  66. --prefix=/usr \
  67. --libdir=/usr/lib${LIBDIRSUFFIX} \
  68. --sysconfdir=/etc \
  69. --localstatedir=/var \
  70. --infodir=/usr/info \
  71. --mandir=/usr/man \
  72. --docdir=/usr/doc/$PRGNAM-$VERSION \
  73. --build=$ARCH-slackware-linux
  74. make
  75. make install DESTDIR=$PKG
  76. # Copy .desktop file
  77. mkdir -p $PKG/usr/share/applications
  78. cp $CWD/gtypist.desktop $PKG/usr/share/applications/
  79. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  80. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  81. find $PKG/usr/man -type f -exec gzip -9 {} \;
  82. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  83. rm -f $PKG/usr/info/dir
  84. find $PKG/usr/info -type f -exec gzip -9 {} \;
  85. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  86. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  87. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  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}