pidgin-window_merge.SlackBuild 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. # Slackware build script for Window Merge for Pidgin
  3. #
  4. # Copyright 2016 chinarulezzz <s.alex08@mail.ru>
  5. # All rights reserved.
  6. #
  7. # Redistribution and use of this script, with or without modification, is
  8. # permitted provided that the following conditions are met:
  9. #
  10. # 1. Redistributions of this script must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  14. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  16. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  19. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  20. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  21. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  22. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. cd $(dirname $0) ; CWD=$(pwd)
  24. PRGNAM=pidgin-window_merge
  25. VERSION=${VERSION:-0.3}
  26. BUILD=${BUILD:-1}
  27. TAG=${TAG:-_SBo}
  28. PKGTYPE=${PKGTYPE:-tgz}
  29. MARCH=$( uname -m )
  30. if [ -z "$ARCH" ]; then
  31. case "$MARCH" in
  32. i?86) export ARCH=i586 ;;
  33. armv7hl) export ARCH=$MARCH ;;
  34. arm*) export ARCH=arm ;;
  35. *) export ARCH=$MARCH ;;
  36. esac
  37. fi
  38. if [ "$ARCH" = "i586" ]; then
  39. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  40. LIBDIRSUFFIX=""
  41. elif [ "$ARCH" = "i686" ]; then
  42. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  43. LIBDIRSUFFIX=""
  44. elif [ "$ARCH" = "x86_64" ]; then
  45. SLKCFLAGS="-O2 -fPIC"
  46. LIBDIRSUFFIX="64"
  47. elif [ "$ARCH" = "armv7hl" ]; then
  48. SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
  49. LIBDIRSUFFIX=""
  50. else
  51. SLKCFLAGS="-O2"
  52. LIBDIRSUFFIX=""
  53. fi
  54. set -e
  55. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  56. # the name of the created package would be, and then exit. This information
  57. # could be useful to other scripts.
  58. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  59. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  60. exit 0
  61. fi
  62. TMP=${TMP:-/tmp/SBo}
  63. PKG=$TMP/package-$PRGNAM
  64. OUTPUT=${OUTPUT:-/tmp}
  65. rm -rf $PKG
  66. mkdir -p $TMP $PKG $OUTPUT
  67. cd $TMP
  68. rm -rf window_merge-$VERSION
  69. # respecting content-disposition may include cgi params in the filename
  70. TARBALL=$CWD/window_merge-$VERSION.tar.gz
  71. if [ ! -e $TARBALL ]; then
  72. TARBALL="$(/bin/ls $TARBALL\?* | head -1)"
  73. fi
  74. tar xvf $TARBALL
  75. cd window_merge-$VERSION
  76. chown -R root:root .
  77. find -L . \
  78. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  79. -o -perm 511 \) -exec chmod 755 {} \; -o \
  80. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  81. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  82. autoreconf -fi
  83. CFLAGS="$SLKCFLAGS" \
  84. CXXFLAGS="$SLKCFLAGS" \
  85. ./configure \
  86. --prefix=/usr \
  87. --libdir=/usr/lib${LIBDIRSUFFIX} \
  88. --sysconfdir=/etc \
  89. --localstatedir=/var \
  90. --build=$ARCH-slackware-linux
  91. make
  92. make install DESTDIR=$PKG
  93. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  94. cp -a AUTHORS BUGS COPYING ChangeLog NEWS README TODO \
  95. $PKG/usr/doc/$PRGNAM-$VERSION
  96. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  97. mkdir -p $PKG/install
  98. cat $CWD/slack-desc > $PKG/install/slack-desc
  99. cd $PKG
  100. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE