forked from mop98915/avra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild
executable file
·87 lines (78 loc) · 2.4 KB
/
Build
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
#!/usr/bin/env bash
#
# AVRA Build and Release helper script
# source this in the root directory of avra and then invoke one of the
# functions to create a release. This is very hackish, but makes life easier.
VERSION="1.3.0" # Change to new version
OS_TYPE="source" # Change to linux, mingw32, apple or source
# This doesn't normaly have to be changed
ROOT_DIR="${PWD}"
BUILD_DIR="${PWD}/release"
DOC_DIR="${PWD}/doc"
EXAMPLES_DIR="${PWD}/examples"
INCLUDES_DIR="${PWD}/includes"
SOURCE_DIR="${PWD}/src"
ARCHIVE_DIR="${PWD}/archives"
MISC_FILES="ChangeLog,README,README.html,COPYING,NEWS,AUTHORS"
LINUX_BUILD="avra-${VERSION}-linux-i386-static"
SOURCE_BUILD="avra-${VERSION}-src"
function avra-build-source {
echo "Creating ${SOURCE_BUILD} release"
mkdir -p ${BUILD_DIR}/${SOURCE_BUILD}
cp -Rvf ${ROOT_DIR} ${BUILD_DIR}/${SOURCE_BUILD}
cd ${BUILD_DIR}
tar -cjvf ${SOURCE_BUILD}.tar.bz2 ${SOURCE_BUILD}/
cp ${SOURCE_BUILD}.tar.bz2 ${ARCHIVE_DIR}
cd ${ARCHIVE_DIR}
sha1sum * > ${ARCHIVE_DIR}/SHA1SUM
cd ${ROOT_DIR}
rm -R ${BUILD_DIR}
cat ${ARCHIVE_DIR}/SHA1SUM
}
function avra-build-linux {
echo "Creating ${LINUX_BUILD} release"
asciidoc README
mkdir -p ${BUILD_DIR}/${LINUX_BUILD}
mkdir -p ${ARCHIVE_DIR}
cd ${SOURCE_DIR}
make -f makefiles/Makefile.linux
cp avra ${BUILD_DIR}/${LINUX_BUILD}
make -f makefiles/Makefile.linux clean
cp -R ${DOC_DIR} ${BUILD_DIR}/${LINUX_BUILD}
cp -R ${EXAMPLES_DIR} ${BUILD_DIR}/${LINUX_BUILD}
cp -R ${INCLUDES_DIR} ${BUILD_DIR}/${LINUX_BUILD}
cd ${BUILD_DIR}
tar -cjvf ${LINUX_BUILD}.tar.bz2 ${LINUX_BUILD}/
cp ${LINUX_BUILD}.tar.bz2 ${ARCHIVE_DIR}
cd ${ARCHIVE_DIR}
sha1sum * > ${ARCHIVE_DIR}/SHA1SUM
cd ${ROOT_DIR}
rm -R ${BUILD_DIR}
cat ${ARCHIVE_DIR}/SHA1SUM
}
function avra-build-apple {
echo "Creating avra-${VERSION}-osx release"
mkdir -p release/avra-${VERSION}-osx
cd ./src
make -f makefiles/Makefile.osx
cp avra ../release/avra-${VERSION}-osx
zip -r avra-${VERSION}-osx.zip . -i avra-${VERSION}-osx/
cd ..
}
function avra-build-windows-mingw32 {
echo "Creating avra-${VERSION}-win32 release"
mkdir -p release/avra-${VERSION}-win32
cd ./src
make -f makefiles/Makefile.mingw32
cp avra.exe ../release/avra-${VERSION}-win32
make -f makefiles/Makefile.mingw32 clean
cd ../release
zip -r avra-${VERSION}-win32.zip . -i avra-${VERSION}-win32/
cd ..
}
if [ $OS_TYPE == "linux" ]; then
avra-build-linux
fi
if [ $OS_TYPE == "source" ]; then
avra-build-source
fi