3
# Script to create a 'pristine' tarball for the debian mplayer source package
4
# Copyright (C) 2009, Reinhard Tartler
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License along
17
# with this program; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31
$DEBUG && echo "DEBUG: $*" >&2
40
PARAMS=`getopt hd: "$@"`
41
if test $? -ne 0; then usage; exit 1; fi;
53
-d) SVNDATE=$2; shift ;;
55
*) echo "Internal error!" ; exit 1 ;;
63
if [ -z $SVNDATE ]; then
64
error "you need to specify an svn date. e.g. 20081230 for Dec 29. 2008"
67
CLEANUPSCRIPT=`pwd`/debian/strip.sh
68
TARBALL=`pwd`/../mplayer_1.0~rc3+svn${SVNDATE}.orig.tar.gz
69
TARBALL_UNSTRIPPED=`pwd`/../mplayer-non-dfsg_1.0~rc3+svn${SVNDATE}.orig.tar.gz
73
trap 'rm -rf ${TMPDIR}' EXIT
75
baseurl="svn://svn.mplayerhq.hu/mplayer/branches/1.0rc3"
77
svn export -r{${SVNDATE}} \
80
${TMPDIR}/${PACKAGENAME}
82
svn info -r{${SVNDATE}} \
84
| awk '/^Revision/ {print $2}' \
85
> ${TMPDIR}/${PACKAGENAME}/.svnrevision
88
svn pg svn:externals $baseurl | grep -v libswscale | \
89
while read external url; do
90
[ -z $url ] && continue
91
dest="${TMPDIR}/${PACKAGENAME}/${external}"
92
svn export -r{${SVNDATE}} --ignore-externals $url $dest
93
svn info $url -r{${SVNDATE}} \
94
| awk '/^Revision/ {print $2}' > ${dest}/.svnrevision
97
# for mplayer release branches, libswscale is special since it contains
98
# svn revision options. The revision below needs manual syncing with
101
# TODO: find some way to integrate this in the while loop above
103
dest="${TMPDIR}/${PACKAGENAME}/libswscale"
105
svn export -r $revision svn://svn.ffmpeg.org/mplayer/trunk/libswscale $dest
106
echo $revision > ${dest}/.svnrevision
108
# this doesn't belong in strip.sh, because the unstripped source should
109
# have this directory renamed as well.
110
( cd ${TMPDIR}/${PACKAGENAME} && rm -rfv debian )
112
( cd ${TMPDIR}/ && mv ${PACKAGENAME} ${PACKAGENAME}-${SVNDATE} )
114
tar czf ${TARBALL_UNSTRIPPED} -C ${TMPDIR} ${PACKAGENAME}-${SVNDATE}
116
( cd ${TMPDIR}/${PACKAGENAME}-${SVNDATE} && sh ${CLEANUPSCRIPT} )
118
tar czf ${TARBALL} -C ${TMPDIR} ${PACKAGENAME}-${SVNDATE}
121
( cd ${TMPDIR} && ptardiff ${TARBALL_UNSTRIPPED} ) | tee ${TARBALL}.diff