-
Notifications
You must be signed in to change notification settings - Fork 3
/
package.yml
35 lines (29 loc) · 911 Bytes
/
package.yml
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
apiVersion: coprctl/v1alpha1
kind: package-custom
metadata:
name: nodejs-licenseify
spec:
auto_rebuild: false
projectname: "joshiverse"
script-builddeps: "nodejs-npm rpmspectool"
script-chroot: fedora-latest-x86_64
script-repos: ""
script-resultdir: ""
script: |
#!/usr/bin/env bash
set -euxo pipefail
package='licenseify'
strategy='bundle'
version="$(npm view "${package}" version)"
npx npm2rpm -n "${package}" -v "${version}" -s "${strategy}"
# TODO: -o flag?
mv npm2rpm/* ./
rmdir npm2rpm
# 1. Use system npm instead of bundled npm
# 2. License and doc paths are broken so don't include them
cat "nodejs-${package}.spec" \
| sed 's/BuildRequires: %{?scl_prefix_nodejs}npm/BuildRequires: nodejs-npm/' \
| sed 's/\%license .*//' \
| sed 's/\%doc .*//' \
> modified.spec
mv modified.spec "nodejs-${package}.spec"