dist/debian: add "flood-bin" package files

This commit is contained in:
Jesse Chan
2021-02-06 12:31:43 +08:00
parent 89531336ee
commit cfd0a4338b
4 changed files with 154 additions and 1 deletions

View File

@@ -6,6 +6,6 @@ Tools used for installation: `pacman`
`flood` folder contains a working `PKGBUILD`, inspired by [nodejs-yaml](https://github.com/archlinux/svntogit-community/blob/packages/nodejs-yaml/trunk/PKGBUILD) and [nodejs-nativefier](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=nodejs-nativefier). It uses Node.js runtime of system. It complies with Arch Linux package guidelines and should be suitable for submission to Arch Linux official repository.
A CI automatically push new releases to AUR (Arch User Repository).
A CI workflow automatically pushes new releases to AUR (Arch User Repository).
Note that checksum is not included in the file. Update it with `updpkgsums` when necessary.

View File

@@ -9,3 +9,11 @@ Tools used for installation: `apt`, `dpkg`
Some changes would be needed to make it fully comply with Debian policies. Specially, Debian prefers the package to use Git repository as source instead of published tar bundle from npm registry. However, maintainer of this project notes that Debian's own collection of JavaScript packages is severely out-of-date, and, as a result, it would take significant efforts to add the whole dependency tree of this project to Debian.
No continuous integration is planned.
**flood-bin**
`flood-bin` folder contains [Bazel](https://bazel.build) rules that use standalone executables to create Debian packages. It is compatible with any distribution that is able to install `.deb` package.
To build, copy its contents to the root of repository, compile Flood (by `npm build` or extracting a tarball) and run `bazel build flood-deb-x64 (or flood-deb-arm64)`. The result `.deb` is available in `bazel-bin`.
A CI workflow automatically pushes new releases to [Releases](https://github.com/jesec/flood/releases) and [deb.jesec.io](https://deb.jesec.io).

View File

@@ -0,0 +1,132 @@
load("@rules_pkg//:pkg.bzl", "pkg_deb", "pkg_tar")
DESCRIPTION = "modern web user interface for various torrent clients"
HOMEPAGE = "https://github.com/jesec/flood"
MAINTAINER = "replace-with-your-name <to-be-determined@tbd>"
PACKAGE = "flood"
RECOMMENDS = ["mediainfo"]
VERSION = "4.4.0-0"
genrule(
name = "flood-pkg-arm64",
srcs = [
"dist/index.js",
"package.json",
] + glob(["node_modules/**/*"]),
outs = ["arm64/flood"],
cmd = "pkg $$(dirname $(location package.json)) -t node14-linuxstatic-arm64 --out-path $(RULEDIR)/arm64",
executable = True,
)
genrule(
name = "flood-pkg-x64",
srcs = [
"dist/index.js",
"package.json",
] + glob(["node_modules/**/*"]),
outs = ["x64/flood"],
cmd = "pkg $$(dirname $(location package.json)) -t node14-linuxstatic-x64 --out-path $(RULEDIR)/x64",
executable = True,
)
pkg_tar(
name = "flood-assets",
srcs = glob(["dist/assets/**/*"]),
mode = "0644",
package_dir = "/usr/share/flood/assets",
strip_prefix = "/dist/assets",
)
pkg_tar(
name = "flood-bin-arm64",
srcs = [":flood-pkg-arm64"],
mode = "0755",
package_dir = "/usr/bin",
strip_prefix = "/arm64",
)
pkg_tar(
name = "flood-bin-x64",
srcs = [":flood-pkg-x64"],
mode = "0755",
package_dir = "/usr/bin",
strip_prefix = "/x64",
)
pkg_tar(
name = "flood-docs",
srcs = [
"CHANGELOG.md",
"LICENSE",
"README.md",
"SECURITY.md",
],
mode = "0644",
package_dir = "/usr/share/doc/flood",
strip_prefix = "/",
)
pkg_tar(
name = "flood-service",
srcs = ["distribution/shared/flood@.service"],
mode = "0644",
package_dir = "/etc/systemd/system",
strip_prefix = "/distribution/shared",
)
pkg_tar(
name = "flood-deb-data-arm64",
extension = "tar.gz",
deps = [
":flood-assets",
":flood-bin-arm64",
":flood-docs",
":flood-service",
],
)
pkg_tar(
name = "flood-deb-data-x64",
extension = "tar.gz",
deps = [
":flood-assets",
":flood-bin-x64",
":flood-docs",
":flood-service",
],
)
CONFFILES = [
"/etc/systemd/system/flood@.service",
]
pkg_deb(
name = "flood-deb-arm64",
architecture = "arm64",
conffiles = CONFFILES,
data = ":flood-deb-data-arm64",
description = DESCRIPTION,
homepage = HOMEPAGE,
maintainer = MAINTAINER,
package = PACKAGE,
recommends = RECOMMENDS,
version = VERSION,
)
pkg_deb(
name = "flood-deb-x64",
architecture = "amd64",
conffiles = CONFFILES,
data = ":flood-deb-data-x64",
description = DESCRIPTION,
homepage = HOMEPAGE,
maintainer = MAINTAINER,
package = PACKAGE,
recommends = RECOMMENDS,
version = VERSION,
)

View File

@@ -0,0 +1,13 @@
workspace(name = "flood")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_pkg",
sha256 = "6b5969a7acd7b60c02f816773b06fcf32fbe8ba0c7919ccdc2df4f8fb923804a",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.3.0/rules_pkg-0.3.0.tar.gz",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()