summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitris Kiziridis2020-03-24 10:29:11 +0200
committerDimitris Kiziridis2020-03-24 10:29:11 +0200
commitaa08356af8e7a956e9ef61f4f614a9f7927b0843 (patch)
tree1c58f1ccf876337b162b5a6df5675402240b397a
downloadaur-aa08356af8e7a956e9ef61f4f614a9f7927b0843.tar.gz
Initial commit
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD25
2 files changed, 39 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..9ed0f4d412a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = legit
+ pkgdesc = Add licenses to projects at the command line
+ pkgver = 3.0.1
+ pkgrel = 1
+ url = https://github.com/captainsafia/legit
+ arch = any
+ license = MIT
+ makedepends = npm
+ noextract = v3.0.1.tar.gz
+ source = https://github.com/captainsafia/legit/archive/v3.0.1.tar.gz
+ md5sums = 3954bd2dd6cd78c070716788a10cb633
+
+pkgname = legit
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..2e31f5b1de8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,25 @@
+# Maintainer: Dimitris Kiziridis <ragouel at outlook dot com>
+
+pkgname=legit
+pkgver=3.0.1
+pkgrel=1
+pkgdesc="Add licenses to projects at the command line"
+arch=('any')
+url='https://github.com/captainsafia/legit'
+license=('MIT')
+makedepends=('npm')
+noextract=("v${pkgver}.tar.gz")
+source=("${url}/archive/v${pkgver}.tar.gz")
+md5sums=('3954bd2dd6cd78c070716788a10cb633')
+
+package() {
+ npm install -g --user root --prefix "${pkgdir}/usr" "${srcdir}/v${pkgver}.tar.gz"
+ find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
+ find "${pkgdir}/usr" -type d -exec chmod 755 {} +
+ local tmppackage="$(mktemp)"
+ local pkgjson="$pkgdir/usr/lib/node_modules/@captainsafia/$pkgname/package.json"
+ jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
+ mv "$tmppackage" "$pkgjson"
+ chmod 644 "$pkgjson"
+ chown -R root:root "${pkgdir}"
+} \ No newline at end of file