Mercurial > mplayer.hg
annotate TOOLS/install-w32codecs.sh @ 18171:6019c54e3b11
1.260: 10l
1.259: syntax fix for "s" (keyboard control)
1.258: minor markup fixes
author | kraymer |
---|---|
date | Fri, 21 Apr 2006 10:54:00 +0000 |
parents | 1e2056c6bd74 |
children | c53da7ea44a0 |
rev | line source |
---|---|
15586 | 1 #!/bin/sh |
2 | |
3 # Author: thuglife, mennucc1 | |
4 # | |
5 | |
6 set -e | |
7 | |
8 arch=$(dpkg --print-installation-architecture) | |
9 | |
15592
aadde9ec9058
Add a variable for the codec directory and set it to /usr/lib/codecs instead
diego
parents:
15586
diff
changeset
|
10 codecsdir=/usr/lib/codecs |
aadde9ec9058
Add a variable for the codec directory and set it to /usr/lib/codecs instead
diego
parents:
15586
diff
changeset
|
11 |
aadde9ec9058
Add a variable for the codec directory and set it to /usr/lib/codecs instead
diego
parents:
15586
diff
changeset
|
12 [ -d $codecsdir ] || mkdir -v $codecsdir |
aadde9ec9058
Add a variable for the codec directory and set it to /usr/lib/codecs instead
diego
parents:
15586
diff
changeset
|
13 cd $codecsdir |
15586 | 14 [ -d mplayer_win32_codecs ] || mkdir -v mplayer_win32_codecs |
15 | |
16 INSTALL () { | |
17 filename="$1" | |
18 site="$2" | |
19 url="$site/$filename" | |
20 | |
15592
aadde9ec9058
Add a variable for the codec directory and set it to /usr/lib/codecs instead
diego
parents:
15586
diff
changeset
|
21 cd $codecsdir/mplayer_win32_codecs |
15586 | 22 |
23 if [ -r $filename.list ] ; then | |
24 #if we stop the script, we don't want to redownload things | |
25 #fixme we should check timestamps | |
15704 | 26 echo You have already downloaded and installed $filename. |
15586 | 27 else |
28 wget $url || return 1 | |
29 case "$filename" in | |
30 *.tar.gz) | |
31 tar xvzf $filename > $filename.list | |
32 rm $filename | |
33 ;; | |
34 *.tgz) | |
35 tar xvzf $filename > $filename.list | |
36 rm $filename | |
37 ;; | |
38 *.tar.bz2) | |
39 tar --bzip2 -xvf $filename > $filename.list | |
40 rm $filename | |
41 ;; | |
42 esac | |
43 cd .. | |
44 ln -sbf mplayer_win32_codecs/*/* . | |
45 echo "Installed Succesfully!" | |
46 fi | |
47 } | |
48 | |
49 | |
50 if [ `whoami` != root ]; then | |
15704 | 51 echo "You must be root to start this script. Login as root first!" |
15586 | 52 exit 1 |
53 else | |
54 | |
55 case "$1" in | |
56 install) | |
57 if [ "$arch" = "i386" ]; then | |
58 | |
59 mainurl='' | |
60 | |
15592
aadde9ec9058
Add a variable for the codec directory and set it to /usr/lib/codecs instead
diego
parents:
15586
diff
changeset
|
61 pref=$codecsdir/mplayer_win32_codecs/bestsite |
15586 | 62 |
63 #distribute the load | |
64 if [ -r $pref ] ; then | |
65 mainurl=`cat $pref ` | |
66 else | |
67 if [ -f /usr/bin/netselect ] ; then | |
68 echo Choosing best mirror using netselect.... | |
69 /usr/bin/netselect \ | |
70 http://www1.mplayerhq.hu/MPlayer/releases/codecs/ \ | |
71 http://www2.mplayerhq.hu/MPlayer/releases/codecs/ \ | |
72 http://ftp.lug.udel.edu/MPlayer/releases/codecs/ \ | |
73 | awk '{print $2}' > $pref | |
74 mainurl=`cat $pref ` | |
75 else | |
15704 | 76 echo "(If you install 'netselect', it will select the best mirror for you." |
77 echo " You may wish to stop this script and rerun after installation.)" | |
15586 | 78 sleep 2 |
79 fi | |
80 fi | |
81 | |
82 #sanity check, in case netselect fails | |
83 mainhost=`echo $mainurl | sed 's|http://||;s|ftp://||;s|/.*||g'` | |
84 echo Test if $mainhost exists and is ping-able... | |
85 if [ "$mainurl" = '' ] || ! ping -c1 "$mainhost" > /dev/null ; then | |
86 domain=`hostname -f | sed 's/.*\.//g' ` | |
87 mainurl=http://www1.mplayerhq.hu/MPlayer/releases/codecs/ | |
88 if [ "$domain" = 'edu' -o "$domain" = 'com' ] ; then | |
89 mainurl=http://ftp.lug.udel.edu/MPlayer/releases/codecs/ | |
90 fi | |
91 if [ "$domain" = 'de' -o "$domain" = 'it' ] ; then | |
92 mainurl=http://www2.mplayerhq.hu/MPlayer/releases/codecs/ | |
93 fi | |
94 fi | |
95 | |
96 #INSTALL win32.tar.gz http://ers.linuxforum.hu/ | |
97 | |
98 INSTALL win32codecs-lite.tar.bz2 $mainurl | |
99 #INSTALL w32codec.tar.bz2 http://www.mplayerhq.hu/MPlayer/releases/ | |
100 INSTALL rp9codecs.tar.bz2 $mainurl | |
101 INSTALL qt6dlls.tar.bz2 $mainurl | |
102 elif [ "$arch" = "alpha" ]; then | |
103 INSTALL rp8codecs-alpha.tar.bz2 $mainurl | |
104 elif [ "$arch" = "powerpc" ]; then | |
105 INSTALL rp8codecs-ppc.tar.bz2 $mainurl | |
106 INSTALL xanimdlls-ppc.tar.bz2 $mainurl | |
107 else | |
108 echo "Sorry, no codecs for your arch. Sorry dude :(" | |
109 exit 1 | |
110 | |
111 fi | |
112 | |
113 ;; | |
114 | |
115 uninstall) | |
15592
aadde9ec9058
Add a variable for the codec directory and set it to /usr/lib/codecs instead
diego
parents:
15586
diff
changeset
|
116 cd $codecsdir |
15586 | 117 rm -rf mplayer_win32_codecs |
118 #FIXME we need a better clean system | |
119 if [ -r /usr/bin/symlinks ] ; then | |
120 symlinks -d . | |
121 else | |
15704 | 122 echo "Please install the package 'symlinks' and run 'symlinks -d $codecsdir'." |
15586 | 123 fi |
124 echo "Uninstalled Succesfully!" | |
125 | |
126 ;; | |
127 | |
128 *) | |
129 echo "Usage: {install|uninstall}" | |
130 exit 1 | |
131 | |
132 ;; | |
133 | |
134 esac | |
135 | |
136 | |
137 exit 0 | |
138 | |
139 fi | |
140 |