3
# This script is used to download the upstream source for libva and
4
# generate it into an orig source tarball for Debian.
6
# Common variables used to ease maintenance of this script
8
LIBVA_TARBALL="libva-$LIBVA_VERSION.tar.gz"
9
LIBVA_ORIG_TARBALL="libva_$LIBVA_VERSION.orig.tar.gz"
11
This script is used to generate the orig tarball used in building\n\
12
Debian packages for libva-$LIBVA_VERSION.\n\
13
Usage: libva-get-orig-source [OPTION]\n\
15
-h, --help Display this help message.\n"
17
while [ "$#" -gt "0" ]
27
make_current_tarball() {
28
# Download the tarball if it's not available in the current directory
29
[ -f $LIBVA_TARBALL ] || \
30
wget -c http://cgit.freedesktop.org/libva/snapshot/$LIBVA_TARBALL
32
# Extract tarball and run 'autoreconf -vif'
33
echo "Extracting tarball and running 'autoreconf -vif'"
34
tar -zxf $LIBVA_TARBALL
35
cd libva-$LIBVA_VERSION
39
# Remove temp files and other cruft from source tarball
40
# The find command snippet here was taken from debhelper's dh_clean command
41
# with some modification to delete more unneeded files.
42
echo "Removing temp files and other cruft from source tarball"
43
find libva-$LIBVA_VERSION \( \( -type f -a \
44
\( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
45
-o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
46
-o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
47
-o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \
48
-o -name config.status -o -name config.cache -o -name config.log \
49
\) -exec rm -f "{}" \; \) -o \
50
\( -type d -a -name autom4te.cache -prune -exec rm -rf "{}" \; \) \)
51
rm libva-$LIBVA_VERSION/.gitignore
52
rm libva-$LIBVA_VERSION/.cvsignore
53
rm -rf libva-$LIBVA_VERSION/debian
55
# Remove empty directories
56
echo "Removing empty directories"
57
find libva-$LIBVA_VERSION -type d -empty -delete
59
# Repack tarball to final orig tarball
60
echo "Creating orig tarball"
61
tar --exclude-vcs -zcf "$LIBVA_ORIG_TARBALL" "libva-$LIBVA_VERSION/"