-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-deb
More file actions
executable file
·77 lines (66 loc) · 2.5 KB
/
build-deb
File metadata and controls
executable file
·77 lines (66 loc) · 2.5 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
# Dependencies
function require_cmd { $1 >/dev/null 2>&1 || { echo "$2"; exit 1; } }
require_cmd "curl --version" "Please install curl."
require_cmd "pv --version" "Please install pv."
require_cmd "git --version" "Please install git."
require_cmd "jq --version" "Please install jq."
require_cmd "npm --version" "Please install npm."
require_cmd "convert -version" "Please install Imagemagick."
require_cmd "fpm --version" "Please install fpm."
echo "+ Cleaning Up"
rm -rf src work dist node_modules
echo "+ Preparing folders"
mkdir -p src work dist
echo "+ Getting source"
# LATEST_TARBALL=$(curl -s https://api.github.com/repos/Soundnode/soundnode-app/releases/latest | jq --raw-output ".tarball_url")
LATEST_TARBALL="https://codeload.github.com/Soundnode/soundnode-app/legacy.tar.gz/master"
curl -sL "$LATEST_TARBALL" | pv | tar --strip-components=1 -xz --directory src
VERSION="$(jq --raw-output '.version' src/package.json)"
echo "+ Extracting version number: $VERSION"
DIST="linux-x64"
echo "+ Building for arch: $DIST"
# Build
echo "+ Building"
pushd src &>/dev/null
npm install &>/dev/null
npm run package:linux &>/dev/null
popd &>/dev/null
DIST_DIR="src/dist/Soundnode/Soundnode-$DIST"
# Create package icon
echo "+ Creating icon"
convert -resize 48 src/app/soundnode.png work/soundnode-48x48.png
echo "+ Packaging .deb"
fpm -t deb \
-s dir \
--name "soundnode" \
--architecture "$ARCH" \
--license "GPL-3" \
--maintainer "Jonas Gröger <jonas@huntun.de>" \
--vendor "http://www.soundnodeapp.com/" \
--url "http://www.soundnodeapp.com/" \
--version "$VERSION" \
--depends "libgconf-2-4" \
--depends "libglib2.0-0" \
--depends "libnss3" \
--depends "libfontconfig1" \
--depends "libpangocairo-1.0-0" \
--depends "libxi6" \
--depends "libxcomposite1" \
--depends "libasound2" \
--depends "libxdamage1" \
--depends "libxtst6" \
--depends "libxrandr2" \
--depends "libgtk2.0-0" \
--depends "libnotify4" \
--category "sound" \
--iteration "1" \
--package "dist/" \
--description "Soundnode App is an Open-Source project to support Soundcloud for desktop Mac, Windows, and Linux." \
--after-install "packaging-files/create-symlink" \
--after-remove "packaging-files/remove-symlink" \
--deb-no-default-config-files \
"$DIST_DIR/.=/usr/share/soundnode/" \
"work/soundnode-48x48.png=/usr/share/icons/hicolor/48x48/apps/soundnode.png" \
"packaging-files/soundnode.desktop=/usr/share/applications/"
echo "+ Done"