Skip to content

Commit e07ba25

Browse files
authored
fix(packaging): declare libcap dependency for setcap (deb + rpm) (#24)
The post-install scripts run 'setcap cap_net_admin+ep' to grant CAP_NET_ADMIN, without which akon cannot create the TUN device. setcap was not declared as a package dependency, so on a system lacking it the install only printed a warning and akon silently failed to connect until libcap was installed manually. Declare the dependency so the package manager pulls it in: - deb: depends = libcap2-bin - rpm: requires libcap
1 parent b51cc2d commit e07ba25

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎Cargo.toml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ automatic reconnection and health checks. It runs as the user; only TUN/route
3030
setup needs CAP_NET_ADMIN (granted via `setcap cap_net_admin+ep`)."""
3131
section = "net"
3232
priority = "optional"
33+
# setcap (from libcap2-bin) is required by the post-install script to grant
34+
# CAP_NET_ADMIN; without it akon cannot create the TUN device.
35+
depends = "libcap2-bin"
3336
assets = [
3437
["target/release/akon", "usr/bin/", "755"],
3538
["README.md", "usr/share/doc/akon/", "644"],
@@ -40,6 +43,9 @@ maintainer-scripts = "debian/"
4043

4144
# RPM package metadata for cargo-generate-rpm
4245
[package.metadata.generate-rpm]
46+
# setcap (from libcap) is required by the post-install script to grant
47+
# CAP_NET_ADMIN; without it akon cannot create the TUN device.
48+
requires = { libcap = "*" }
4349
assets = [
4450
{ source = "target/release/akon", dest = "/usr/bin/akon", mode = "755" },
4551
{ source = "README.md", dest = "/usr/share/doc/akon/README.md", mode = "644" },

0 commit comments

Comments
 (0)