summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gentilucci2019-05-30 09:05:41 -0600
committerAlex Gentilucci2019-05-30 09:46:42 -0600
commit2a89484d8422331eb083ad29c252a31b77e32841 (patch)
tree48dcacd331f7e290b8451b3bc00785fa742f468e
parent266d7b7266d169452ec645c66dc1b152ff18fc30 (diff)
downloadaur-2a89484d8422331eb083ad29c252a31b77e32841.tar.gz
Updated sums, fixed "Package contains reference to $pkgdir"
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD33
2 files changed, 25 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a1b661fa4e2..b4dda5fb939 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = vim-instant-markdown
pkgdesc = Instant Markdown previews from vim in a browser
pkgver = 0.1.0
- pkgrel = 8
+ pkgrel = 9
url = https://github.com/suan/vim-instant-markdown#readme
install = install.sh
arch = any
@@ -15,7 +15,7 @@ pkgbase = vim-instant-markdown
source = http://registry.npmjs.org/instant-markdown-d/-/instant-markdown-d-0.1.0.tgz
source = https://raw.githubusercontent.com/suan/vim-instant-markdown/master/after/ftplugin/markdown/instant-markdown.vim
sha256sums = 457cda23129183b01a97e96de9e598680fa0cee6c7c9a40db0f830cd7031fa81
- sha256sums = f0d1698ff135649c5c9061896f194bbdaebe1701cfc81635ebc75b06bfc68228
+ sha256sums = 317faf4a9d43504540b99e319c2ba5f0218458936109574d231b894ed772df6f
pkgname = vim-instant-markdown
diff --git a/PKGBUILD b/PKGBUILD
index b143d91254c..b711aa0f815 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@ _npmname=instant-markdown-d
_npmver=0.1.0
pkgname=vim-instant-markdown
pkgver=0.1.0
-pkgrel=8
+pkgrel=9
pkgdesc="Instant Markdown previews from vim in a browser"
arch=(any)
license=(unknown)
@@ -15,7 +15,7 @@ source=("http://registry.npmjs.org/$_npmname/-/$_npmname-$_npmver.tgz"
"https://raw.githubusercontent.com/suan/vim-instant-markdown/master/after/ftplugin/markdown/instant-markdown.vim")
noextract=($_npmname-$_npmver.tgz)
sha256sums=('457cda23129183b01a97e96de9e598680fa0cee6c7c9a40db0f830cd7031fa81'
- 'f0d1698ff135649c5c9061896f194bbdaebe1701cfc81635ebc75b06bfc68228')
+ '317faf4a9d43504540b99e319c2ba5f0218458936109574d231b894ed772df6f')
install=install.sh
package() {
@@ -23,16 +23,29 @@ package() {
mkdir -p "$pkgdir/usr/share/vim/vimfiles/autoload/"
mkdir -p "$pkgdir/usr/share/vim/vimfiles/after/ftplugin/markdown"
+ cd "$srcdir"
npm install \
- --global \
- --no-save \
- --production \
- --user root \
- --cache "$srcdir/npm-cache" \
- --prefix "$pkgdir/usr" \
- "$_npmname-$_npmver.tgz"
+ --global \
+ --no-save \
+ --production \
+ --user root \
+ --cache "$srcdir/npm-cache" \
+ --prefix "$pkgdir/usr" \
+ "$_npmname-$_npmver.tgz"
+
+ find "$pkgdir/usr" -type d -exec chmod 755 {} +
- cp "$srcdir/instant-markdown.vim" "$pkgdir/usr/share/vim/vimfiles/after/ftplugin/markdown"
+ # Remove references to $pkgdir
+ find "$pkgdir" -type f -name package.json -print0 | xargs -0 sed -i "/_where/d"
+
+ # Remove references to $srcdir
+ local tmppackage="$(mktemp)"
+ local pkgjson="$pkgdir/usr/lib/node_modules/$_npmname/package.json"
+ jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
+ mv "$tmppackage" "$pkgjson"
+ chmod 644 "$pkgjson"
+
+ cp "$srcdir/instant-markdown.vim" "$pkgdir/usr/share/vim/vimfiles/after/ftplugin/markdown"
}
# vim: set ts=2 sw=2