Statistics
| Branch: | Revision:

chunker-player / build_ul.sh @ f5887924

History | View | Annotate | Download (13.7 KB)

1 1538a3bd GiuseppeTropea
#!/bin/bash
2
SCRIPT=$(readlink -f $0)
3
BASE_UL_DIR=`dirname $SCRIPT`
4
EXTERN_DIR="external_libs"
5 e4ef5ca5 CsabaKiraly
MAKE="make -j 4"
6 1538a3bd GiuseppeTropea
cd "$BASE_UL_DIR"
7
8 920851bb GiuseppeTropea
#by default build an check
9
BUILD_ALL=1
10
11 870d410a GiuseppeTropea
LIBTOOLIZE_PATH=`whereis -b libtoolize`
12
if [ "$LIBTOOLIZE_PATH" = "libtoolize:" ]; then
13
	echo "Can't find libtoolize. Try sudo apt-get install libtool"
14
	exit
15
fi
16
17 d06e13db GiuseppeTropea
YASM_PATH=`whereis -b yasm`
18
if [ "$YASM_PATH" = "yasm:" ]; then
19
	echo "Can't find yasm assembler. Try sudo apt-get install yasm"
20
	exit
21
fi
22
23 9f668f32 GiuseppeTropea
#try to find libbz2 in your system
24 870d410a GiuseppeTropea
LOCAL_BZ2_A=`locate -l 1 libbz2.a`
25 920851bb GiuseppeTropea
if [ "$LOCAL_BZ2_A" = "" ]; then
26
	if [ -f "/usr/lib/libbz2.a" ]; then
27
		echo "You have file libbz2.a in default system"
28
		echo "setting path for it to default /usr/lib/libbz2.a"
29
		LOCAL_BZ2="/usr"
30
	else
31
		echo "you seem not to have file libbz2.a. Will be built locally."
32
		BUILD_BZ2=1
33
	fi
34 9f668f32 GiuseppeTropea
else
35 920851bb GiuseppeTropea
	LOCAL_BZ2=`dirname $LOCAL_BZ2_A`/..
36 6cd14f65 GiuseppeTropea
	if [ ! -e "$LOCAL_BZ2/lib/libbz2.a" ]; then
37
		#wrong location and/or folders structure
38
		LOCAL_BZ2=""
39
		BUILD_BZ2=1
40
	fi
41 920851bb GiuseppeTropea
fi
42
43
#try to find libz in your system
44
LOCAL_Z_A=`locate -l 1 libz.a`
45
if [ "$LOCAL_Z_A" = "" ]; then
46
	if [ -f "/usr/lib/libz.a" ]; then
47
		echo "You have file libz.a in default system"
48
		echo "setting path for it to default /usr/lib/libz.a"
49
		LOCAL_Z="/usr"
50
	else
51
		echo "you seem not to have file libz.a. Will be built locally."
52
		BUILD_Z=1
53
	fi
54
else
55
	LOCAL_Z=`dirname $LOCAL_Z_A`/..
56 6cd14f65 GiuseppeTropea
	if [ ! -e "$LOCAL_Z/lib/libz.a" ]; then
57
		#wrong location and/or folders structure
58
		LOCAL_Z=""
59
		BUILD_Z=1
60
	fi
61 1538a3bd GiuseppeTropea
fi
62
63 ff3fddf2 GiuseppeTropea
#clean all external libraries if CLEAN_EXTERNAL_BUILD=1
64 1538a3bd GiuseppeTropea
if [ -n "$CLEAN_EXTERNAL_BUILD" ]; then
65
	#remove previuos versions of external libs builds
66
	rm -r -f $EXTERN_DIR
67
fi
68
69 a046bebf GiuseppeTropea
mkdir $EXTERN_DIR
70
71 920851bb GiuseppeTropea
TEMP_BZ2="$BASE_UL_DIR/$EXTERN_DIR/bzip2/temp_bzip2_install"
72
if [ -n "$BUILD_BZ2" ]; then
73
	#we have to build it either because of user will or because does not exist system wide
74
	if [ -z "$LOCAL_BZ2" ]; then
75
		#does not exist systemwide
