refactored some code. compiles now without suppresing any warning with gcc-6.3.0.
[AROS.git] / scripts / snapshotports.sh
blob824044376e7e1164644074a724a23cd91ecc36e5
1 #!/bin/bash
3 # Copyright © 2015, The AROS Development Team. All rights reserved.
4 # $Id$
6 # This script simplifies the task of creating snapshots of the ports.
9 set -e
10 set -u
12 date=`date +"%Y%m%d"`
14 root="$HOME/aros-snapshot-ports"
15 srcdir="$root/src"
16 arcdir="$root/archive/snapshots2/$date/Binaries"
17 portsdir="$HOME/aros-ports-src"
18 user="marust"
20 copy()
22 local target="$1" # e.g. "pc-i386"
23 local reldir="$2" # e.g. "Extras/Utilities/Text
24 local pack="$3" # e.g. "Annotate"
25 local from="$root/build/$target/bin/$target/AROS/$reldir/$pack"
26 local to="$root/bin/AROS-$date-$target-ports/$reldir"
28 if [ -d "$from" ] ; then
29 echo "Copying '$from' to '$to'"
30 mkdir -p "$to"
31 cp -r "$from" "$to"
32 if [ -f "$from.info" ] ; then
33 cp "$from.info" "$to"
35 else
36 echo "'$from' doesn't exist"
40 copyenv()
42 local target="$1" # e.g. "pc-i386"
43 local reldir="Prefs/Env-Archive/SYS/Packages"
44 local variable="$2" # e.g. "Lua"
45 local from="$root/build/$target/bin/$target/AROS/$reldir/$variable"
46 local to="$root/bin/AROS-$date-$target-ports/$reldir"
48 if [ -f "$from" ] ; then
49 echo "Copying '$from' to '$to'"
50 mkdir -p "$to"
51 cp "$from" "$to"
52 else
53 echo "'$from' doesn't exist"
57 build()
59 local target="$1" # e.g. "pc-i386"
60 local builddir="$root/build/$target"
61 local arcname="AROS-$date-$target-ports"
62 local bindir="$root/bin/$arcname"
64 echo "Building $target in $builddir"
65 rm "$builddir" -rf
66 mkdir "$builddir" -p
67 cd "$builddir"
68 "$srcdir/configure" --target="$target" --with-portssources="$portsdir" --with-binutils-version=2.25 --with-gcc-version=6.3.0
69 make -s -j4
70 make -s -j4 ports
72 echo "Copying the binaries"
73 mkdir "$bindir" -p
75 copy "$target" "Extras/Developer" "BWBasic"
76 copy "$target" "Extras/Developer" "CBMBasic"
77 copy "$target" "Extras/Developer" "CFlow"
78 copy "$target" "Extras/Developer" "Ctags"
79 copy "$target" "Extras/Emu" "DOSBox"
80 copy "$target" "Extras/Emu" "Scummvm"
81 copy "$target" "Extras/Emu" "Vbam"
82 copy "$target" "Extras/Emu" "Vice"
83 copy "$target" "Extras/Games/Platform" "Abuse"
84 copy "$target" "Extras/Games/Action" "Biniax2"
85 copy "$target" "Extras/Games/Platform" "Blobwars"
86 copy "$target" "Extras/Games/Action" "Bugsquish"
87 copy "$target" "Extras/Games/Action" "CircusLinux"
88 copy "$target" "Extras/Games/Action" "Defendguin"
89 copy "$target" "Extras/Games/Puzzle" "GemDropX"
90 copy "$target" "Extras/Games/Action" "GnuJump"
91 copy "$target" "Extras/Games/Action" "GnuRobbo"
92 copy "$target" "Extras/Games/Platform" "Hurrican"
93 copy "$target" "Extras/Games/Puzzle" "InterLogic"
94 copy "$target" "Extras/Games/Action" "KoboDeluxe"
95 copy "$target" "Extras/Games/Action" "Koules"
96 copy "$target" "Extras/Games/Puzzle" "LMarbles"
97 copy "$target" "Extras/Games/Puzzle" "LTris"
98 copy "$target" "Extras/Games/Action" "MadBomber"
99 copy "$target" "Extras/Games/Adventure" "Magnetic"
100 copy "$target" "Extras/Games/Puzzle" "MultiPuzzle"
101 copy "$target" "Extras/Games/Action" "PenguinCommand"
102 copy "$target" "Extras/Games/Puzzle" "Pushover"
103 copy "$target" "Extras/Games/Action" "Rocksndiamonds"
104 copy "$target" "Extras/Games/Action" "SdlScavenger"
105 copy "$target" "Extras/Games/Action" "Vectoroids"
106 copy "$target" "Extras/Games/Action" "WormWars"
107 copy "$target" "Extras/Games/Action" "Xpired"
108 copy "$target" "Extras/MultiMedia/Audio" "Abcm2ps"
109 copy "$target" "Extras/MultiMedia/Audio" "MilkyTracker"
110 copy "$target" "Extras/MultiMedia/Audio" "Timidity"
111 copy "$target" "Extras/MultiMedia/Gfx" "GrafX2"
112 copy "$target" "Extras/MultiMedia/Gfx" "Lodepaint"
113 copy "$target" "Extras/MultiMedia/Gfx" "Potrace"
114 copy "$target" "Extras/MultiMedia/Gfx" "ZunePaint"
115 copy "$target" "Extras/MultiMedia/Gfx" "ZuneView"
116 copy "$target" "Extras/MultiMedia/Video" "ScreenRecorder"
117 copy "$target" "Extras/Office" "MUIbase"
118 copy "$target" "Extras/Utilities/Archive" "ZuneARC"
119 copy "$target" "Extras/Utilities/Filetool" "Zaphod"
120 copy "$target" "Extras/Utilities/Print" "A2ps"
121 copy "$target" "Extras/Utilities/Scientific" "Mathomatic"
122 copy "$target" "Extras/Utilities/Scientific" "MathX"
123 copy "$target" "Extras/Utilities/Text" "Annotate"
124 copy "$target" "Extras/Utilities/Text" "Antiword"
125 copy "$target" "Extras/Utilities/Text" "Gocr"
126 copy "$target" "Extras/Utilities/Text" "PolyglotMan"
127 copy "$target" "Extras/Utilities/Text" "Vim"
129 # copy package variables
130 copyenv "$target" "Freepats"
131 copyenv "$target" "MUIbase"
132 copyenv "$target" "Vim"
134 echo "Creating the archive $arcdir/$arcname.tar.bz2"
135 mkdir -p "$arcdir"
136 cd "$bindir"
137 tar cfvj "$arcdir/$arcname.tar.bz2" .
138 echo "Creating $arcdir/$arcname.tar.bz2.md5"
139 cd $arcdir
140 md5sum "$arcname.tar.bz2" > "$arcname.tar.bz2.md5"
144 if [ $# -eq 1 ] && [ "$1" == "-i" ] ; then
145 rm "$root" -rf
146 mkdir "$root"
147 mkdir "$srcdir"
148 svn checkout https://svn.aros.org/svn/aros/trunk/AROS "$srcdir"
149 svn checkout https://svn.aros.org/svn/aros/trunk/contrib "$srcdir/contrib"
150 svn checkout https://svn.aros.org/svn/aros/trunk/ports "$srcdir/ports"
151 exit 0
154 if [ $# -eq 1 ] && [ "$1" == "-b" ] ; then
155 echo "Update the sources"
156 svn up "$srcdir" "$srcdir/contrib" "$srcdir/ports"
158 build pc-i386
159 build pc-x86_64
160 build amiga-m68k
161 #build raspi-armhf
162 exit 0
165 if [ $# -eq 1 ] && [ "$1" == "-u" ] ; then
166 echo "Uploading archives"
167 scp -r "$root/archive/snapshots2" "$user,aros@web.sourceforge.net:/home/project-web/aros/uploads"
168 exit 0
171 echo "Usage:"
172 echo "snapshotports -i : create directories and do checkout of source"
173 echo "snapshotports -b : build AROS and create the archives"
174 echo "snapshotports -u : upload of archives to sourceforge"
176 exit 0