summaryrefslogtreecommitdiff
path: root/trunk/users/adrian/host/host-package-release
blob: c4a730675119e1f773a213c8113ab01934f91ff9 (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
#!/bin/bash
# host-package-release -- Packages Reprap host software into a .zip file and .deb package


# init

MACHINE="mendel"

RELEASE=${1:-`date -u +%Y%m%d`}

RELEASENAME="reprap-$MACHINE-$RELEASE"

FILELIST="jar/reprap.jar lib/*.jar lib/reprap-wv.stl lib/rr-logo-green-url.png\
    lib/reprap-icon.png lib/reprap.properties.dist lib/system-dependent/linux-i386/*\
    lib/system-dependent/windows-i586/* LICENSE"

SRCFILELIST="src/* build.xml build-user.xml .classpath .project \
	host-package-release readme"

LIBFILES="lib/*"

DESIGNFILES="../$MACHINE"

CLASSPATH=$CLASSPATH:./lib/j3dcore.jar
CLASSPATH=$CLASSPATH:./lib/j3d-org-java3d-all.jar
CLASSPATH=$CLASSPATH:./lib/j3dutils.jar
CLASSPATH=$CLASSPATH:./lib/vecmath.jar
CLASSPATH=$CLASSPATH:./lib/RXTXcomm.jar
CLASSPATH=$CLASSPATH:./lib/swing-layout-1.0.3.jar
CLASSPATH=$CLASSPATH:.
export CLASSPATH

# Remove any old jar directory
[ -d jar ] && rm -rf jar

# Recompile java files and create Reprap.jar
ant clean jar || exit 1

# Delete and then create temporary package directories
rm -rf "release"
mkdir "release"
BASENAME="release/$RELEASENAME"
mkdir "$BASENAME"
SRCFILENAME="$BASENAME/src"
mkdir "$SRCFILENAME"

# Copy files into binary package directory
for F in $FILELIST
do
  cp -p $F "$BASENAME"
done

echo "Executable created."

# Copy README into package dir, substituting release string for RELEASE
#   and the current UTC date for DATE
NOW=`date -u +'%d %B %Y'`
sed -e "s/RELEASE/$RELEASE/g" -e "s/DATE/$NOW/g" readme > "$BASENAME/readme"

# Create README.txt for Windows people
sed -e 's/$/\r/' readme > "$BASENAME/readme.txt"

echo "READMEs created."

# Now create the src archive
for F in $SRCFILELIST
do
  cp -rp $F "$SRCFILENAME"
done

mkdir -p "$SRCFILENAME"/lib
for F in $LIBFILES
do
  cp -pr $F "$SRCFILENAME"/lib
done

echo "Sources copied."

for F in $DESIGNFILES
do
  cp -pr $F "$BASENAME"
done

echo "Design files copied."

# Omit all .svn subdirs
cd "$BASENAME"
find . -type d -name .svn |xargs rm -rf
cd ..

echo "Subversion references removed."

# Create zip archive

[ -f "$RELEASENAME".zip ] && rm "$RELEASENAME".zip
zip -qr "$RELEASENAME.zip" "$RELEASENAME"
cd ..


echo "Zip file created."
echo "RepRap Release $RELEASE created."