-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmake-deb.sh
executable file
·55 lines (47 loc) · 960 Bytes
/
make-deb.sh
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
#! /bin/bash
set -e
if [ "$#" != 2 ]; then
echo "Usaga: $1 <input-tar-gz> <output-package>"
exit 1
fi
arch="`arch`"
if [ "$arch" == "aarch64" ]; then
arch=arm64
elif [ "$arch" == "x86_64" ]; then
arch=amd64
else
echo "Unsupported architecture: $arch"
exit 2
fi
rm -rf /tmp/nfpm-deb
mkdir -p /tmp/nfpm-deb
tar xzf "$1" -C /tmp/nfpm-deb
rm -rf /tmp/nfpm
mkdir -p /tmp/nfpm
cat <<EOF >/tmp/nfpm-deb.yaml
name: r-rig
version: ${VERSION}
release: 1
section: universe/math
priority: normal
arch: "${arch}"
maintainer: Gabor Csardi <csardi.gabor@gmail.com>
description: |
The R Installation Manager
vendor: Gabor Csardi
homepage: https://github.com/r-lib/rig
license: MIT
deb:
fields:
Bugs: https://github.com/r-lib/rig/issues
contents:
- src: /tmp/nfpm-deb
dst: /usr/local
EOF
nfpm package \
-f /tmp/nfpm-deb.yaml \
-p deb \
-t /tmp/nfpm
out="`ls /tmp/nfpm`"
cp "/tmp/nfpm/$out" .
ln -sf "`basename $out`" $2