9 # Fail early if environment not set
10 [ -z "$BUILD_ARCHIVE_NAME" ] && fail "BUILD_ARCHIVE_NAME has to be set"
11 [ -z "$BUILD_PARALLEL_THREADS" ] && fail "BUILD_PARALLEL_THREADS has to be set"
13 # Clean and enter shadow build folder
15 if [ -e ../build ]; then
16 rm -Rf ../build || fail "Could not delete ../build"
19 mkdir ../build || fail "Could not create ../build"
20 cd ../build || fail "Could not enter ../build"
24 cmake -G "Unix Makefiles" -A x64 -DCMAKE_BUILD_TYPE=RelWithDebInfo .. || fail "cmake failed"
26 # Run make using the number of hardware threads in BUILD_PARALLEL_THREADS
28 /usr/bin/time -f 'Build time %E' make -j$BUILD_PARALLEL_THREADS || fail "make failed"
30 # Create client folder to later zip
31 export SERVER_FOLDER="$BUILD_ARCHIVE_NAME"
32 if [ -f "$SERVER_FOLDER" ]; then
33 rm -Rf "$SERVER_FOLDER" || fail "Could not delete $SERVER_FOLDER"
35 mkdir "$SERVER_FOLDER" || fail "Could not create $SERVER_FOLDER"
36 mkdir "$SERVER_FOLDER/bin" || fail "Could not create $SERVER_FOLDER/bin"
37 mkdir "$SERVER_FOLDER/lib" || fail "Could not create $SERVER_FOLDER/lib"
39 # Copy compiled binaries
40 echo Copying binaries...
41 cp -f shell/lib* "$SERVER_FOLDER/lib/" || fail "Could not copy server libraries"
42 cp -f shell/*.ttf "$SERVER_FOLDER/" || fail "Could not copy font(s)"
43 cp -f shell/casparcg "$SERVER_FOLDER/bin/" || fail "Could not copy server executable"
44 cp -f shell/casparcg.config "$SERVER_FOLDER/" || fail "Could not copy server config"
45 cp -Rf shell/locales "$SERVER_FOLDER/bin/" || fail "Could not copy server CEF locales"
47 # Copy binary dependencies
48 echo Copying binary dependencies...
49 cp -Rf ../deploy/linux/* "$SERVER_FOLDER/" || fail "Could not copy binary dependencies"
50 cp -f ../deploy/general/*.pdf "$SERVER_FOLDER/" || fail "Could not copy pdf"
51 cp -Rf ../deploy/general/wallpapers "$SERVER_FOLDER/" || fail "Could not copy wallpapers"
52 cp -Rf ../deploy/general/server/media "$SERVER_FOLDER/" || fail "Could not copy media"
55 echo Copying documentation...
56 cp -f ../CHANGES.txt "$SERVER_FOLDER/" || fail "Could not copy CHANGES.txt"
57 cp -f ../README.txt "$SERVER_FOLDER/" || fail "Could not copy README.txt"
58 cp -f ../LICENSE.txt "$SERVER_FOLDER/" || fail "Could not copy LICENSE.txt"
61 echo Creating tag.gz...
62 tar -cvzf "$BUILD_ARCHIVE_NAME.tar.gz" "$SERVER_FOLDER" || fail "Could not create archive"