#!/bin/bash # $1 is the arch, $2 is the version, $3 is the binary tarball URL mkdir out # Fill in real architecture and version info sed -i '/ARCH/$1' debian/DEBIAN/control sed -i '/VERSION/$2' debian/DEBIAN/control # Clean and remake binary folder rm -rf debian/usr/lib/nw.js mkdir -p debian/usr/lib/nw.js # Download binary echo "Downloading and unpacking $3" wget -q -O- $3 | tar -xvz --strip 1 -C debian/usr/lib/nw.js echo "Packaging deb file nwjs-normal_$2-1_$1.deb" dpkg-deb -b debian "out/nwjs-normal_$2-1_$1.deb"