Commit a2328734 authored by Roman Haefeli's avatar Roman Haefeli
Browse files

build_windows: add -h and -k flags

parent 918b49d5
#!/bin/bash
usage="$(basename "$0") [-h] [-k] -- build a netpd bundle for Windows
where:
-h|--help show this help text
-k|--skip-upload do not upload resulting app bundle"
SKIP_UPLOAD=false
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
echo "$usage"
exit 0
shift
;;
-k|--skip-upload)
SKIP_UPLOAD=true
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done
app_name="netpd"
package_version=$(date +%Y-%m-%d)
src_url="https://github.com/reduzent/netpd"
# Pd
pd_archive_file=~/Downloads/pd-0.51-4.msw.zip
pd_archive_file=~/Downloads/pd-0.52-1.msw.zip
# Libraries
ext_urls=()
ext_urls+=("http://puredata.info/Members/rdz/software/binfile/0.1~git20181006/binfile%5Bv0.1~git20181006%5D(Windows-amd64-32).dek")
ext_urls+=("http://puredata.info/Members/porres/software/else/1.0-0_beta37_with_live_electronics_tutorial/else%5Bv1.0-0_beta37_with_live_electronics_tutorial%5D(Windows-amd64-32).dek")
ext_urls+=("http://puredata.info/Members/musil/software/iemlib/1.22/iemlib%5Bv1.22%5D(Darwin-amd64-32)(Darwin-i386-32)(Linux-amd64-32)(Windows-amd64-32)(Windows-i386-32)(Sources).dek")
ext_urls+=("http://puredata.info/Members/zmoelnigbot/software/iemnet/0.3.0/iemnet%5Bv0.3.0%5D(Darwin-amd64-32)(Linux-amd64-32)(Linux-arm64-32)(Linux-armv7-32)(Linux-i386-32)(Windows-amd64-32)(Windows-i386-32).dek")
ext_urls+=("http://puredata.info/Members/rdz/software/osc/0.2~git20181006/osc%5Bv0.2~git20181006%5D(Windows-amd64-32).dek")
ext_urls+=("http://puredata.info/Members/rdz/software/slip/0.1~git20181006/slip%5Bv0.1~git20181006%5D(Windows-amd64-32).dek")
ext_urls+=("http://puredata.info/Members/zmoelnigbot/software/zexy/2.3.1/zexy%5Bv2.3.1%5D(Darwin-amd64-32)(Linux-amd64-32)(Linux-arm64-32)(Linux-armv7-32)(Linux-i386-32)(Windows-amd64-32)(Windows-i386-32).dek")
ext_urls+=("https://puredata.info/downloads/kiosk-plugin/releases/1.0/kiosk-plugin.zip")
# workdir
......@@ -91,15 +119,20 @@ app_version=$(sed -n 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p'
# create archive
zip -q -r "${app_name}-${app_version}-windows-${package_version}.zip" "${app_name}-${app_version}"
# upload bundle
scp -q "${app_name}-${app_version}-windows-${package_version}.zip" all@netpd.org:public_html/software/
if $SKIP_UPLOAD; then
# clean up workdir only
rm -rf "${app_name}-${app_version}" || fail
else
# upload bundle
scp -q "${app_name}-${app_version}-windows-${package_version}.zip" all@netpd.org:public_html/software/
# clean up
rm -rf "${app_name}-${app_version}" "${app_name}-${app_version}-windows-${package_version}.zip"
# clean up
rm -rf "${app_name}-${app_version}" "${app_name}-${app_version}-windows-${package_version}.zip"
# create shortcut to latest
ssh all@netpd.org ln -f -s "${app_name}-${app_version}-windows-${package_version}.zip" "public_html/software/${app_name}-${app_version}-windows.zip" || fail
# create shortcut to latest
ssh all@netpd.org ln -f -s "${app_name}-${app_version}-windows-${package_version}.zip" "public_html/software/${app_name}-${app_version}-windows.zip" || fail
# update redirect target in .htaccess
ssh all@netpd.org sed -i "1s/[0-9]\.[0-9]\.[0-9]/${app_version}/" public_html/software/.htaccess || fail
# update redirect target in .htaccess
ssh all@netpd.org sed -i "1s/[0-9]\.[0-9]\.[0-9]/${app_version}/" public_html/software/.htaccess || fail
fi
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment