1#!/bin/csh
2#The scripts and instructions in this package are free to use and
3#redistribute AT YOUR OWN RISK!!  Standard disclaimers apply.
4#NO WARRANTY!
5
6echo Starting $0 script.
7which wget > /dev/null || echo wget not found.  wget is required to download files from Internet.
8which wget > /dev/null || exit
9
10echo " "
11
12if ( ! -d src ) then
13	mkdir src
14endif
15
16cd src
17
18# Download and install xporthdmv
19if ( ! -f xport.zip ) then
20	echo wget http://www.w6rz.net/xport.zip
21	wget http://www.w6rz.net/xport.zip || exit
22endif
23
24unzip -u xport.zip
25echo xport.zip unzipped
26echo " "
27
28# Download  jm12.2
29#
30# Versions change often, so if it fails, just
31# change the 12.2 below to whatever is listed at
32# http://iphome.hhi.de/suehring/tml/download
33#
34#set version=12.2
35set version=16.1
36
37if ( ! -f jm$version".zip" ) then
38	echo wget http://iphome.hhi.de/suehring/tml/download/jm$version".zip"
39	wget http://iphome.hhi.de/suehring/tml/download/jm$version".zip" || echo  jm$version".zip" does not exist.  Please download it from  http://iphome.hhi.de/suehring/tml/download
40endif
41
42if ( ! -f jm$version".zip" ) then
43	set version=12.2
44	echo wget http://iphome.hhi.de/suehring/tml/download/old_jm/jm$version".zip"
45	wget http://iphome.hhi.de/suehring/tml/download/old_jm/jm$version".zip" || echo  jm$version".zip" does not exist.  Please download it from  http://iphome.hhi.de/suehring/tml/download
46endif
47
48if ( ! -f jm$version".zip" ) then
49	exit
50endif
51
52unzip -u jm$version".zip"
53echo jm$version".zip" unzipped
54echo " "
55
56if ( ! -f a52dec-0.7.4.tar.gz ) then
57	echo wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
58	wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz || echo "a52dec-0.7.4.tar.gz doesn't exist.  Please download it from  http://liba52.sourceforge.net"
59endif
60
61tar -xzf a52dec-0.7.4.tar.gz
62
63set svn=0
64which svn > /dev/null && set svn=1
65
66if ( ! $svn ) then
67	echo svn not found.  svn is required to download mplayer and ffmpeg
68	echo Press ^C within 10 seconds to cancel downloading source
69	sleep 10
70
71	echo wget http://apache.siamwebhosting.com/apr/apr-1.2.8.tar.gz
72	wget http://apache.siamwebhosting.com/apr/apr-1.2.8.tar.gz
73	gunzip apr-1.2.8.tar.gz
74	tar -xf apr-1.2.8.tar
75
76	echo wget http://apache.siamwebhosting.com/apr/apr-util-1.2.8.tar.gz
77	wget http://apache.siamwebhosting.com/apr/apr-util-1.2.8.tar.gz
78	gunzip apr-util-1.2.8.tar.gz
79	tar -xf apr-util-1.2.8.tar
80
81	echo wget http://subversion.tigris.org/downloads/subversion-1.4.3.tar.gz
82	wget http://subversion.tigris.org/downloads/subversion-1.4.3.tar.gz
83	gunzip subversion-1.4.3.tar.gz
84	tar -xf subversion-1.4.3.tar
85
86	echo svn not found.  svn is required to download mplayer and ffmpeg
87endif
88
89which svn > /dev/null || exit
90
91# Download and build the x264 encoder
92if ( ! -d x264-snapshot-20091102-2245 ) then
93	echo x264
94	wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20091102-2245.tar.bz2
95	tar -xjf x264-snapshot-20091102-2245.tar.bz2
96	echo x264 done
97	echo " "
98endif
99
100# Download and build ffmpeg
101if ( ! -d ffmpeg ) then
102	echo ffmpeg
103	which ffmpeg ||	svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
104	echo ffmpeg done
105	echo " "
106endif
107
108# Download and build mplayer
109if ( ! -d mplayer ) then
110	echo mplayer
111	which mplayer || svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
112	echo mplayer done
113	echo " "
114endif
115
116echo " "
117echo "Run the configure script to configure the downloaded software"
118echo " "
119echo The $0 script has ended.
120