-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathmkdeb.sh
More file actions
executable file
·44 lines (36 loc) · 1.24 KB
/
mkdeb.sh
File metadata and controls
executable file
·44 lines (36 loc) · 1.24 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
#!/bin/bash
set -euxo pipefail
_current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
_root_dir="$(cd "$_current_dir/.." && pwd)"
_release_dir="$_root_dir/build/release"
_spec="$_root_dir/package/helium-bin.spec"
_version=$(python3 "$_root_dir/helium-chromium/utils/helium_version.py" \
--tree "$_root_dir/helium-chromium" \
--platform-tree "$_root_dir" \
--print)
_tarball="$(realpath "${1:-}")"
if ! [ -f "$_tarball" ]; then
echo "usage: $0 <path to .tar.xz from release.sh" >&2
exit 1
fi
_tarball_basename="$(basename "$_tarball")"
case "$_tarball_basename" in
*x86_64*) _deb_arch="amd64" ;;
*arm64*) _deb_arch="arm64" ;;
*) exit 1;;
esac
_debbuild_dir=$(mktemp -d)
trap 'rm -rf "$_debbuild_dir"' EXIT
mkdir -p "$_debbuild_dir"/{BUILD,SOURCES,SPECS,DEBS}
ln -s "$_tarball" "$_debbuild_dir/SOURCES/"
cp "$_spec" "$_debbuild_dir/SPECS/"
debbuild \
--define "_topdir $_debbuild_dir" \
--define "debbuild 1" \
--define "version $_version" \
--define "_arch $_deb_arch" \
--define "dist %{nil}" \
-bb "$_debbuild_dir/SPECS/helium-bin.spec"
mkdir -p "$_release_dir"
mv "$_debbuild_dir"/DEBS/*/*.deb "$_release_dir/"
ls "$_release_dir"/*.deb