76
		if [ -n "$BUILD_ALL" -a ! -e "$TEMP_BZ2" ]; then
77
			#we erase and rebuild since the installation is not there
78
			cd "$BASE_UL_DIR/$EXTERN_DIR"
79
			rm -r -f bzip2
80
			rm -f bzip2-1.0.5.tar.gz
81
			#get and compile latest bzip2 library
82
			wget http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz; tar xzf bzip2-1.0.5.tar.gz; mv bzip2-1.0.5 bzip2
83
			cd bzip2
84
			#make and install in local folder
85
			$MAKE; $MAKE install PREFIX="$TEMP_BZ2"
86
		fi
87
		#previous local install is existing, just set pointer to it
88
		#or override location if it was set as systemwide
89
		LOCAL_BZ2=$TEMP_BZ2
90
	fi
91
fi
92
93
TEMP_Z="$BASE_UL_DIR/$EXTERN_DIR/zlib/temp_zlib_install"
94
if [ -n "$BUILD_Z" ]; then
95
	#we have to build it either because of user will or because does not exist system wide
96
	if [ -z "$LOCAL_Z" ]; then
97
		#does not exist systemwide
98
		if [ -n "$BUILD_ALL" -a ! -e "$TEMP_Z" ]; then
99
			cd "$BASE_UL_DIR/$EXTERN_DIR"
100
			rm -r -f zlib
101
			rm -f zlib-1.2.5.tar.gz
102
			#get and compile latest zlib library
103
			wget http://zlib.net/zlib-1.2.5.tar.gz; tar xzf zlib-1.2.5.tar.gz; mv zlib-1.2.5 zlib
104
			cd zlib
105
			#make and install in local folder
106
			./configure --prefix="$TEMP_Z"
107
			$MAKE; $MAKE install
108
		fi
109
		#previous local install is existing, just set pointer to it
110
		#or override location if it was set as systemwide
111
		LOCAL_Z=$TEMP_Z
112
	fi
113
fi
114
115
TEMP_X264="$BASE_UL_DIR/$EXTERN_DIR/x264/temp_x264_install"
116
if [ -n "$BUILD_X264" ] || [ -n "$BUILD_ALL" -a ! -e "$TEMP_X264" ]; then
117 1538a3bd GiuseppeTropea
	cd "$BASE_UL_DIR/$EXTERN_DIR"
118 ff3fddf2 GiuseppeTropea
	rm -r -f x264
119
	#get and compile latest x264 library
120 1538a3bd GiuseppeTropea
	git clone git://git.videolan.org/x264.git
121
	cd x264
122 920851bb GiuseppeTropea
	#make and install in local folder
123
	./configure --prefix="$TEMP_X264"
124 e4ef5ca5 CsabaKiraly
	$MAKE; $MAKE install
125 9f668f32 GiuseppeTropea
fi
126
127 920851bb GiuseppeTropea
TEMP_MP3LAME="$BASE_UL_DIR/$EXTERN_DIR/mp3lame/temp_mp3lame_install"
128
if [ -n "$BUILD_MP3LAME" ] || [ -n "$BUILD_ALL" -a ! -e "$TEMP_MP3LAME" ]; then
129 9f668f32 GiuseppeTropea
	cd "$BASE_UL_DIR/$EXTERN_DIR"
130
	rm -r -f mp3lame
131
	#get and compile latest mp3lame library
132
	rm -f lame-3.98.4.tar.gz
133
	wget http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz/download; tar xzf lame-3.98.4.tar.gz; mv lame-3.98.4 mp3lame;
134
	cd mp3lame
135 920851bb GiuseppeTropea
	#make and install in local folder
136
	./configure --disable-gtktest --disable-frontend --prefix="$TEMP_MP3LAME"
137 e4ef5ca5 CsabaKiraly
	$MAKE; $MAKE install
138 1538a3bd GiuseppeTropea
fi
139
140 920851bb GiuseppeTropea
TEMP_FFMPEG="$BASE_UL_DIR/$EXTERN_DIR/ffmpeg/temp_ffmpeg_install"
141
if [ ! -e "$TEMP_X264/lib/libx264.a" ] || [ ! -e "$TEMP_MP3LAME/lib/libmp3lame.a" ] || [ ! -e "$LOCAL_Z/lib/libz.a" ] || [ ! -e "$LOCAL_BZ2/lib/libbz2.a" ]; then
142
	echo "Compilation of ffmpeg dependancies failed. Check your internet connection and errors. Exiting."
143
fi
144
if [ -n "$BUILD_FFMPEG" ] || [ -n "$BUILD_ALL" -a ! -e "$TEMP_FFMPEG" ]; then
145 1538a3bd GiuseppeTropea
	cd "$BASE_UL_DIR/$EXTERN_DIR"
146 ff3fddf2 GiuseppeTropea
	rm -r -f ffmpeg
147 1538a3bd GiuseppeTropea
	#get and compile ffmpeg with x264 support
148 ff3fddf2 GiuseppeTropea
	#get latest snapshot
149 c3ccd8f0 GiuseppeTropea
	#rm -f ffmpeg-checkout-snapshot.tar.bz2
150
	#wget http://ffmpeg.org/releases/ffmpeg-checkout-snapshot.tar.bz2; tar xjf ffmpeg-checkout-snapshot.tar.bz2; mv ffmpeg-checkout-20* ffmpeg
151
	#do not get latest snapshot
152
	#get a release tarball instead
153
	rm -f ffmpeg-0.6.tar.bz2
154
	wget http://ffmpeg.org/releases/ffmpeg-0.6.tar.bz2; tar xjf ffmpeg-0.6.tar.bz2; mv ffmpeg-0.6 ffmpeg
155
	#svn -r 21010 checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
156 ff3fddf2 GiuseppeTropea
	#do not get latest snapshot
157
	#get instead a specific one because allows output video rate resampling
158
	#svn -r 21010 checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
159 1538a3bd GiuseppeTropea
	cd ffmpeg
160 920851bb GiuseppeTropea
	./configure --enable-gpl --enable-nonfree --enable-version3 --enable-libmp3lame --enable-libx264 --enable-pthreads --extra-cflags="-I../x264/temp_x264_install/include -I../mp3lame/temp_mp3lame_install/include -I$LOCAL_BZ2/include  -I$LOCAL_Z/include" --extra-ldflags="-L../x264/temp_x264_install/lib -L../mp3lame/temp_mp3lame_install/lib -L$LOCAL_BZ2/lib -L$LOCAL_Z/lib" --disable-doc --disable-ffplay --disable-ffprobe --disable-ffserver --prefix="$TEMP_FFMPEG"
161 c3ccd8f0 GiuseppeTropea
	$MAKE; $MAKE install
162 1538a3bd GiuseppeTropea
fi
163
164 920851bb GiuseppeTropea
TEMP_MHD="$BASE_UL_DIR/$EXTERN_DIR/libmicrohttpd/temp_mhd_install"
165
if [ -n "$BUILD_MHD" ] || [ -n "$BUILD_ALL" -a ! -e "$TEMP_MHD" ]; then
166 1538a3bd GiuseppeTropea
	cd "$BASE_UL_DIR/$EXTERN_DIR"
167 ff3fddf2 GiuseppeTropea
	rm -r -f libmicrohttpd
168 1538a3bd GiuseppeTropea
	#get and compile libmicrohttpd lib
169 1ce8a1ab GiuseppeTropea
	svn --non-interactive checkout https://ng.gnunet.org/svn/libmicrohttpd
170 1538a3bd GiuseppeTropea
	cd libmicrohttpd
171
	autoreconf -fi
172 920851bb GiuseppeTropea
	./configure --disable-curl --disable-https --enable-messages --disable-client-side --prefix="$TEMP_MHD"
173 e4ef5ca5 CsabaKiraly
	$MAKE; $MAKE install
174 1538a3bd GiuseppeTropea
fi
175
176 920851bb GiuseppeTropea
TEMP_SDL="$BASE_UL_DIR/$EXTERN_DIR/sdl/temp_sdl_install"
177
if [ -n "$BUILD_SDL" ] || [ -n "$BUILD_ALL" -a ! -e "$TEMP_SDL" ]; then
178 1538a3bd GiuseppeTropea
	cd "$BASE_UL_DIR/$EXTERN_DIR"
179 9f668f32 GiuseppeTropea
	rm -r -r sdl
180 1538a3bd GiuseppeTropea
	#get and compile SDL lib
181 e27711c4 GiuseppeTropea
	rm -f SDL-1.2.14.tar.gz
182 9f668f32 GiuseppeTropea
	wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz; tar xzf SDL-1.2.14.tar.gz; mv SDL-1.2.14 sdl
183
	cd sdl
184 920851bb GiuseppeTropea
	#make and install in local folder
185
	./configure --disable-video-directfb --prefix="$TEMP_SDL"
186 e4ef5ca5 CsabaKiraly
	$MAKE; $MAKE install
187 1538a3bd GiuseppeTropea
fi
188
189 920851bb GiuseppeTropea
if [ -n "$BUILD_SDLIMAGE" ] || [ -n "$BUILD_ALL" -a ! -e "$TEMP_SDL/lib/libSDL_image.a" ]; then
190 e27711c4 GiuseppeTropea
	cd "$BASE_UL_DIR/$EXTERN_DIR"
191 9f668f32 GiuseppeTropea
	rm -r -r sdlimage
192 e27711c4 GiuseppeTropea
	#get and compile SDLIMAGE lib
193
	rm -f SDL_image-1.2.10.tar.gz
194 9f668f32 GiuseppeTropea
	wget http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.10.tar.gz; tar xzf SDL_image-1.2.10.tar.gz; mv SDL_image-1.2.10 sdlimage
195
	cd sdlimage
196 920851bb GiuseppeTropea
	#make and install in local SDL folder
197
	./configure --prefix="$TEMP_SDL"
198 e4ef5ca5 CsabaKiraly
	$MAKE; $MAKE install
199 e27711c4 GiuseppeTropea
fi
200
201 14d0fa53 GiuseppeTropea
# SDL_ttf depends on freetype
202 920851bb GiuseppeTropea
TEMP_FREETYPE="$BASE_UL_DIR/$EXTERN_DIR/freetype/temp_freetype_install"
203
if [ -n "$BUILD_FREETYPE" ] || [ -n "$BUILD_ALL" -a ! -e "$TEMP_FREETYPE" ]; then
204 fc014e26 GiuseppeTropea
	cd "$BASE_UL_DIR/$EXTERN_DIR"
205 14d0fa53 GiuseppeTropea
	rm -r -r freetype
206 fc014e26 GiuseppeTropea
	#get and compile SDLTTF lib
207 14d0fa53 GiuseppeTropea
	rm -f freetype-2.1.10.tar.gz
208
	wget http://mirror.lihnidos.org/GNU/savannah/freetype/freetype-2.1.10.tar.gz; tar xzf freetype-2.1.10.tar.gz; mv freetype-2.1.10 freetype
209
	cd freetype
210 920851bb GiuseppeTropea
	#make and install in local folder
211
	./configure --prefix="$TEMP_FREETYPE"
212 e4ef5ca5 CsabaKiraly
	$MAKE; $MAKE install
213 fc014e26 GiuseppeTropea
fi
214
215 920851bb GiuseppeTropea
if [ -n "$BUILD_SDLTTF" ] || [ -n "$BUILD_ALL" -a ! -e "$TEMP_SDL/lib/libSDL_ttf.a" ]; then
216 fc014e26 GiuseppeTropea
	cd "$BASE_UL_DIR/$EXTERN_DIR"
217 14d0fa53 GiuseppeTropea
	rm -r -r sdlttf
218 fc014e26 GiuseppeTropea
	#get and compile SDLTTF lib
219 14d0fa53 GiuseppeTropea
	rm -f SDL_ttf-2.0.10.tar.gz
220
	wget http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.10.tar.gz; tar xzf SDL_ttf-2.0.10.tar.gz; mv SDL_ttf-2.0.10 sdlttf
221
	cd sdlttf
222 920851bb GiuseppeTropea
	#make and install in local SDL folder
223
	./configure --with-freetype-prefix="$TEMP_FREETYPE" --with-sdl-prefix="$TEMP_SDL" --prefix="$TEMP_SDL"
224 e4ef5ca5 CsabaKiraly
	$MAKE; $MAKE install
225 fc014e26 GiuseppeTropea
fi
226
227 920851bb GiuseppeTropea
TEMP_CURL="$BASE_UL_DIR/$EXTERN_DIR/curl/temp_curl_install"
228
if [ -n "$BUILD_CURL" ] || [ -n "$BUILD_ALL" -a ! -e "$TEMP_CURL" ]; then
229 e27711c4 GiuseppeTropea
	cd "$BASE_UL_DIR/$EXTERN_DIR"
230 9f668f32 GiuseppeTropea
	rm -r -r curl
231 e27711c4 GiuseppeTropea
	#get and compile CURL lib
232
	rm -f curl-7.21.0.tar.bz2
233 9f668f32 GiuseppeTropea
	wget http://curl.haxx.se/download/curl-7.21.0.tar.bz2; tar xjf curl-7.21.0.tar.bz2; mv curl-7.21.0 curl
234
	cd curl
235 920851bb GiuseppeTropea
	#make and install in local folder
236
	./configure --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --without-libssh2 --without-ssl --without-krb4 --enable-static --disable-shared --without-zlib --without-libidn --prefix="$TEMP_CURL"
237 e4ef5ca5 CsabaKiraly
	$MAKE; $MAKE install
238 e27711c4 GiuseppeTropea
fi
239
240 1538a3bd GiuseppeTropea
#set needed paths to external libraries
241
echo "-----"
242 920851bb GiuseppeTropea
LOCAL_X264=$TEMP_X264
243 1538a3bd GiuseppeTropea
echo "path for X264 dependancy set to $LOCAL_X264"
244 920851bb GiuseppeTropea
LOCAL_MP3LAME=$TEMP_MP3LAME
245 9f668f32 GiuseppeTropea
echo "path for MP3LAME dependancy set to $LOCAL_MP3LAME"
246 920851bb GiuseppeTropea
LOCAL_FFMPEG=$TEMP_FFMPEG
247 1538a3bd GiuseppeTropea
echo "path for FFMPEG dependancy set to $LOCAL_FFMPEG"
248 920851bb GiuseppeTropea
LOCAL_MHD=$TEMP_MHD
249 1538a3bd GiuseppeTropea
echo "path for LIBMICROHTTPD dependancy set to $LOCAL_MHD"
250 920851bb GiuseppeTropea
LOCAL_ABS_SDL=$TEMP_SDL
251 1538a3bd GiuseppeTropea
echo "path for SDL dependancy set to $LOCAL_ABS_SDL"
252 920851bb GiuseppeTropea
LOCAL_SDLIMAGE=$TEMP_SDL
253 e27711c4 GiuseppeTropea
echo "path for SDLIMAGE dependancy set to $LOCAL_SDLIMAGE"
254 920851bb GiuseppeTropea
LOCAL_SDLTTF=$TEMP_SDL
255 fc014e26 GiuseppeTropea
echo "path for SDLTTF dependancy set to $LOCAL_SDLTTF"
256 920851bb GiuseppeTropea
LOCAL_FREETYPE=$TEMP_FREETYPE
257 fc014e26 GiuseppeTropea
echo "path for FREETYPE dependancy set to $LOCAL_FREETYPE"
258 920851bb GiuseppeTropea
LOCAL_CURL=$TEMP_CURL
259 e27711c4 GiuseppeTropea
echo "path for CURL dependancy set to $LOCAL_CURL"
260 1538a3bd GiuseppeTropea
261
echo "path for BZ2 dependancy is set to $LOCAL_BZ2"
262 920851bb GiuseppeTropea
echo "path for ZLIB dependancy is set to $LOCAL_Z"
263 1538a3bd GiuseppeTropea
echo "-----"
264
265
#compile the UL external applications
266 920851bb GiuseppeTropea
#chunker_streamer and chunker_player
267 e27711c4 GiuseppeTropea
if [ -d "$BASE_UL_DIR/../../3RDPARTY-LIBS/libconfuse" ]; then
268 920851bb GiuseppeTropea
	LOCAL_CONFUSE="$BASE_UL_DIR/../../3RDPARTY-LIBS/libconfuse"
269
	echo "found LIBCONFUSE in $LOCAL_CONFUSE"
270 e27711c4 GiuseppeTropea
else
271 920851bb GiuseppeTropea
	LOCAL_CONFUSE_A=`locate -l 1 libconfuse.a`
272
	if [ "$LOCAL_CONFUSE_A" = "" ]; then
273
		if [ -f "/usr/lib/libconfuse.a" ]; then
274
			echo "You have file libconfuse.a in default system"
275
			echo "setting path for it to default /usr/lib/libconfuse.a"
276
			LOCAL_CONFUSE="/usr"
277
		else
278
			echo "you seem not to have file libconfuse.a. EXITING."
279
			exit
280
		fi
281 9f668f32 GiuseppeTropea
	else
282 920851bb GiuseppeTropea
		LOCAL_CONFUSE=`dirname $LOCAL_CONFUSE_A`/..
283 e27711c4 GiuseppeTropea
	fi
284
fi
285 920851bb GiuseppeTropea
286
#CHUNKER_STREAMER
287
echo "----------------COMPILING CHUNKER STREAMER"
288
cd "$BASE_UL_DIR"
289
cd chunker_streamer
290 e4ef5ca5 CsabaKiraly
$MAKE clean
291 920851bb GiuseppeTropea
LOCAL_X264=$LOCAL_X264 LOCAL_MP3LAME=$LOCAL_MP3LAME LOCAL_FFMPEG=$LOCAL_FFMPEG LOCAL_BZ2=$LOCAL_BZ2 LOCAL_Z=$LOCAL_Z LOCAL_CONFUSE=$LOCAL_CONFUSE LOCAL_CURL=$LOCAL_CURL $MAKE
292 e27711c4 GiuseppeTropea
echo "----------------FINISHED COMPILING CHUNKER STREAMER"
293 920851bb GiuseppeTropea
294 e27711c4 GiuseppeTropea
#CHUNKER_PLAYER
295
echo "----------------COMPILING CHUNKER PLAYER"
296 1538a3bd GiuseppeTropea
cd "$BASE_UL_DIR"
297
cd chunker_player
298 e4ef5ca5 CsabaKiraly
$MAKE clean
299 920851bb GiuseppeTropea
LOCAL_X264=$LOCAL_X264 LOCAL_MP3LAME=$LOCAL_MP3LAME LOCAL_FFMPEG=$LOCAL_FFMPEG LOCAL_BZ2=$LOCAL_BZ2 LOCAL_Z=$LOCAL_Z LOCAL_CONFUSE=$LOCAL_CONFUSE LOCAL_MHD=$LOCAL_MHD LOCAL_ABS_SDL=$LOCAL_ABS_SDL LOCAL_SDLIMAGE=$LOCAL_SDLIMAGE LOCAL_FREETYPE=$LOCAL_FREETYPE LOCAL_SDLTTF=$LOCAL_SDLTTF $MAKE
300 e27711c4 GiuseppeTropea
echo "----------------FINISHED COMPILING CHUNKER PLAYER"
301 1538a3bd GiuseppeTropea
302
#compile a version of offerstreamer with UL enabled
303 ff3fddf2 GiuseppeTropea
#static needs fix??
304 1538a3bd GiuseppeTropea
cd "$BASE_UL_DIR/../OfferStreamer"
305 9f668f32 GiuseppeTropea
if [ -d "$BASE_UL_DIR/../../3RDPARTY-LIBS/libevent" ]; then
306 920851bb GiuseppeTropea
	LOCAL_EVENT="$BASE_UL_DIR/../../3RDPARTY-LIBS/libevent"
307
	echo "found LIBEVENT in $LOCAL_EVENT"
308 9f668f32 GiuseppeTropea
else
309 920851bb GiuseppeTropea
	LOCAL_EVENT_A=`locate -l 1 libevent.a`
310
	if [ "$LOCAL_EVENT_A" = "" ]; then
311
		if [ -f "/usr/lib/libevent.a" ]; then
312
			echo "You have file libevent.a in default system"
313
			echo "setting path for it to default /usr/lib/libevent.a"
314
			LOCAL_EVENT="/usr"
315
		else
316
			echo "you seem not to have file libevent.a. EXITING."
317
			exit
318
		fi
319 9f668f32 GiuseppeTropea
	else
320 920851bb GiuseppeTropea
		LOCAL_EVENT=`dirname $LOCAL_EVENT_A`/..
321 9f668f32 GiuseppeTropea
	fi
322
fi
323 920851bb GiuseppeTropea
$MAKE clean
324 fbfb34fe GiuseppeTropea
ULPLAYER=$BASE_UL_DIR ULPLAYER_EXTERNAL_LIBS=$EXTERN_DIR LIBEVENT_DIR=$LOCAL_EVENT ML=1 STATIC=1 MONL=$MONL IO=$IO DEBUG= THREADS=$THREADS $MAKE
325 f5887924 GiuseppeTropea
326
#check if all is ok
327
echo "============== RESULTS ==================="
328
329
cd "$BASE_UL_DIR/chunker_streamer"
330
if [ -f "chunker_streamer" ]; then
331
	echo "chunker_streamer OK"
332
	C_STREAMER_EXE=`ls -la chunker_streamer`
333
	echo "$C_STREAMER_EXE"
334
	#now we want the bare name
335
	C_STREAMER_EXE=`ls chunker_streamer`
336
else
337
	echo "chunker_streamer FAIL"
338
fi
339
340
cd "$BASE_UL_DIR/chunker_player"
341
if [ -f "chunker_player" ]; then
342
	echo "chunker_player OK"
343
	C_PLAYER_EXE=`ls -la chunker_player`
344
	echo "$C_PLAYER_EXE"
345
	#now we want the bare name
346
	C_PLAYER_EXE=`ls chunker_player`
347
else
348
	echo "chunker_player FAIL"
349
fi
350
351
cd "$BASE_UL_DIR/../OfferStreamer"
352
echo "Check if the http binary is among these offerstreamers:"
353
ls -la offerstreamer* | grep -v ".o$"
354
echo "Your UL-enabled offerstreamer should be..."
355
O_TARGET_EXE=`ls offerstreamer* | grep -v ".o$" | grep $IO`
356
echo "$O_TARGET_EXE"
357
if [ -f "$O_TARGET_EXE" ]; then
358
	echo "...and i found it."
359
else
360
	echo "...but sadly it appears build FAILED!."
361
fi
362
363
#packaging for distribution
364
cd "$BASE_UL_DIR/chunker_player"
365
if [ -f "$BASE_UL_DIR/../OfferStreamer/$O_TARGET_EXE" -a -f "$C_PLAYER_EXE" ]; then
366
	echo "============== PACKAGING NAPAPLAYER ==================="
367
	rm -f -r napaplayer
368
	rm -f -r napaplayer.tar.gz
369
	mkdir napaplayer
370
	mkdir napaplayer/icons
371
	cp icons/* napaplayer/icons/
372
	cp channels.conf napaplayer/
373
	cp napalogo*.bmp napaplayer/
374
	cp *.ttf napaplayer/
375
	cp "$C_PLAYER_EXE" napaplayer/
376
	cp "$BASE_UL_DIR/../OfferStreamer/$O_TARGET_EXE" napaplayer/
377
	cd napaplayer/
378
	ln -s "$O_TARGET_EXE" ./offerstreamer
379
	cd ..
380
	tar cvfz napaplayer.tar.gz napaplayer
381
	if [ -s "napaplayer.tar.gz" ]; then
382
		#it has size>0. OK!
383
		echo "Here is your napaplayer tarball. Enjoy!"
384
		ls -la napaplayer.tar.gz
385
	else
386
		echo "Sorry something went wrong during packaging napaplayer."
387
	fi
388
else
389
	echo ""
390
	echo "Not packaging napaplayer since build failed."
391
fi
392
393
echo "Finished build UL script"