Statistics
| Branch: | Revision:

chunker-player / build_ul.sh @ 0e85a031

History | View | Annotate | Download (13.8 KB)

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