Mercurial > mplayer.hg
annotate TOOLS/binary_codecs.sh @ 32450:e5f6c91f66a9
sync x264 version check with the check in ffmpeg/configure
author | siretart |
---|---|
date | Wed, 27 Oct 2010 07:16:33 +0000 |
parents | 8f3293925a93 |
children | 6d06be50007f |
rev | line source |
---|---|
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
1 #!/bin/sh |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
2 set -e |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
3 |
29181 | 4 # avoid insecure tempfile creation |
5 umask 0022 | |
6 | |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
7 # This script will download binary codecs for MPlayer unto a Debian system. |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
8 |
29184 | 9 # Author: thuglife, mennucc1 |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
10 # |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
11 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
12 CODECDIR=/usr/lib/codecs |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
13 PREFDIR=/var/lib/mplayer/prefs |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
14 MYSITE='http://people.debian.org/~mennucc1/mplayer' |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
15 |
32398 | 16 dpkgarch=$(dpkg --print-architecture) |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
17 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
18 [ -d $PREFDIR ] || mkdir -v $PREFDIR |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
19 [ -d $CODECDIR ] || mkdir -v $CODECDIR |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
20 cd $CODECDIR |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
21 [ -d mplayer_binary_codecs ] || mkdir -v mplayer_binary_codecs |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
22 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
23 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
24 choosemirror () |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
25 { |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
26 cd $PREFDIR |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
27 |
29179 | 28 #if [ ! -r mirrors ] || find mirrors -mtime +20 ; then |
29185 | 29 echo "Downloading mirrors list" |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
30 wget -nv -c -N $MYSITE/mirrors || true |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
31 #fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
32 if [ ! -r bestsites ] || [ mirrors -nt bestsites ] || \ |
29187
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
33 find bestsites -mtime +20 | grep -q bestsites ; then |
29182 | 34 if which netselect > /dev/null ; then |
35 echo Choosing best mirrors using netselect | |
29187
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
36 netselect -s 5 -t 5 $( cat mirrors ) | awk '{print $2}' > bestsites |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
37 elif which fping > /dev/null ; then |
29187
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
38 fping -C 1 $( sed 's#.*//##;s#/.*##' mirrors ) 2>&1 | \ |
29179 | 39 egrep -v 'bytes.*loss' | sort -n -k3 | \ |
29187
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
40 grep -v ': *-' | awk '/:/{print $1}' | head -5 | ( while read mainsite ; do |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
41 grep $mainsite $PREFDIR/mirrors ; done ) > bestsites |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
42 else |
29185 | 43 echo "(If you install 'netselect' or 'fping', it will select the best mirror for you" |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
44 echo " you may wish to stop this script and rerun after installation)" |
29181 | 45 sleep 3 |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
46 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
47 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
48 } |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
49 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
50 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
51 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
52 INSTALL () { |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
53 filename="$3" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
54 dir="$2" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
55 url="$1" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
56 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
57 cd $CODECDIR/mplayer_binary_codecs |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
58 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
59 if [ -r $filename ] ; then |
29179 | 60 cp $filename $filename.bak |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
61 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
62 |
29179 | 63 if [ "$url" = @MAINSITE@ ] ; then |
32399
8f3293925a93
do not create a fake 'bestsites' if neither 'fping' or 'netselect' are installed
siretart
parents:
32398
diff
changeset
|
64 list=$PREFDIR/bestsites |
8f3293925a93
do not create a fake 'bestsites' if neither 'fping' or 'netselect' are installed
siretart
parents:
32398
diff
changeset
|
65 test -r $list || list=$PREFDIR/mirrors |
8f3293925a93
do not create a fake 'bestsites' if neither 'fping' or 'netselect' are installed
siretart
parents:
32398
diff
changeset
|
66 cat $list | while read mainsite ; do |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
67 echo Downloading $filename from $mainsite ... |
29181 | 68 wget -c -N $mainsite/$dir/$filename || true |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
69 if [ -r "$filename" ] ; then |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
70 UNPACK "$filename" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
71 return 0 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
72 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
73 done |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
74 else |
29181 | 75 wget -c -N $url/$dir/$filename || true |
29179 | 76 if [ -r "$filename" ] ; then |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
77 UNPACK "$filename" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
78 return 0 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
79 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
80 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
81 } |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
82 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
83 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
84 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
85 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
86 UNPACK () |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
87 { |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
88 filename="$1" |
29187
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
89 if [ -r $filename.bak ] && cmp $filename.bak $filename && [ -r $filename.list ] ; then |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
90 echo It appears that $filename was already succesfully installed |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
91 [ -r $filename.bak ] && rm $filename.bak |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
92 else |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
93 if grep -q " $filename$" $PREFDIR/MD5SUMS ; then |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
94 echo Checking MD5 for $filename |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
95 grep " $filename$" $PREFDIR/MD5SUMS | md5sum -c - |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
96 else |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
97 echo Warning: no MD5 for $filename were found. Hit enter to continue. |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
98 read dummy |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
99 fi |
29184 | 100 echo Installing $filename ... |
101 if [ -r $filename.list ] ; then | |
102 tr '\n' '\000' < $filename.list | xargs -r0 rm || true | |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
103 UNLINK $filename.list |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
104 rm $filename.list |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
105 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
106 |
29181 | 107 tarfail () { echo FAILED $filename ; rm $filename.list ; exit 1 ; } |
108 | |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
109 case "$filename" in |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
110 *.tar.gz) |
29181 | 111 tar xvzf $filename > $filename.list || tarfail |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
112 #rm $filename |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
113 ;; |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
114 *.tgz) |
29181 | 115 tar xvzf $filename > $filename.list || tarfail |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
116 #rm $filename |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
117 ;; |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
118 *.tar.bz2) |
29181 | 119 tar --bzip2 -xvf $filename > $filename.list || tarfail |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
120 #rm $filename |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
121 ;; |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
122 esac |
29181 | 123 [ -r $filename.bak ] && rm $filename.bak |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
124 LINK $filename.list |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
125 echo "Installed $filename Succesfully!" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
126 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
127 } |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
128 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
129 LINK () { |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
130 cd $CODECDIR/ |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
131 cat $CODECDIR/mplayer_binary_codecs/$1 | while read f ; do |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
132 ln -sbf mplayer_binary_codecs/"$f" . |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
133 done |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
134 } |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
135 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
136 UNLINK () { |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
137 ### FIXME |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
138 # cd $CODECDIR |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
139 # cat $CODECDIR/mplayer_binary_codecs/$1 | while f do |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
140 # ln -sbf mplayer_binary_codecs/"$f" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
141 # done |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
142 if which symlinks > /dev/null ; then |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
143 symlinks -d $CODECDIR |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
144 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
145 } |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
146 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
147 if [ `whoami` != root ]; then |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
148 echo "You must be 'root' to use this script. Login as root first!" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
149 exit 1 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
150 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
151 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
152 case "$1" in |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
153 install) |
29184 | 154 if test -x /bin/bzip2 || test -x /usr/bin/bzip2 ; then : ; else |
29181 | 155 echo You need to install bzip2 |
156 exit 1 | |
157 fi | |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
158 choosemirror |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
159 cd $PREFDIR |
29182 | 160 #if [ ! -r codecs_list ] || find codecs_list -mtime +20 ; then |
29185 | 161 echo "Getting codecs list" |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
162 wget -nv -c -N $MYSITE/codecs_list || true |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
163 #fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
164 |
29187
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
165 cd $PREFDIR |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
166 echo Downloading MD5 sums from main site |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
167 [ -r MD5SUMS ] && mv MD5SUMS MD5SUMS.bak |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
168 if wget -nv -N http://www.mplayerhq.hu/MPlayer/releases/codecs/MD5SUMS ; then |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
169 [ -r MD5SUMS.bak ] && rm MD5SUMS.bak |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
170 else |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
171 echo "failed" |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
172 if [ -r MD5SUMS.bak ] ; then |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
173 echo "trying to use backup" |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
174 mv MD5SUMS.bak MD5SUMS |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
175 fi |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
176 fi |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
177 |
e227d7137dc0
commit remaining binary_codecs.sh changes from debian.
siretart
parents:
29186
diff
changeset
|
178 if grep -q "^$dpkgarch" $PREFDIR/codecs_list ; then |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
179 egrep -v "^[[:space:]]*(#|$)" $PREFDIR/codecs_list | \ |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
180 while read arch url dir file info ; do |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
181 if [ "$dpkgarch" = "$arch" ]; then |
29182 | 182 echo Downloading and installing $file $info... |
29179 | 183 INSTALL "$url" "$dir" "$file" |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
184 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
185 done |
29186 | 186 needlibstd=no |
187 test "$dpkgarch" = "powerpc" && needlibstd=yes | |
188 test "$dpkgarch" = "i386" && needlibstd=yes | |
189 if test "$needlibstd" = "yes" && ! test -r /usr/lib/libstdc++.so.5 ; then | |
190 echo "Warning: you need to install libstdc++ 5 libraries" | |
191 echo -n "Do it now? " | |
192 read R | |
193 case $R in | |
194 y*) apt-get install libstdc++5 ;; | |
195 *) echo "If you change your mind, use the command" | |
196 echo " apt-get install libstdc++5" ;; | |
197 esac | |
198 fi | |
27351
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
199 else |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
200 echo "Sorry, no codecs for your arch '$dpkgarch'. Sorry dude :(" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
201 exit 1 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
202 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
203 ;; |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
204 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
205 uninstall) |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
206 cd $CODECDIR/ |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
207 rm -rf mplayer_binary_codecs |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
208 #FIXME we need a better clean system |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
209 if which symlinks > /dev/null ; then |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
210 symlinks -d . |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
211 else |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
212 echo "please install the package 'symlinks' and run 'symlinks -d $CODECDIR' " |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
213 fi |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
214 echo "Uninstalled Succesfully!" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
215 ;; |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
216 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
217 *) |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
218 echo "Usage: {install|uninstall}" |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
219 echo "This program will install binary codecs for MPlayer." |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
220 exit 1 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
221 ;; |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
222 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
223 esac |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
224 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
225 |
4f0fa46528ff
Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff
changeset
|
226 exit 0 |