geany.SlackBuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #!/bin/bash
  2. # Slackware build script for Geany
  3. # Ryan S. Northrup | Reno, NV | northrup@yellowapple.us
  4. # Previous maintainer(s):
  5. # Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
  6. # Written by Evan Hisey <ehisey@gmail.com>
  7. # Copyright 2009-2014 Michiel van Wessem, Leicester, United Kingdom
  8. # All rights reserved.
  9. #
  10. # Redistribution and use in source and binary forms, with or without
  11. # modification, are permitted provided that the following conditions are
  12. # met:
  13. #
  14. # * Redistributions of source code must retain the above copyright
  15. # notice, this list of conditions and the following disclaimer.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  20. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  21. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  22. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  23. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  27. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. cd $(dirname $0) ; CWD=$(pwd)
  29. PRGNAM=geany
  30. VERSION=${VERSION:-1.36.0}
  31. BUILD=${BUILD:-2}
  32. TAG=${TAG:-_SBo}
  33. PKGTYPE=${PKGTYPE:-tgz}
  34. if [ -z "$ARCH" ]; then
  35. case "$( uname -m )" in
  36. i?86) ARCH=i586 ;;
  37. arm*) ARCH=arm ;;
  38. *) ARCH=$( uname -m ) ;;
  39. esac
  40. fi
  41. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  42. # the name of the created package would be, and then exit. This information
  43. # could be useful to other scripts.
  44. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  45. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  46. exit 0
  47. fi
  48. TMP=${TMP:-/tmp/SBo}
  49. PKG=$TMP/package-$PRGNAM
  50. OUTPUT=${OUTPUT:-/tmp}
  51. # Enable support for global tags - make sure any .tags files are in $CWD.
  52. TAGS=${TAGS:-no}
  53. if [ "$ARCH" = "i586" ]; then
  54. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  55. LIBDIRSUFFIX=""
  56. elif [ "$ARCH" = "i686" ]; then
  57. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  58. LIBDIRSUFFIX=""
  59. elif [ "$ARCH" = "x86_64" ]; then
  60. SLKCFLAGS="-O2 -fPIC"
  61. LIBDIRSUFFIX="64"
  62. else
  63. SLKCFLAGS="-O2"
  64. LIBDIRSUFFIX=""
  65. fi
  66. set -e
  67. rm -rf $PKG
  68. mkdir -p $TMP $PKG $OUTPUT
  69. cd $TMP
  70. rm -rf $PRGNAM-$VERSION
  71. tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
  72. cd $PRGNAM-$VERSION
  73. chown -R root:root .
  74. find -L . \
  75. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  76. -o -perm 511 \) -exec chmod 755 {} \; -o \
  77. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  78. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  79. CFLAGS="$SLKCFLAGS" \
  80. CXXFLAGS="$SLKCFLAGS" \
  81. ./autogen.sh \
  82. --prefix=/usr \
  83. --sysconfdir=/etc \
  84. --libdir=/usr/lib${LIBDIRSUFFIX} \
  85. --localstatedir=/var \
  86. --mandir=/usr/man \
  87. --docdir=/usr/doc/$PRGNAM-$VERSION \
  88. --disable-static \
  89. --enable-gtk3 \
  90. --build=$ARCH-slackware-linux
  91. make
  92. make install DESTDIR=$PKG
  93. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  94. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  95. find $PKG/usr/man -type f -exec gzip -9 {} \;
  96. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  97. # Add global support for tags:
  98. if [ "$TAGS" = "yes" ]; then
  99. mkdir -p $PKG/usr/share/$PRGNAM/tags
  100. for tagfile in $CWD/tags/*; do
  101. cat $tagfile > $PKG/usr/share/$PRGNAM/tags/${tagfile##/*/}
  102. done
  103. fi
  104. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  105. cp -a AUTHORS COMMITTERS COPYING ChangeLog* HACKING INSTALL NEWS README* THANKS TODO \
  106. $PKG/usr/doc/$PRGNAM-$VERSION
  107. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  108. rm -f $PKG/usr/lib*/*.la
  109. mkdir -p $PKG/install
  110. cat $CWD/slack-desc > $PKG/install/slack-desc
  111. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  112. cd $PKG
  113. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE