summaryrefslogtreecommitdiff
path: root/devel/npm/MAKEPKG
blob: 88580d81a6615f7f0a73bb4f5a041257009bb3ba (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/mkpkg
# description: Package manager for JavaScript
# url: https://www.npmjs.com/

name=npm
version=12.1.0
release=1
depends=(nodejs)
source=(https://registry.npmjs.org/$name/-/$name-$version.tgz)
sha256sums=(
    "f08e674e31eb99931df2297aa55c274bf9bebd90679dad57fdbe9683907a3325"
)

build() {
    cd package

    # Windows launchers and helper scripts
    rm -f bin/npm.cmd bin/npx.cmd bin/npm.ps1 bin/npx.ps1
    rm -f bin/node-gyp-bin/node-gyp.cmd
    find . -name '*.cmd' -delete
    find . -name '*.ps1' -delete

    install -d $PKG/usr/lib/node_modules/npm
    cp -a bin docs lib man node_modules index.js package.json LICENSE \
        $PKG/usr/lib/node_modules/npm/

    chmod 755 $PKG/usr/lib/node_modules/npm/bin/npm-cli.js
    chmod 755 $PKG/usr/lib/node_modules/npm/bin/npx-cli.js

    install -d $PKG/usr/bin
    ln -sf ../lib/node_modules/npm/bin/npm-cli.js $PKG/usr/bin/npm
    ln -sf ../lib/node_modules/npm/bin/npx-cli.js $PKG/usr/bin/npx

    # System man pages.
    mandir="$PKG/usr/share/man"
    for f in man/man1/*.1; do
        install -Dm644 "$f" "$mandir/man1/$(basename $f)"
    done
    for f in man/man5/*.5; do
        install -Dm644 "$f" "$mandir/man5/$(basename $f)"
    done
    for f in man/man7/*.7; do
        install -Dm644 "$f" "$mandir/man7/$(basename $f)"
    done

    find $PKG/usr/lib/node_modules -type f \( \
        -iname 'README*' -o \
        -iname 'CHANGELOG*' -o \
        -iname 'AUTHORS*' -o \
        -iname 'HISTORY*' -o \
        -iname 'CONTRIBUTING*' \) -delete
}

signify() {
    untrusted comment: public key
    RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
}

# vim: filetype=sh