summaryrefslogtreecommitdiffstats
path: root/contrib/local/make-dist.sh
blob: 9337eb0dbb877ed5b845842ed343573afa7796a9 (plain)
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
#!/bin/bash

ME=`basename $0`
DIR="$( cd "$( dirname "$0" )" && pwd )"

# do not tar ._ files
export COPY_EXTENDED_ATTRIBUTES_DISABLE=1
export COPYFILE_DISABLE=1

############################
# Compile libraries
############################

cd ${DIR}

./remove-dsstore-files.sh

echo -n "Build uscxml for Linux 32Bit? [y/N]: "; read BUILD_LINUX32
if [ "$BUILD_LINUX32" == "y" ] || [ "$BUILD_LINUX32" == "Y" ]; then
	echo "Start the Linux 32Bit system named 'debian' and press return" && read
	echo == BUILDING USCXML FOR Linux 32Bit =========================================================
	export USCXML_BUILD_HOST=debian
	expect build-linux.expect
fi

echo -n "Build uscxml for Linux 64Bit? [y/N]: "; read BUILD_LINUX64
if [ "$BUILD_LINUX64" == "y" ] || [ "$BUILD_LINUX64" == "Y" ]; then
	echo "Start the Linux 64Bit system named 'debian64' and press return" && read
	echo == BUILDING USCXML FOR Linux 64Bit =========================================================
	export USCXML_BUILD_HOST=debian64
	expect build-linux.expect
fi

# make sure to cross-compile before windows as we will copy all the files into the windows VM
# echo -n "Build uscxml for iOS? [y/N]: "; read BUILD_IOS
# if [ "$BUILD_IOS" == "y" ] || [ "$BUILD_IOS" == "Y" ]; then
# 	echo == BUILDING USCXML FOR IOS =========================================================
# 	${DIR}/../build-uscxml-ios.sh
# fi
# 
# echo -n "Build uscxml for Android? [y/N]: "; read BUILD_ANDROID
# if [ "$BUILD_ANDROID" == "y" ] || [ "$BUILD_ANDROID" == "Y" ]; then
# 	echo == BUILDING USCXML FOR Android =========================================================
# 	export ANDROID_NDK=~/Developer/SDKs/android-ndk-r8
# 	${DIR}/../build-uscxml-android.sh
# fi

echo -n "Build uscxml for Windows 32Bit? [y/N]: "; read BUILD_WIN32
if [ "$BUILD_WIN32" == "y" ] || [ "$BUILD_WIN32" == "Y" ]; then
	echo "Start the Windows 32Bit system named 'epikur-win7' and press return" && read
	echo == BUILDING USCXML FOR Windows 32Bit =========================================================
	export USCXML_BUILD_HOST=epikur-win7
	export USCXML_BUILD_ARCH=32
	# winsshd needs an xterm ..
	TERM=xterm expect build-windows.expect
fi

echo -n "Build uscxml for Windows 64Bit? [y/N]: "; read BUILD_WIN64
if [ "$BUILD_WIN64" == "y" ] || [ "$BUILD_WIN64" == "Y" ]; then
	echo "Start the Windows 64Bit system named 'epikur-win7-64' and press return" && read
	echo == BUILDING USCXML FOR Windows 64Bit =========================================================
	export USCXML_BUILD_HOST=epikur-win7-64
	export USCXML_BUILD_ARCH=64
	# winsshd needs an xterm ..
	TERM=xterm expect build-windows.expect
fi

echo -n "Build uscxml for Mac OSX? [y/N]: "; read BUILD_MAC
if [ "$BUILD_MAC" == "y" ] || [ "$BUILD_MAC" == "Y" ]; then
	echo == BUILDING USCXML FOR Mac OSX =========================================================
	rm -rf /tmp/build-uscxml
	mkdir -p /tmp/build-uscxml
	cd /tmp/build-uscxml
	cmake -DDIST_PREPARE=ON -DCMAKE_BUILD_TYPE=Debug ${DIR}/../..
	make -j2
	make -j2 java	
	cmake -DDIST_PREPARE=ON -DCMAKE_BUILD_TYPE=Release ${DIR}/../..
	make -j2
	make -j2 java	
fi

############################
# Create installers
############################

echo -n "Build packages for those platforms? [a/y/N]: "; read BUILD_PACKAGES
if [ "$BUILD_PACKAGES" == "y" ] || [ "$BUILD_PACKAGES" == "a" ]; then

	cd ${DIR}

	if [ "$BUILD_LINUX32" == "y" ] || [ "$BUILD_LINUX32" == "Y" ] || [ "$BUILD_PACKAGES" == "a" ]; then
		echo Start the Linux 32Bit system named 'debian' again && read
		echo == PACKAGING USCXML FOR Linux 32Bit =========================================================
		export USCXML_BUILD_HOST=debian
		expect package-linux.expect
	fi

	if [ "$BUILD_LINUX64" == "y" ] || [ "$BUILD_LINUX64" == "Y" ] || [ "$BUILD_PACKAGES" == "a" ]; then
		echo Start the Linux 64Bit system named 'debian64' again && read
		echo == PACKAGING USCXML FOR Linux 64Bit =========================================================
		export USCXML_BUILD_HOST=debian64
		expect package-linux.expect
 fi

	if [ "$BUILD_WIN32" == "y" ] || [ "$BUILD_WIN32" == "Y" ] || [ "$BUILD_PACKAGES" == "a" ]; then
		echo Start the Windows 32Bit system named 'epikur-win7' again && read
		echo == PACKAGING USCXML FOR Windows 32Bit =========================================================
		export USCXML_BUILD_HOST=epikur-win7
		export USCXML_BUILD_ARCH=32
		TERM=xterm expect package-windows.expect
	fi
	
	if [ "$BUILD_WIN64" == "y" ] || [ "$BUILD_WIN64" == "Y" ] || [ "$BUILD_PACKAGES" == "a" ]; then
		echo Start the Windows 64Bit system named 'epikur-win7-64' again && read
		echo == PACKAGING USCXML FOR Windows 64Bit =========================================================
		export USCXML_BUILD_HOST=epikur-win7-64
		export USCXML_BUILD_ARCH=64
		TERM=xterm expect package-windows.expect
	fi

	if [ "$BUILD_MAC" == "y" ] || [ "$BUILD_MAC" == "Y" ] || [ "$BUILD_PACKAGES" == "a" ]; then
		echo == PACKAGING USCXML FOR MacOSX =========================================================
		cd /tmp/build-uscxml
		# rerun cmake for new cpack files
		cmake -DDIST_PREPARE=ON -DCMAKE_BUILD_TYPE=Release ${DIR}/../..
		make package
		cp uscxml*darwin* ${DIR}/../../installer
		cd ${DIR}
	fi	
fi

############################
# Validate installers
############################

expect validate-installers.expect

############################
# Create ReadMe.html
############################

echo -n "Create ReadMe.html? [y/N]: "; read CREATE_README
if [ "$CREATE_README" == "y" ]; then
	./make-installer-html-table.pl ${DIR}/../../installer > ${DIR}/../../installer/ReadMe.html
fi