5 # Run this script to create a win32 package.
10 echo "Create a portable win32 package or installer."
11 echo "Usage: $0 [-h] [-i makensis] [-s strip] -d assets -V version -p prefix"
13 echo " -d Specify the game assets to be included."
14 echo " -h Show this help an exit."
15 echo " -i To make an installer, specify the makensis program."
16 echo " -V Specify the version of the program to be packaged"
17 echo " -s To strip the binaries, specify the strip program."
18 echo " -p Specify the path to your toolchain installation."
21 while getopts ":V:hd:i:p:s:" opt
44 echo "Invalid option: -$OPTARG" >&2
51 if test "x$ASSETS" = x
|| test "x$VERSION" = x
|| test "x$PREFIX" = x
66 DIRECTORY
="yoink-$VERSION"
67 ARCHIVE
="$BUILD/$DIRECTORY"
69 MAN2HTML
="$ROOT/doc/man2html.sh"
70 UNIX2DOS
="$ROOT/win32/unix2dos.sh"
72 DLLS
="libogg-0 libpng14 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1"
75 if test ! -f "src/version.c"
77 echo "Run the script from the repository root directory."
83 "The temp directory $BUILD could not be created."
89 cp -f "$ROOT/src/yoink.exe" "$ARCHIVE" || die
"copying yoink.exe"
90 test "x$STRIP" != x
&& "$STRIP" "$ARCHIVE/yoink.exe"
94 cp -f "$PREFIX/bin/$dll.dll" "$ARCHIVE" || die
"copying $dll"
95 test "x$STRIP" != x
&& "$STRIP" "$ARCHIVE/$dll.dll"
100 cp -f --parents "data/$asset" "$ARCHIVE"
103 for doc
in AUTHORS ChangeLog COPYING README TODO
105 "$UNIX2DOS" "$doc" "$ARCHIVE/$doc.txt" || die
"unix2dos $doc"
108 "$MAN2HTML" -f -o "$ARCHIVE/Manual.html"
109 "$UNIX2DOS" "$ARCHIVE/Manual.html"
111 cp -rf "$ROOT/doc/licenses" "$ARCHIVE" || die
"copying doc/licenses"
112 cd "$ARCHIVE/licenses"
115 (mv "$license" "$license.txt" && "$UNIX2DOS" "$license.txt") \
116 || die
"moving and unix2dos $license"
121 if test "x$MAKENSIS" = x
123 # build portable archive
124 echo "No valid makensis executable passed;"
125 echo "making portable package instead..."
126 NAME
="$DIRECTORY.zip"
128 zip -r "$NAME" "$DIRECTORY" || die
"zipping portable archive"
131 echo "Done! Package saved to $NAME."
134 NAME
="yoinksetup-$VERSION.exe"
136 cp "$ROOT/win32/yoink.nsi" .
137 "$MAKENSIS" -DROOTPATH="$ROOT" -DINSTALLFILES="$ARCHIVE" \
138 -DVERSION="$VERSION" -DOUTFILE="$NAME" yoink.nsi \
139 || die
"running '$MAKENSIS'"
142 echo "Done! Installer saved to $NAME."