blob: ac8084b69ce6f30c7da5a7b64c7c6b0360748d79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# Maintainer: Gerald Wu <gerald at geraldwu dot com>
pkgname=cdktf-cli
pkgver=0.14.1
pkgrel=1
pkgdesc="Cloud Development Kit for Terraform"
arch=('any')
url="https://github.com/hashicorp/terraform-cdk"
license=('MPL2')
depends=('python' 'nodejs' 'terraform')
makedepends=('npm' 'jq')
noextract=("${pkgname}-${pkgver}.tgz")
source=("https://registry.npmjs.org/${pkgname}/-/${pkgname}-${pkgver}.tgz"
"https://raw.githubusercontent.com/hashicorp/terraform-cdk/master/LICENSE")
sha256sums=('7469a4cb94e324368b0965a05675747d0bac0ddfdc5ea0fa55d468fb940b04b1'
'8a318096d516c4b23566f94f4129260a9d4f72672dc52405573b619451f7b6c2')
package() {
# Install
npm install -s -g --cache "${srcdir}/npm-cache" --prefix "${pkgdir}/usr" "${srcdir}/${pkgname}-${pkgver}.tgz"
# Fix ownership of ALL FILES
find "${pkgdir}/usr" -type d -exec chmod 755 {} +
chown -R root:root "${pkgdir}"
# Remove references to $pkgdir
find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
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"
find "$pkgdir" -type f -name package.json | while read pkgjson; do
local tmppackage="$(mktemp)"
jq 'del(.man)' "$pkgjson" >"$tmppackage"
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
done
}
|