Want more features on Pastebin? Sign Up, it's FREE!
Guest

ponce

By: a guest on Nov 3rd, 2009  |  syntax: None  |  size: 3.35 KB  |  views: 54  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2.  
  3. # Slackware Package Build Script for Schroedinger
  4. # Home Page http://www.diracvideo.org/
  5.  
  6. # Copyright (c) 2008-2009, Nishant Limbachia, Hoffman Est, IL, USA (nishant@mnspace.net)
  7. # All rights reserved.
  8. #
  9. # Redistribution and use of this script, with or without modification, is
  10. # permitted provided that the following conditions are met:
  11. #
  12. # 1. Redistributions of script must retain the above copyright notice,
  13. #    this list of conditions and the following disclaimer.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  19. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  20. # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  22. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  23. # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  24. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. #
  27. # slightly modified by ponce: changed version to 1.0.8 and added applying of patch
  28.  
  29. PRGNAM=schroedinger
  30. VERSION=1.0.8
  31. ARCH=${ARCH:-x86_64}
  32. BUILD=${BUILD:-1}
  33. TAG=${TAG:-ponce}
  34.  
  35. CWD=$(pwd)
  36. TMP=${TMP:-/tmp/SBo}
  37. PKG=$TMP/package-$PRGNAM
  38. OUTPUT=${OUTPUT:-/tmp}
  39.  
  40. if [ "$ARCH" = "i486" ]; then
  41.   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  42.   LIBDIRSUFFIX=""
  43. elif [ "$ARCH" = "i686" ]; then
  44.   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  45.   LIBDIRSUFFIX=""
  46. elif [ "$ARCH" = "x86_64" ]; then
  47.   SLKCFLAGS="-O2 -fPIC"
  48.   LIBDIRSUFFIX="64"
  49. fi
  50.  
  51. set -e # Exit on most errors
  52.  
  53. rm -fr $TMP/$PRGNAM-$VERSION $PKG
  54. mkdir -p $TMP $PKG $OUTPUT
  55. cd $TMP
  56. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  57. cd $PRGNAM-$VERSION
  58. chown -R root.root .
  59. find . \
  60.  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  61.  -exec chmod 755 {} \; -o \
  62.  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  63.  -exec chmod 644 {} \;
  64.  
  65. patch -p1 < $CWD/schroedinger-1.0.8_test.patch
  66.  
  67. CFLAGS="$SLKCFLAGS" \
  68. CXXFLAGS="$SLKCFLAGS" \
  69. ./configure \
  70.   --prefix=/usr \
  71.   --sysconfdir=/etc \
  72.   --libdir=/usr/lib${LIBDIRSUFFIX} \
  73.   --localstatedir=/var \
  74.   --mandir=/usr/man \
  75.   --disable-static \
  76.   --build=$ARCH-slackware-linux
  77.  
  78. make
  79. make install DESTDIR=$PKG
  80.  
  81. ( cd $PKG
  82.   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
  83.     xargs strip --strip-unneeded 2> /dev/null
  84.   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
  85.     xargs strip --strip-unneeded 2> /dev/null
  86. )
  87.  
  88. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  89. cp -a AUTHORS COPYING* NEWS TODO $PKG/usr/doc/$PRGNAM-$VERSION
  90. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  91.  
  92. ( cd $PKG/usr/doc/$PRGNAM-$VERSION
  93.   ln -s /usr/share/gtk-doc/html/schroedinger html
  94. )
  95.  
  96. ( cd $PKG/usr/man || exit 1
  97.   find . -type f -exec gzip -9 {} \;
  98.   for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
  99. )
  100.  
  101. mkdir -p $PKG/install
  102. cat $CWD/slack-desc > $PKG/install/slack-desc
  103.  
  104. cd $PKG
  105. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
clone this paste RAW Paste Data