From 59f5e819038cae11f898943623528353dad71df2 Mon Sep 17 00:00:00 2001 From: Galen Abell Date: Tue, 2 Apr 2019 02:34:51 +0000 Subject: [PATCH] build: Arch Linux PKGBUILD (#120) Fixes #115 Changes proposed in this pull request: - Add Arch Linux PKGBUILD --- installers/PKGBUILD | 35 +++++++++++++++++++++++++++++++++++ installers/build-installer.sh | 4 ++++ 2 files changed, 39 insertions(+) create mode 100644 installers/PKGBUILD diff --git a/installers/PKGBUILD b/installers/PKGBUILD new file mode 100644 index 00000000..4185a831 --- /dev/null +++ b/installers/PKGBUILD @@ -0,0 +1,35 @@ +# Maintainer: Samim Mirhosseini +pkgname="baker" +pkgver=0.7.0 +pkgrel=1 +pkgdesc="Quick and easy baking of computing environments." +arch=('x86_64') +url="https://github.com/ottomatica/Baker" +license=('Apache') +provides=('baker') +makedepends=('npm' 'jq' 'python2') +optdepends=('virtualbox: virtual machine support') +source=($pkgname-$pkgver.tar.gz::https://github.com/ottomatica/Baker/archive/v$pkgver.tar.gz) +md5sums=('63a02cc6837a64b917558c763dff1341') + +package() { + npm install -g \ + --user root \ + --prefix "$pkgdir"/usr \ + --cache "${srcdir}/npm-cache" \ + "$srcdir"/$pkgname-$pkgver.tar.gz + + # Non-deterministic race in npm gives 777 permissions to random directories. + # See https://github.com/npm/npm/issues/9359 for details. + find "${pkgdir}"/usr -type d -exec chmod 755 {} + + + # Remove dependency references to $pkgdir + find "$pkgdir" -name package.json -print0 | xargs -0 sed -i '/_where/d' + + # Remove package references to $pkgdir + local tmppackage="$(mktemp)" + local pkgjson="$pkgdir/usr/lib/node_modules/$pkgname/package.json" + jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage" + mv "$tmppackage" "$pkgjson" + chmod 644 "$pkgjson" +} diff --git a/installers/build-installer.sh b/installers/build-installer.sh index 89f2c022..7f0d5517 100755 --- a/installers/build-installer.sh +++ b/installers/build-installer.sh @@ -21,6 +21,9 @@ sed -i "" -e "s/Version: .*/Version: ${BAKER_RELEASE}/" "linux/deb-template/bake echo "Updating AppVersion in win/scripts/baker.iss to be $BAKER_RELEASE"; sed -i "" -e "s/AppVersion=.*/AppVersion=${BAKER_RELEASE}/" "win/scripts/baker.iss" +echo "Updating pkgver in PKGBUILD to be $BAKER_RELEASE"; +sed -i "" -e "s/^pkgver=.*$/pkgver=${BAKER_RELEASE}/" "PKGBUILD" + # clean any old files rm -f macos/bin/* @@ -50,6 +53,7 @@ echo "Version: ${BAKER_RELEASE}" echo "You are not done, yet" echo "You need to upload the .tar.gz, .pkg, and .deb on github." +echo "You also need to update the md5sums field in PKGBUILD to the md5 sum of the source .tar.gz." echo "Then you need to switch to a windows machine and run 'grunt'" echo "Then you need to rename win/bin/baker-setup.exe to baker-windows-latest.exe and upload too" echo "Finally, you need to update the sha to $SHA and VERSION to ${BAKER_RELEASE} in ottomatica/homebrew"