Blame docker-builder-data/build/script/packet/papagayong-master.files/build-win.sh

e92ef7
#!/bin/bash
e92ef7
e92ef7
# QUICK HACK:
e92ef7
e92ef7
set -e
e92ef7
699c61
PK_DIRNAME="papagayo-ng"
699c61
e92ef7
PREBUILT_URL="https://github.com/morevnaproject/papagayo-ng/releases/download/v1.4.0/papagayo-ng-1.4.0-win.zip"
e92ef7
PREBUILT_ZIP="papagayo-ng-1.4.0-win.zip"
e92ef7
PREBUILT_DIR="papagayo-ng-1.4.0-win"
e92ef7
699c61
VERSION=$(grep "export VERSION=" "$UNPACK_PACKET_DIR/$PK_DIRNAME/util/package-linux.sh" | cut -d\' -f 2)
e92ef7
TARGET_DIR="papagayo-ng-$VERSION-win"
e92ef7
699c61
if [ ! -f "$BUILD_PACKET_DIR/papagayo-ng-$VERSION-win-installer.exe" ] \
699c61
|| [ "$BUILD_PACKET_DIR/papagayo-ng-$VERSION-win-installer.exe" -ot "$CURRENT_PACKET_DIR/unpack.done" ]; then
699c61
	mkdir -p "$BUILD_PACKET_DIR/prebuilt"
e92ef7
	
699c61
	cd "$BUILD_PACKET_DIR/prebuilt"
e92ef7
	wget -c "$PREBUILT_URL"
e92ef7
	rm -rf "$TARGET_DIR"
e92ef7
	unzip "$PREBUILT_ZIP"
e92ef7
	
699c61
	cd "$BUILD_PACKET_DIR"
e92ef7
	rm -f "$TARGET_DIR.zip"
e92ef7
	rm -rf "$TARGET_DIR"
e92ef7
	mv "prebuilt/$PREBUILT_DIR" "$TARGET_DIR"
e92ef7
	
699c61
	cd "$BUILD_PACKET_DIR/$TARGET_DIR"
e92ef7
	rm -rf papagayo-ng
699c61
	ln -s "$UNPACK_PACKET_DIR/$PK_DIRNAME" papagayo-ng
699c61
	cp "$FILES_PACKET_DIR/papagayo-ng.nsi" .
699c61
	cp "$FILES_PACKET_DIR/papagayo-ng.bat" .
699c61
	makensis papagayo-ng.nsi
e92ef7
	
699c61
	cd "$BUILD_PACKET_DIR"
e92ef7
	zip -r "$TARGET_DIR.zip" "$TARGET_DIR"
e92ef7
	rm -rf "$TARGET_DIR"
e92ef7
	mv "papagayo-ng-installer.exe" "papagayo-ng-$VERSION-win-installer.exe"
e92ef7
fi
e92ef7