dvdrip.SlackBuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. # Slackware build script for dvdrip
  3. # Written by Luis Henrique <lmello.009@gmail.com>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=dvdrip
  6. VERSION=${VERSION:-0.98.11}
  7. BUILD=${BUILD:-2}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i586 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  18. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  19. exit 0
  20. fi
  21. TMP=${TMP:-/tmp/SBo}
  22. PKG=$TMP/package-$PRGNAM
  23. OUTPUT=${OUTPUT:-/tmp}
  24. if [ "$ARCH" = "i586" ]; then
  25. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  26. LIBDIRSUFFIX=""
  27. elif [ "$ARCH" = "i686" ]; then
  28. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. elif [ "$ARCH" = "x86_64" ]; then
  31. SLKCFLAGS="-O2 -fPIC"
  32. LIBDIRSUFFIX="64"
  33. else
  34. SLKCFLAGS="-O2"
  35. LIBDIRSUFFIX=""
  36. fi
  37. set -e
  38. rm -rf $PKG
  39. mkdir -p $TMP $PKG $OUTPUT
  40. cd $TMP
  41. rm -rf $PRGNAM-$VERSION
  42. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  43. cd $PRGNAM-$VERSION
  44. chown -R root:root .
  45. find -L . \
  46. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  47. -exec chmod 755 {} \+ -o \
  48. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  49. -exec chmod 644 {} \+
  50. perl Makefile.PL \
  51. PREFIX=/usr \
  52. INSTALLDIRS=vendor \
  53. INSTALLVENDORMAN1DIR=/usr/man/man1 \
  54. INSTALLVENDORMAN3DIR=/usr/man/man3
  55. make -j1
  56. make -j1 install DESTDIR=$PKG
  57. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  58. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  59. # Install menu entries:
  60. mkdir -p $PKG/usr/share/{applications,pixmaps}
  61. cat $CWD/dvdrip.desktop > $PKG/usr/share/applications/dvdrip.desktop
  62. cat $CWD/dvdrip.png > $PKG/usr/share/pixmaps/dvdrip.png
  63. # some man files are empty ATM :/
  64. rm $PKG/usr/man/man1/dvdrip-*
  65. find $PKG/usr/man -type f -exec gzip -9 {} \;
  66. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  67. find $PKG -name perllocal.pod \
  68. -o -name ".packlist" \
  69. -o -name "*.bs" \
  70. | xargs rm -f
  71. find $PKG -depth -type d -empty -delete || true
  72. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  73. cp -a Changes* COPYRIGHT Credits MANIFEST README TODO \
  74. $PKG/usr/doc/$PRGNAM-$VERSION
  75. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  76. mkdir -p $PKG/install
  77. cat $CWD/slack-desc > $PKG/install/slack-desc
  78. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  79. cd $PKG
  80. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE