From 23279fb64e9866d15e2384d753ef9f56821abe93 Mon Sep 17 00:00:00 2001 From: Jisu-Woniu <31986081+Jisu-Woniu@users.noreply.github.com> Date: Tue, 19 Mar 2024 05:32:19 +0800 Subject: [PATCH] =?UTF-8?q?ci(actions):=20=F0=9F=93=A6=EF=B8=8F=20add=20pa?= =?UTF-8?q?ckaging=20stuff=20with=20Lintian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/testing.yml | 4 +++- Cargo.lock | 1 - Cargo.toml | 14 ++++++++------ debian/changelog | 5 +++++ debian/service | 3 +++ debian/tmpfile | 5 +++++ 6 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/tmpfile diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 81ce780..0657444 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -25,13 +25,15 @@ jobs: - name: Install dependencies run: | sudo apt-get update && sudo apt-get upgrade -y && \ - sudo apt-get install -y protobuf-compiler libprotobuf-dev lld + sudo apt-get install -y lld protobuf-compiler libprotobuf-dev lintian - name: Run clippy lint run: cargo hack clippy --all-targets --each-feature --workspace - name: Run tests run: cargo hack test --all-targets --each-feature --verbose --workspace - name: Build Debian package run: cargo xtask dist deb && dpkg-deb -c target/debian/*.deb + - name: Lint Debian package + run: lintian target/debian/*.deb - uses: actions/upload-artifact@v4 with: name: rsjudge-deb diff --git a/Cargo.lock b/Cargo.lock index d96841d..eb3af56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1102,7 +1102,6 @@ dependencies = [ "rsjudge-judger", "rsjudge-rest", "rsjudge-runner", - "serde", "tokio", "toml", ] diff --git a/Cargo.toml b/Cargo.toml index 20281ad..a22a792 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ authors.workspace = true edition = "2021" license.workspace = true rust-version.workspace = true -description = "An online judge sandbox server in Rust." +description = "online judge sandbox server in Rust" [package.metadata.deb] assets = [ @@ -63,14 +63,17 @@ assets = [ ], ] copyright = "2023-2024 NJUPT-SAST" +changelog = "debian/changelog" features = ["default"] conf-files = ["/etc/rsjudge/server.toml", "/etc/rsjudge/executors.toml"] +extended-description = "An online judge sandbox server in Rust, inspired by go-judge, for SAST OJ." +maintainer = "Xiaoqing Xuan " maintainer-scripts = "debian/" -depends = "$auto, libc6, libgcc-s1, libstdc++6, libssl1.1, libzstd1, libzstd-dev" +depends = "$auto, adduser, libc6, libgcc-s1, libstdc++6, libssl1.1, libzstd1, libzstd-dev" recommends = "gcc, g++, python3" suggests = "pypy3" +section = "net" systemd-units = { enable = false } -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] # Workspace dependencies @@ -86,14 +89,13 @@ caps = "0.5.5" clap = { version = "4.5.3", features = ["derive"] } env_logger = "0.11.3" log = "0.4.21" -serde = { version = "1.0.197", features = ["derive"] } tokio = { version = "1.36.0", features = ["fs", "rt-multi-thread", "macros"] } -toml = "0.8.11" +toml = "0.8.12" # Unused for now: # cgroups = "0.1.0" -# duct = "0.13.7" # nix = { version = "0.27.1", features = ["fs"] } +# serde = { version = "1.0.197", features = ["derive"] } # strfmt = "0.2.4" # uzers = "0.11.3" diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..9274f9e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +rsjudge (0.1.0-1) UNRELEASED; urgency=low + + * Initial release + +-- Xiaoqing Xuan Tue, 19 Mar 2024 03:56:24 +0800 \ No newline at end of file diff --git a/debian/service b/debian/service index fdbffb6..dd2d973 100644 --- a/debian/service +++ b/debian/service @@ -1,5 +1,8 @@ [Unit] Description=RsJudge autostart service. +Documentation=man:rsjudge(1) +Wants=network-online.target +After=network-online.target [Service] ExecStart=/usr/bin/rsjudge --config /etc/rsjudge/ diff --git a/debian/tmpfile b/debian/tmpfile new file mode 100644 index 0000000..4fd39bd --- /dev/null +++ b/debian/tmpfile @@ -0,0 +1,5 @@ +#Type Path Mode User Group Age Argument +d /var/lib/rsjudge-supervisor 0700 rsjudge-supervisor rsjudge-supervisor - - +d /var/log/rsjudge-supervisor 0755 rsjudge-supervisor rsjudge-supervisor - - +d /var/lib/rsjudge-builder 0700 rsjudge-builder rsjudge-builder - - +d /var/lib/rsjudge-runner 0700 rsjudge-runner rsjudge-runner - -