Add build support for sdk version

master
Skylar Ittner 5 years ago
parent bbe3e2d022
commit bd2a302e42

1
.gitignore vendored

@ -0,0 +1 @@
debian/usr/lib/nw.js/*

@ -2,31 +2,43 @@
# This script is licensed under your favorite open source license.
# I really don't care what you do with it.
if [ $# -ne 3 ]; then
echo "Usage: build.sh [architecture] [package version] [binary tar.gz url]"
if [ $# -ne 4 ]; then
echo "Usage: build.sh [architecture] [package version] [normal|sdk] [binary tar.gz url]"
echo "Note: It is recommended to use \`fakeroot build.sh ...\` to ensure correct file permissions"
echo -e "Example usage:\n\tfakeroot ./build.sh amd64 0.38.4 https://dl.nwjs.io/v0.38.4/nwjs-v0.38.4-linux-x64.tar.gz"
echo -e "Example usage:\n\tfakeroot ./build.sh amd64 0.38.4 normal https://dl.nwjs.io/v0.38.4/nwjs-v0.38.4-linux-x64.tar.gz"
exit 1
fi
ARCH=$1
VERSION=$2
URL=$3
FILENAME="nwjs-normal_$VERSION-1_$ARCH.deb"
TYPE=$3
URL=$4
FILENAME="nwjs-$TYPE_$VERSION-1_$ARCH.deb"
mkdir -p out
# Fill in real architecture and version info
# Need to escape periods in the version string first
ESCAPEDVERSION=$(echo "$VERSION" | sed 's/\./\\\./g')
echo "Setting package version and architecture in control file"
echo "Setting package version, architecture, and type in control file"
sed -i "s/ARCH/$ARCH/" debian/DEBIAN/control
sed -i "s/VERSION/$ESCAPEDVERSION/" debian/DEBIAN/control
if [ $TYPE == "sdk" ]; then
sed -i "s/sdk/SDK/" debian/DEBIAN/control
sed -i "s/normal/sdk/" debian/DEBIAN/control
sed -i "s/SDK/normal/" debian/DEBIAN/control
fi
function clean_exit() {
echo "Resetting arch/version strings in control file"
sed -i "s/$ARCH/ARCH/" debian/DEBIAN/control
sed -i "s/$ESCAPEDVERSION/VERSION/" debian/DEBIAN/control
if [ $TYPE == "sdk" ]; then
sed -i "s/sdk/SDK/" debian/DEBIAN/control
sed -i "s/normal/sdk/" debian/DEBIAN/control
sed -i "s/SDK/normal/" debian/DEBIAN/control
fi
exit 0
}
@ -41,7 +53,7 @@ trap "clean_exit" 2
echo "Downloading and unpacking $URL"
wget -q -O- $URL | tar -xvz --strip 1 -C debian/usr/lib/nw.js
echo "Packaging deb file $FILENAME"
echo "Packaging deb file"
dpkg-deb -b debian "out/$FILENAME"
clean_exit

@ -4,6 +4,9 @@ Maintainer: Netsyms Technologies <opensource@netsyms.com>
Section: web
Homepage: https://nwjs.io/
Priority: optional
Provides: nw.js
Conflicts: nw.js-sdk
Replaces: nw.js-sdk
Description: Debian package for the NW.js runtime.
Built using official "normal" binaries from https://nwjs.io
Architecture: ARCH

Loading…
Cancel
Save