annotate TOOLS/install-w32codecs.sh @ 15870:210ea00004d3

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