3 # all these shall be defined in a .brand file passed as first argument
10 icon_icns=Darkplaces.app/Contents/Resources/Darkplaces.icns
11 icon_ico=darkplaces.ico
12 icon_xpm=darkplaces.xpm
15 if [ -z "$1" ] || [ x"$1" = x"--help" ]; then
16 echo "Usage: $0 brandfile binaries..."
22 t=`mktemp -d -t darkplaces-rebrand.XXXXXX`
24 flags="$flags -customgamename \"$name\" -customgamedirname1 \"$dirname1\" -customgamedirname2 \"$dirname2\" -customgamescreenshotname \"$screenshotname\" -customgameuserdirname \"$userdirname\""
25 echo "$flags" > "$t/darkplaces.opt"
28 zip -9r darkplaces.zip darkplaces.opt
32 for EXECUTABLE in "$@"; do
37 # detect what the executable is
38 case "`file -b "$EXECUTABLE"`" in
70 cp "$t/darkplaces.zip" "$t/darkplaces-this.zip"
73 cp "$icon_xpm" "$t/darkplaces-icon.xpm"
75 for i in $icons_tga; do
76 convert "$i" -auto-orient "$t/darkplaces-icon$cnt.tga"
77 if [ -z "$cnt" ]; then
84 zip -9r darkplaces-this.zip darkplaces-icon*
89 cp "$icon_ico" "$t/darkplaces-icon.ico"
90 cp "$EXECUTABLE" "$t/darkplaces.exe"
91 cat >"$t/darkplaces.rc" <<EOF
92 #include <windows.h> // include for version info constants
94 A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "darkplaces-icon.ico"
98 PRODUCTVERSION 1,0,0,0
101 BLOCK "StringFileInfo"
105 VALUE "CompanyName", "Forest Hale Digital Services"
106 VALUE "FileVersion", "1.0"
107 VALUE "FileDescription", "$name"
108 VALUE "InternalName", "${EXECUTABLE##*/}"
109 VALUE "LegalCopyright", "id Software, Forest Hale, and contributors"
110 VALUE "LegalTrademarks", ""
111 VALUE "OriginalFilename", "${EXECUTABLE##*/}"
112 VALUE "ProductName", "$name"
113 VALUE "ProductVersion", "1.0"
119 wine "c:/Program Files/ResEdit/ResEdit.exe" -convert darkplaces.rc darkplaces.exe
121 mv "$t/darkplaces.exe" "$EXECUTABLE"
125 # OS X is special here
126 case "$EXECUTABLE" in
128 pkgdir="${EXECUTABLE%/*}/.."
134 if [ -d "$pkgdir/Resources" ]; then
135 cp "$icon_icns" "$pkgdir/Resources/Darkplaces.icns"
136 cat <<EOF >"$pkgdir/Resources/English.lproj/InfoPlist.strings"
137 /* Localized versions of Info.plist keys */
139 CFBundleName = "$name";
140 CFBundleShortVersionString = "$name";
141 CFBundleGetInfoString = "Darkplaces by Forest 'LordHavoc' Hale";
142 NSHumanReadableCopyright = "Copyright `date +%Y`";
147 cat "$t/darkplaces-this.zip" >> "$EXECUTABLE"