moodbar.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/sh
  2. # Slackware build script for moodbar
  3. # Copyright 2008 Andrew Psaltis <ampsaltis@gmail.com>
  4. # All rights reserved.
  5. # Redistribution and use of this script, with or without modification, is
  6. # permitted provided that the following conditions are met:
  7. #
  8. # 1. Redistributions of this script must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. #
  11. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  12. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  14. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  16. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  17. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  18. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  19. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  20. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. # Modified by SlackBuilds.org
  22. set -e
  23. DOCS="AUTHORS COPYING INSTALL NEWS README TODO"
  24. PRGNAM=moodbar
  25. VERSION=0.1.2
  26. ARCH=${ARCH:-i486}
  27. BUILD=${BUILD:-1}
  28. TAG=${TAG:-_SBo}
  29. CWD=$(pwd)
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG=$TMP/package-$PRGNAM
  32. OUTPUT=${OUTPUT:-/tmp}
  33. case $ARCH in
  34. i[456]86)
  35. SLKCFLAGS="-O2 -march=$ARCH -mtune=i686"
  36. SLKLDFLAGS="" ; LIBDIRSUFFIX=""
  37. ;;
  38. s390) # Maybe you want to cross-compile
  39. SLKCFLAGS="-O2"
  40. SLKLDFLAGS="" ; LIBDIRSUFFIX=""
  41. ;;
  42. powerpc)
  43. SLKCFLAGS="-O2"
  44. SLKLDFLAGS=""; LIBDIRSUFFIX=""
  45. ;;
  46. x86_64)
  47. SLKCFLAGS="-O2 -fPIC"
  48. SLKLDFLAGS="-L/usr/lib64" ; LIBDIRSUFFIX="64"
  49. ;;
  50. athlon-xp)
  51. SLKCFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
  52. SLKLDFLAGS=""; LIBDIRSUFFIX=""
  53. ;;
  54. esac
  55. rm -rf $PKG
  56. mkdir -p $TMP $PKG $OUTPUT
  57. cd $TMP
  58. rm -rf $PRGNAM-$VERSION
  59. tar xfvz $CWD/$PRGNAM-$VERSION.tar.gz
  60. cd $PRGNAM-$VERSION
  61. chown -R root:root .
  62. chmod -R u+w,go+r-w,a-s .
  63. # Apply patch to fix currently unfixed bug
  64. # This has been fixed in SVN, but has not been applied to a release.
  65. # And no releases have been made for quite some time. So...
  66. patch -p1 < $CWD/$PRGNAM-$VERSION-glib.patch
  67. CFLAGS="$SLKCFLAGS" \
  68. CXXFLAGS="$SLKCFLAGS" \
  69. ./configure \
  70. --prefix=/usr \
  71. --sysconfdir=/etc \
  72. --localstatedir=/var \
  73. --with-gnu-ld \
  74. --disable-static \
  75. --build=$ARCH-slackware-linux
  76. make
  77. make install DESTDIR=$PKG
  78. # Strip binaries and libraries
  79. ( cd $PKG
  80. find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  81. find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  82. )
  83. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  84. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  85. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  86. mkdir -p $PKG/install
  87. cat $CWD/slack-desc > $PKG/install/slack-desc
  88. cd $PKG
  89. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz