diff options
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | LICENSE | 7 | ||||
-rw-r--r-- | PKGBUILD | 27 |
3 files changed, 31 insertions, 8 deletions
@@ -1,15 +1,18 @@ pkgbase = bower-away pkgdesc = Convert your project from Bower to Yarn pkgver = 1.1.2 - pkgrel = 1 + pkgrel = 2 url = https://github.com/sheerun/bower-away arch = any license = MIT makedepends = npm + makedepends = jq depends = nodejs noextract = bower-away-1.1.2.tgz source = https://registry.npmjs.org/bower-away/-/bower-away-1.1.2.tgz + source = LICENSE sha256sums = e9a3d70b39fe388768f4c2efc931a2f199fc68f90e6c310ea51d02f2d58a6db2 + sha256sums = 6be9328337c8f17e83b24fbebee8c6258eb364044de0dce7238afde57eaf8ae6 pkgname = bower-away diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..065898b4f1a9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2017 Adam Stankiewicz + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -1,20 +1,33 @@ # Maintainer: bert@bertptrs.nl pkgname=bower-away pkgver=1.1.2 -pkgrel=1 +pkgrel=2 pkgdesc="Convert your project from Bower to Yarn" arch=('any') url="https://github.com/sheerun/bower-away" license=('MIT') depends=('nodejs') -makedepends=('npm') -source=("https://registry.npmjs.org/bower-away/-/$pkgname-$pkgver.tgz") +makedepends=('npm' 'jq') +source=("https://registry.npmjs.org/bower-away/-/$pkgname-$pkgver.tgz" + "LICENSE") noextract=("$pkgname-$pkgver.tgz") -sha256sums=('e9a3d70b39fe388768f4c2efc931a2f199fc68f90e6c310ea51d02f2d58a6db2') +sha256sums=('e9a3d70b39fe388768f4c2efc931a2f199fc68f90e6c310ea51d02f2d58a6db2' + '6be9328337c8f17e83b24fbebee8c6258eb364044de0dce7238afde57eaf8ae6') package() { - npm install -g --user root --prefix "$pkgdir/usr" "$srcdir/$pkgname-$pkgver.tgz" - find "$pkgdir/usr" -type d -exec chmod 755 {} + + npm install -g --user root --prefix "$pkgdir/usr" "$srcdir/$pkgname-$pkgver.tgz" + find "$pkgdir/usr" -type d -exec chmod 755 {} + + # Remove references to $pkgdir - find "$pkgdir" -type f -print0 | xargs -0 sed -i "/_where/d" + 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/$pkgname/package.json" + jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage" + mv "$tmppackage" "$pkgjson" + chmod 644 "$pkgjson" + + # Install license since the package doesn't include it + install -Dm 644 "$srcdir/LICENSE" "$pkgdir/usr/shace/licenses/$pkgname/LICENSE" } |