~ubuntu-branches/debian/sid/mplayer/sid

« back to all changes in this revision

Viewing changes to debian/get-orig-source.sh

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Fabian Greffrath, Reinhard Tartler
  • Date: 2011-03-03 18:04:07 UTC
  • Revision ID: james.westby@ubuntu.com-20110303180407-3qpkx6rwf1umhtd9
Tags: 2:1.0~rc4.dfsg1-2
[ Fabian Greffrath ]
* Update documentation with regard to our modifications to the upstream tarball.

[ Reinhard Tartler ]
* really no longer build mplayer-gui, Closes: #612473
* simplify/remove instruction to get upstream sources
* normalize debian/{control,copyright,mplayer.install} with wrap-and-sort
* bump standards version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
#
3
 
#  Script to create a 'pristine' tarball for the debian mplayer source package
4
 
#  Copyright (C) 2009, Reinhard Tartler
5
 
#
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.
10
 
#
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.
15
 
#
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.
19
 
 
20
 
set -eu
21
 
 
22
 
usage() {
23
 
        cat >&2 <<EOF
24
 
usage: $0 [-dh]
25
 
  -h : display help
26
 
  -d : svn date
27
 
EOF
28
 
}
29
 
 
30
 
debug () {
31
 
        $DEBUG && echo "DEBUG: $*" >&2
32
 
}
33
 
 
34
 
error () {
35
 
        echo "$1" >&2
36
 
        exit 1;
37
 
}
38
 
 
39
 
set +e
40
 
PARAMS=`getopt hd: "$@"`
41
 
if test $? -ne 0; then usage; exit 1; fi;
42
 
set -e
43
 
 
44
 
eval set -- "$PARAMS"
45
 
 
46
 
DEBUG=false
47
 
SVNDATE=
48
 
 
49
 
while test $# -gt 0
50
 
do
51
 
        case $1 in
52
 
                -h) usage; exit 1 ;;
53
 
                -d) SVNDATE=$2; shift ;;
54
 
                --) shift ; break ;;
55
 
                *)  echo "Internal error!" ; exit 1 ;;
56
 
        esac
57
 
        shift
58
 
done
59
 
 
60
 
# sanity checks now
61
 
dh_testdir
62
 
 
63
 
if [ -z $SVNDATE ]; then
64
 
        error "you need to specify an svn date. e.g. 20081230 for Dec 29. 2008"
65
 
fi
66
 
 
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
70
 
PACKAGENAME=mplayer
71
 
 
72
 
TMPDIR=`mktemp -d`
73
 
trap 'rm -rf ${TMPDIR}'  EXIT
74
 
 
75
 
baseurl="svn://svn.mplayerhq.hu/mplayer/branches/1.0rc3"
76
 
 
77
 
svn export -r{${SVNDATE}} \
78
 
        --ignore-externals \
79
 
        ${baseurl}  \
80
 
        ${TMPDIR}/${PACKAGENAME}
81
 
 
82
 
svn info -r{${SVNDATE}} \
83
 
        ${baseurl} \
84
 
        | awk '/^Revision/ {print $2}' \
85
 
        > ${TMPDIR}/${PACKAGENAME}/.svnrevision
86
 
 
87
 
# get svn externals
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
95
 
done
96
 
 
97
 
# for mplayer release branches, libswscale is special since it contains
98
 
# svn revision options. The revision below needs manual syncing with
99
 
# upstream's svn.
100
 
 
101
 
# TODO: find some way to integrate this in the while loop above
102
 
 
103
 
dest="${TMPDIR}/${PACKAGENAME}/libswscale"
104
 
revision=28777
105
 
svn export -r $revision svn://svn.ffmpeg.org/mplayer/trunk/libswscale $dest
106
 
echo $revision > ${dest}/.svnrevision
107
 
 
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 )
111
 
 
112
 
( cd ${TMPDIR}/ && mv ${PACKAGENAME} ${PACKAGENAME}-${SVNDATE} )
113
 
 
114
 
tar czf ${TARBALL_UNSTRIPPED} -C ${TMPDIR} ${PACKAGENAME}-${SVNDATE}
115
 
        
116
 
( cd ${TMPDIR}/${PACKAGENAME}-${SVNDATE} && sh ${CLEANUPSCRIPT} )
117
 
 
118
 
tar czf ${TARBALL} -C ${TMPDIR} ${PACKAGENAME}-${SVNDATE}
119
 
 
120
 
# print diff
121
 
( cd ${TMPDIR} && ptardiff ${TARBALL_UNSTRIPPED} ) | tee ${TARBALL}.diff