This repository has been archived by the owner on Jun 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
lib.sh
395 lines (346 loc) · 11.7 KB
/
lib.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
#!/bin/bash
##### Install Libraries #####
ERROR=0
install_libpng() {
echo " -------------- Installing libpng -------------- "
cd $DOWNDIR
rm -vrf libpng-*
wget -N ftp://ftp.simplesystems.org/pub/png/src/libpng16/$(curl -L ftp://ftp.simplesystems.org/pub/png/src/libpng16/ 2>1 | grep -E ".tar.gz$" | awk '{ print $NF }')
tar -xzf libpng-*
cd libpng-*
./configure --prefix=/usr --enable-shared || local ERROR=1
make -j$cpu || local ERROR=1
make install || local ERROR=1
ldconfig
return $ERROR
}
install_freetype() {
echo " -------------- Installing FreeType -------------- "
FREETYPE_VER="2.5.0.1" #2013-06-19
cd $DOWNDIR
rm -vrf freetype-$FREETYPE_VER
wget -N http://download.savannah.gnu.org/releases/freetype/freetype-$FREETYPE_VER.tar.gz
tar -zxvf freetype-$FREETYPE_VER.tar.gz
cd freetype-$FREETYPE_VER
./configure --prefix=/usr --enable-shared || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_libwmf() {
echo " -------------- Installing libwmf -------------- "
LIBWMF_VER="0.2.8.4" #2005-7-27
cd $DOWNDIR
rm -vrf libwmf-$LIBWMF_VER
wget -N http://downloads.sourceforge.net/project/wvware/libwmf/$LIBWMF_VER/libwmf-$LIBWMF_VER.tar.gz
tar -xvzf libwmf-$LIBWMF_VER.tar.gz
cd libwmf*
./configure --enable-shared --prefix=/usr --with-freetype=/usr/ || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_flvtool() {
echo " -------------- Installing FLVTool -------------- "
cd $DOWNDIR
rm -vrf flvtool2
git clone https://github.com/unnu/flvtool2.git flvtool2
cd flvtool2
ruby setup.rb config || local ERROR=1
ruby setup.rb setup || local ERROR=1
ruby setup.rb install || local ERROR=1
ldconfig
return $ERROR
}
install_lame() {
echo " -------------- Installing LAME -------------- "
LAME_MJVER="3.99" #2012-02-28
LAME_MNVER=".5"
cd $DOWNDIR
rm -vrf lame-$LAME_MJVER$LAME_MNVER
wget -N http://downloads.sourceforge.net/project/lame/lame/$LAME_MJVER/lame-$LAME_MJVER$LAME_MNVER.tar.gz
tar -zxvf lame-$LAME_MJVER$LAME_MNVER.tar.gz
cd lame-$LAME_MJVER$LAME_MNVER
./configure --enable-shared --prefix=/usr --enable-mp3x --enable-mp3rtp || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_codecs() {
echo " -------------- Installing Codecs -------------- "
FFMPEG_CODECS_VER="20110131"
cd $DOWNDIR
rm -vfr all-$FFMPEG_CODECS_VER
#wget -N http://mirror.ffmpeginstaller.com/source/codecs/all-$FFMPEG_CODEC_VER.tar.bz2
wget -N http://www.mplayerhq.hu/MPlayer/releases/codecs/all-$FFMPEG_CODEC_VER.tar.bz2
tar -xvjf all-$FFMPEG_CODECS_VER.tar.bz2
chown -R root.root all-$FFMPEG_CODECS_VER/
mkdir -pv /usr/lib/codecs/
/bin/cp -vrf all-$FFMPEG_CODECS_VER/* /usr/lib/codecs/
chmod -R 755 /usr/lib/codecs/
ldconfig
return $?
}
install_libogg() {
echo " -------------- Installing libogg -------------- "
LIBOGG_VER="1.3.1" #2013-05-20
cd $DOWNDIR
rm -vrf libogg-$LIBOGG_VER
wget -N http://downloads.xiph.org/releases/ogg/libogg-$LIBOGG_VER.tar.gz
tar -xvzf libogg-$LIBOGG_VER.tar.gz
cd libogg-$LIBOGG_VER
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_libvorbis() {
echo " -------------- Installing libvorbis -------------- "
LIBVORBIS_VER="1.3.3" #2012-02-03
cd $DOWNDIR
rm -vrf libvorbis-$LIBVORBIS_VER
wget -N http://downloads.xiph.org/releases/vorbis/libvorbis-$LIBVORBIS_VER.tar.gz
tar -xvzf libvorbis-$LIBVORBIS_VER.tar.gz
cd libvorbis-$LIBVORBIS_VER/
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_vorbistools() {
echo " -------------- Installing VorbisTools -------------- "
VORBISTOOLS_VER="1.4.0" #2010-03-26
cd $DOWNDIR
rm -vrf vorbis-tools-$VORBISTOOLS_VER
wget -N http://downloads.xiph.org/releases/vorbis/vorbis-tools-$VORBISTOOLS_VER.tar.gz
tar -xvzf vorbis-tools-$VORBISTOOLS_VER.tar.gz
cd vorbis-tools-$VORBISTOOLS_VER
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_libtheora() {
echo " -------------- Installing libtheora -------------- "
LIBTHEORA_VER="1.1.1" #2010-01-25
cd $DOWNDIR
rm -vrf libtheora-$LIBTHEORA_VER
wget -N http://downloads.xiph.org/releases/theora/libtheora-$LIBTHEORA_VER.tar.bz2
tar -xvjf libtheora-$LIBTHEORA_VER.tar.bz2
cd libtheora-$LIBTHEORA_VER
./configure --enable-shared --prefix=/usr --with-ogg=/usr --with-vorbis=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_openamr() {
echo " -------------- Installing OpenAMR -------------- "
OPENAMR_VER="0.1.3" #2012-02-20
cd $DOWNDIR
rm -vrf opencore-$OPENAMR_VER
wget -N http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-$OPENAMR_VER.tar.gz
tar -zxvf opencore-amr-$OPENAMR_VER.tar.gz
cd opencore-amr-$OPENAMR_VER
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_liba52() {
echo " -------------- Installing liba52 -------------- "
LIBA52_VER="0.7.4" #2002-07-27
cd $DOWNDIR
rm -rf a52dec-$LIBA52_VER
wget -N http://liba52.sourceforge.net/files/a52dec-$LIBA52_VER.tar.gz
tar -xvzf a52dec-$LIBA52_VER.tar.gz
cd a52dec-$LIBA52_VER/
./bootstrap
ARCH=`arch`
#64bit processor bug fix
if [[ $ARCH == 'x86_64' ]];then
./configure --prefix=/usr --enable-shared 'CFLAGS=-fPIC' || local ERROR=1
else
./configure --prefix=/usr --enable-shared || local ERROR=1
fi
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_facc() {
echo " -------------- Installing FACC -------------- "
FACC_VER="1.28" #2009-02-10
cd $DOWNDIR
rm -rf facc-$FACC_VER
wget -N http://downloads.sourceforge.net/project/faac/faac-src/faac-$FACC_VER/faac-$FACC_VER.tar.gz
tar -xvzf faac-$FACC_VER.tar.gz
cd faac-$FACC_VER/
sed -i 126d common/mp4v2/mpeg4ip.h
sh bootstrap
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_faad2() {
echo " -------------- Installing FAAD -------------- "
FAAD_VER="2.7" #2009-02-10
cd $DOWNDIR
rm -rf faad2-$FAAD_VER
wget -N http://downloads.sourceforge.net/faac/faad2-$FAAD_VER.tar.gz
tar -xvzf faad2-$FAAD_VER.tar.gz
cd faad2-$FAAD_VER/
sh bootstrap
./configure --enable-shared --prefix=/usr --with-mpeg4ip || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_yasm() {
echo " -------------- Installing YASM -------------- "
YASM_VER="1.2.0" #2011-10-31
cd $DOWNDIR
rm -vrf yasm-$YASM_VER
wget -N http://www.tortall.net/projects/yasm/releases/yasm-$YASM_VER.tar.gz
tar -xvzf yasm-$YASM_VER.tar.gz
cd yasm-$YASM_VER
sh autogen.sh
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_nasm() {
echo " -------------- Installing NASM -------------- "
NASM_VER="2.10.09" #2013-07-22
cd $DOWNDIR
rm -vrf nasm-$NASM_VER
wget -N http://www.nasm.us/pub/nasm/releasebuilds/$NASM_VER/nasm-$NASM_VER.tar.gz
tar -xvzf nasm-$NASM_VER.tar.gz
cd nasm-$NASM_VER
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_xvid() {
echo " -------------- Installing XVID -------------- "
cd $DOWNDIR
#need latest for MP4Box to work
rm -vrf xvid_*
wget -N http://downloads.xvid.org/downloads/xvid_latest.tar.gz
tar -xvzf xvid_latest.tar.gz
cd xvid_*/trunk/xvidcore/build/generic/
./bootstrap.sh
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_x264() {
echo " -------------- Installing x264 -------------- "
cd $DOWNDIR
rm -vrf x264
git clone http://repo.or.cz/r/x264.git x264
cd x264/
#broken centos5/32bit./configure --prefix=/usr --enable-shared --disable-asm
./configure --prefix=/usr --enable-shared || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_live555() {
echo " -------------- Installing Live555 -------------- "
cd $DOWNDIR
rm -vrf live
wget -N http://www.live555.com/liveMedia/public/live555-latest.tar.gz
tar xvf live555-latest.tar.gz
cd live
./genMakefiles linux || local ERROR=1
make -j$cpu || local ERROR=1
make install || local ERROR=1
make clean || local ERROR=1
ldconfig
return $ERROR
}
install_re2c() {
echo " -------------- Installing RE2C -------------- "
RE2C_VER="0.13.6" #2013-07-05
cd $DOWNDIR
echo "Removing old source"
rm -vrf re2c-$RE2C_VER
wget -N http://downloads.sourceforge.net/project/re2c/re2c/$RE2C_VER/re2c-$RE2C_VER.tar.gz
tar -xvzf re2c-$RE2C_VER.tar.gz
cd re2c-$RE2C_VER/
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_amrnb() {
echo " -------------- Installing AMRNB -------------- "
AMR_VER="11.0.0.0" #2013-04-05
cd $DOWNDIR
rm -vrf amrnb-$AMR_VER
wget --no-check-certificate -N ftp://ftp.penguin.cz/pub/users/utx/amr/amrnb-$AMR_VER.tar.bz2
tar -xvjf amrnb-$AMR_VER.tar.bz2
cd amrnb-$AMR_VER
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_amrwb() {
echo " -------------- Installing AMRWB -------------- "
cd $DOWNDIR
rm -vrf amrwb-$AMR_VER
wget -N ftp://ftp.penguin.cz/pub/users/utx/amr/amrwb-$AMR_VER.tar.bz2
tar -xvjf amrwb-$AMR_VER.tar.bz2
cd amrwb-$AMR_VER
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_libvpx() {
echo " -------------- Installing libvpx -------------- "
cd $DOWNDIR
rm -vrf libvpx
git clone https://chromium.googlesource.com/webm/libvpx libvpx
cd libvpx
./configure --enable-shared --prefix=/usr || local ERROR=1
make || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}
install_libasound() {
echo " -------------- Installing libasound -------------- "
cd $DOWNDIR
rm -rf alsa-lib*
wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.0.27.2.tar.bz2
tar xjf alsa-lib*
cd alsa-lib-*
./configure --enable-shared --prefix=/usr || local ERROR=1
make -j$cpu || local ERROR=1
make install $DESTDIR || local ERROR=1
ldconfig
return $ERROR
}