summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannick Hemelhof2017-04-06 09:17:14 +0200
committerJannick Hemelhof2017-04-06 09:17:14 +0200
commit35d4b7510b31506222494b3099e5a81928ef11e4 (patch)
treefdbfb145cfe32cf83acb0e2014adf5c5991a2cab
parentfb7680148e6efcb8357f540bf72c398abd18c320 (diff)
downloadaur-35d4b7510b31506222494b3099e5a81928ef11e4.tar.gz
Redesign of PKGBUILD
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD66
-rw-r--r--boostnote.desktop4
-rw-r--r--boostnote.js29
-rw-r--r--boostnote.sh3
5 files changed, 88 insertions, 35 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bd36410c2b57..3e1ce6677e7b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,21 @@
pkgbase = boostnote
pkgdesc = Open source note-taking app for programmers
pkgver = 0.8.7
- pkgrel = 1
- url = https://b00st.io/
- arch = x86_64
- license = GPL
- source = https://github.com/BoostIO/boost-releases/releases/download/v0.8.7/boostnote_0.8.7_amd64.deb
- md5sums = 732f6631a49005676b6a5d348336a3f0
+ pkgrel = 2
+ url = https://boostnote.io/
+ arch = any
+ license = GPL3
+ makedepends = npm
+ makedepends = grunt-cli
+ depends = electron
+ source = 0.8.7.tar.gz::https://github.com/BoostIO/Boostnote/archive/v0.8.7.tar.gz
+ source = boostnote.js
+ source = boostnote.desktop
+ source = npm-prune-fix.patch
+ sha512sums = 400bcd5f2a2fa3c858c4e5ab8ce22c8f9669a5c1c0299724937f56534248e0517c8a814b7c2f2243c8492edbb50e96b2a2a2ce787f6566cbfec1741521d5261c
+ sha512sums = f0abbdcca34d7f74d3dc66ffc2d0995416e7708c715d55fa58c4c2abc31d191ea42f3434e3105292b4817f83ac0ca89f456f5f93007ae80ab2426c8941f615f9
+ sha512sums = 18bcda13580da8ceeaa86793a77ec00a053b8fd51451dad7e2b1a19553fe1a467ac647b44b789212e783f3f6a80968cc9404e884ef7ff6b1f6588473b3229d40
+ sha512sums = c500237c18fc1fcd98f3fd6d1b0bd74764e6f53a87c258b4d68b6d4754ad2281317b89e411aaf5af4d2c9f837f67218cd3663e27fc77da5137b217724f91039c
pkgname = boostnote
diff --git a/PKGBUILD b/PKGBUILD
index e29118661715..b6ed20eec260 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,54 +1,72 @@
-# Maintainer: Jannick Hemelhof <mister.jannick@gmail.com>
-# Contributor: Dick Choi <fluke8259@gmail.com>
-# Contributor: Romain Bazile <gromain.baz@gmail.com>
+# Maintainer: Jannick Hemelhof <mister {dot} jannick {at} gmail {dot} com>
+# Contributor: NicoHood <aur {at} nicohood {dot} de>
+# Contributor: Dick Choi <fluke8259 {at} gmail {dot} com>
+# Contributor: Romain Bazile <gromain {dot} baz {at} gmail {dot} com>
pkgname=boostnote
_pkgname=Boostnote
pkgver=0.8.7
-pkgrel=1
+pkgrel=2
pkgdesc="Open source note-taking app for programmers"
-arch=('x86_64')
-url="https://b00st.io/"
-license=('GPL')
-depends=(electron)
-makedepends=(npm grunt-cli asar)
+arch=('any')
+url="https://boostnote.io/"
+license=('GPL3')
+depends=('electron')
+makedepends=('npm' 'grunt-cli')
source=(
"${pkgver}.tar.gz::https://github.com/BoostIO/"${_pkgname}"/archive/v"$pkgver".tar.gz"
- "${pkgname}.sh"
+ "${pkgname}.js"
"${pkgname}.desktop"
"npm-prune-fix.patch"
)
-md5sums=(
- '217d8b343b2215679a212b1a44f21ca7'
- 'a4bbf961790883a47e3fef257ba35b98'
- '8547065c63f31831a249ccc1225197e2'
- '5de458c318306de81a9f72bcbfddaa69'
+sha512sums=(
+ '400bcd5f2a2fa3c858c4e5ab8ce22c8f9669a5c1c0299724937f56534248e0517c8a814b7c2f2243c8492edbb50e96b2a2a2ce787f6566cbfec1741521d5261c'
+ 'f0abbdcca34d7f74d3dc66ffc2d0995416e7708c715d55fa58c4c2abc31d191ea42f3434e3105292b4817f83ac0ca89f456f5f93007ae80ab2426c8941f615f9'
+ '18bcda13580da8ceeaa86793a77ec00a053b8fd51451dad7e2b1a19553fe1a467ac647b44b789212e783f3f6a80968cc9404e884ef7ff6b1f6588473b3229d40'
+ 'c500237c18fc1fcd98f3fd6d1b0bd74764e6f53a87c258b4d68b6d4754ad2281317b89e411aaf5af4d2c9f837f67218cd3663e27fc77da5137b217724f91039c'
)
prepare() {
- cd "${srcdir}/${_pkgname}-${pkgver}"
+ cd "${_pkgname}-${pkgver}"
- patch -Np1 -i "${srcdir}"/npm-prune-fix.patch
+ patch -Np1 -i "${srcdir}/npm-prune-fix.patch"
}
build() {
- cd "${srcdir}/${_pkgname}-${pkgver}"
+ cd "${_pkgname}-${pkgver}"
npm install
grunt compile
npm prune --production
- asar pack . ../${pkgname}.asar
cp resources/app.png ../app.png
}
package() {
- cd $srcdir
+ cd "${_pkgname}-${pkgver}"
- install -Dm644 ${pkgname}.asar $pkgdir/opt/${pkgname}/${pkgname}.asar
+ appdir="/usr/lib/${pkgname}"
- install -Dm755 ${pkgname}.sh $pkgdir/usr/bin/${pkgname}
+ install -dm755 "${pkgdir}""${appdir}"
+ cp -r * "${pkgdir}""${appdir}"
- install -Dm644 app.png "$pkgdir"/usr/share/pixmaps/${pkgname}.png
- install -Dm644 ${pkgname}.desktop "$pkgdir"/usr/share/applications/${pkgname}.desktop
+ install -Dm755 "${srcdir}/${pkgname}.js" "$pkgdir/usr/bin/${pkgname}"
+
+ install -Dm644 "${srcdir}/app.png" "$pkgdir/usr/share/pixmaps/${pkgname}.png"
+ install -Dm644 "${srcdir}/${pkgname}.desktop" "$pkgdir/usr/share/applications/${pkgname}.desktop"
+
+ find "${pkgdir}""${appdir}" \
+ -name "package.json" \
+ -exec sed -e "s|${srcdir}/${pkgname}-${pkgver}|${appdir}|" \
+ -i {} \; \
+ -or -name ".*" -prune -exec rm -r '{}' \; \
+ -or -name "Gruntfile.js" -exec rm '{}' \; \
+ -or -name "Makefile" -exec rm '{}' \; \
+ -or -name "bower.json" -exec rm '{}' \; \
+ -or -name "cmd.js" -exec rm '{}' \; \
+ -or -name "coffee" -prune -exec rm -r '{}' \; \
+ -or -name "example" -prune -exec rm -r '{}' \; \
+ -or -name "gulpfile.js" -exec rm '{}' \; \
+ -or -name "test" -prune -exec rm -r '{}' \; \
+ -or -name "tests" -prune -exec rm -r '{}' \;
}
diff --git a/boostnote.desktop b/boostnote.desktop
index c95f979f6760..5dd350c24029 100644
--- a/boostnote.desktop
+++ b/boostnote.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Boostnote
-GenericName=Boostnote is an open source note-taking app made for progammers just like you.
-Comment=Boostnote is an open source note-taking app made for progammers just like you.
+GenericName=Boostnote is an open source note-taking app made for programmers just like you.
+Comment=Boostnote is an open source note-taking app made for programmers just like you.
Exec=/usr/bin/boostnote %U
Icon=boostnote
Type=Application
diff --git a/boostnote.js b/boostnote.js
new file mode 100644
index 000000000000..4550e8a8b191
--- /dev/null
+++ b/boostnote.js
@@ -0,0 +1,29 @@
+#!/usr/bin/electron
+
+const name = 'boostnote';
+
+const {app} = require('electron');
+const fs = require('fs');
+const path = require('path');
+
+// Change command name.
+const fd = fs.openSync('/proc/self/comm', fs.constants.O_WRONLY);
+fs.writeSync(fd, name);
+fs.closeSync(fd);
+
+// Remove first command line argument (/usr/bin/electron).
+process.argv.splice(0, 1);
+
+// Set application paths.
+const appPath = path.join(path.dirname(__dirname), 'lib', name);
+const packageJson = require(path.join(appPath, 'package.json'));
+const productName = 'Boostnote';
+app.setAppPath(appPath);
+app.setDesktopName(name + '.desktop');
+app.setName(productName);
+app.setPath('userCache', path.join(app.getPath('cache'), productName));
+app.setPath('userData', path.join(app.getPath('appData'), productName));
+app.setVersion(packageJson.version);
+
+// Run the application.
+require('module')._load(appPath, module, true); \ No newline at end of file
diff --git a/boostnote.sh b/boostnote.sh
deleted file mode 100644
index 6bda78c18630..000000000000
--- a/boostnote.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-cd /opt/boostnote
-NODE_ENV=production electron boostnote.asar "$@" \ No newline at end of file