summaryrefslogtreecommitdiff
path: root/multimedia/HandBrake/HandBrake.SlackBuild
blob: a3699279a3a9520b0d2d47c2db295609766fd491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh

# Slackware build script for HandBrakeCLI

# This slackbuild maintained by Klaatu at klaatu@hackerpublicradio.org
# Modified by David Somero at SlackBuilds.org.

PRGNAM=HandBrake
VERSION=${VERSION:-0.9.4}
ARCH=${ARCH:-i686}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

# Has to be i686 or x86_64
if [ "$ARCH" != "x86_64" ]; then
 ARCH="i686"
fi

# We are doing this to prevent HandBrake from downloading these
# files. SBo does not allow scripts/source to download stuff.
DLOADS="a52dec-0.7.4.tar.gz faac-1.28.tar.gz faad2-2.7.tar.gz 
ffmpeg-r19067.tar.bz2 lame-3.98.tar.gz libdca-r81-strapped.tar.gz 
libdvdnav-svn1168.tar.gz libdvdread-svn1168.tar.gz libmkv-0.6.4.tar.bz2 
libogg-1.1.3.tar.gz libsamplerate-0.1.4.tar.gz libtheora-1.1.0.tar.bz2 
libvorbis-aotuv_b5.tar.gz mp4v2-trunk-r355.tar.bz2 mpeg2dec-0.5.1.tar.gz 
x264-r1347-5ddd61b.tar.gz"

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
mkdir download
for file in $DLOADS ; do mv $CWD/$file download ; done
chown -R root:root .
chmod -R a-s,u+w,g-w+r,o-w+r .

./configure \
  --prefix=/usr\
  --disable-gtk \
  --arch=$ARCH

cd build
  make
  install -D -m0755 HandBrakeCLI $PKG/usr/bin/HandBrakeCLI
cd ..

( cd $PKG
  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
    xargs strip --strip-unneeded 2> /dev/null || true
  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
    xargs strip --strip-unneeded 2> /dev/null || true
)

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING CREDITS NEWS THANKS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}