| 
									
										
										
										
											2019-07-17 19:37:18 +02:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BUILD_INFO=($(cat build_version.txt)) | 
					
						
							|  |  |  | BUILD_FULL_NAME=${BUILD_INFO[0]} | 
					
						
							|  |  |  | BUILD_NAME=${BUILD_INFO[1]} | 
					
						
							|  |  |  | BUILD_VERSION=${BUILD_INFO[2]} | 
					
						
							|  |  |  | BUILD_FILENAME=${BUILD_INFO[3]} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | echo "Creating TeaSpeak ${BUILD_NAME} Build index ${BUILD_VERSION}" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-11 21:37:28 +01:00
										 |  |  | if [[ -d finalenv ]]; then | 
					
						
							|  |  |  |   rm -r finalenv | 
					
						
							|  |  |  | fi | 
					
						
							| 
									
										
										
										
											2019-07-17 19:37:18 +02:00
										 |  |  | cp -r env finalenv | 
					
						
							| 
									
										
										
										
											2019-11-11 21:37:28 +01:00
										 |  |  | cd finalenv || { | 
					
						
							|  |  |  |   echo "failed to enter dir" | 
					
						
							|  |  |  |   exit 1 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-07-17 19:37:18 +02:00
										 |  |  | echo -e "# Version: ${BUILD_FULL_NAME}
 | 
					
						
							|  |  |  | # TeaSpeak version: ${BUILD_NAME} | 
					
						
							|  |  |  | # Build version: ${BUILD_VERSION} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-24 19:39:43 +01:00
										 |  |  | {\"build_name\": \"${BUILD_FULL_NAME}\", \"build_version\": \"${BUILD_NAME}\", \"build_index\": ${BUILD_VERSION}}" > buildVersion.txt
 | 
					
						
							| 
									
										
										
										
											2019-07-17 19:37:18 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #Create a copy and save unstripped | 
					
						
							|  |  |  | cp TeaSpeakServer TeaSpeakServerTmp | 
					
						
							|  |  |  | rm TeaSpeakServer | 
					
						
							|  |  |  | mv TeaSpeakServerTmp TeaSpeakServer | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-24 22:55:23 +01:00
										 |  |  | strip -s -p -v TeaSpeakServer || { echo "failed to strip symbols!"; exit 1; } | 
					
						
							|  |  |  | patchelf --set-rpath ./libs/ TeaSpeakServer || { echo "failed to set rpath!"; exit 1; } | 
					
						
							| 
									
										
										
										
											2020-01-25 16:12:18 +01:00
										 |  |  | tar --dereference -cvf - * | gzip -f -9 > "../${BUILD_FILENAME}" | 
					
						
							|  |  |  | [[ $? -ne 0 ]] && { echo "failed to package server"; exit 1; } | 
					
						
							| 
									
										
										
										
											2020-01-25 16:00:21 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-17 19:37:18 +02:00
										 |  |  | cd .. | 
					
						
							| 
									
										
										
										
											2019-11-22 21:47:16 +01:00
										 |  |  | rm -r finalenv | 
					
						
							|  |  |  | ./make_symbol.sh | 
					
						
							| 
									
										
										
										
											2019-07-17 19:37:18 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | echo "Package created (${BUILD_FILENAME})" |