-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: build rpm packages (#4632)
Unfortunately, the new style rpm_rules (the ones that I find remotely usable) do not appear to support cross-architecture packaging yet. So, this is x86_64 only for now. Fixes #4425 --------- Co-authored-by: FR4NK-W <[email protected]>
- Loading branch information
1 parent
7956be9
commit e6b0576
Showing
9 changed files
with
421 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
load(":package.bzl", "scion_pkg_deb") | ||
load(":package.bzl", "scion_pkg_ipk") | ||
load(":package.bzl", "scion_pkg_deb", "scion_pkg_ipk", "scion_pkg_rpm") | ||
load(":platform.bzl", "multiplatform_filegroup") | ||
load(":git_version.bzl", "git_version") | ||
|
||
|
@@ -10,6 +9,10 @@ DEB_PLATFORMS = [ | |
"@io_bazel_rules_go//go/toolchain:linux_arm", | ||
] | ||
|
||
RPM_PLATFORMS = [ | ||
"@io_bazel_rules_go//go/toolchain:linux_amd64", | ||
] | ||
|
||
# TODO([email protected]): | ||
# For now only a single openwrt platform can be in this list. If we allow several, they get | ||
# built in parallel, which breaks on non-reentrant openwrt makefiles. For a single platform | ||
|
@@ -221,3 +224,116 @@ multiplatform_filegroup( | |
target_platforms = OPENWRT_PLATFORMS, | ||
visibility = ["//dist:__subpackages__"], | ||
) | ||
|
||
scion_pkg_rpm( | ||
name = "router_rpm", | ||
depends = [ | ||
"/sbin/adduser", | ||
], | ||
description = "SCION inter-domain network architecture border router", | ||
executables = { | ||
"//router/cmd/router:router": "scion-router", | ||
}, | ||
package = "scion-router", | ||
postinst = "rpm/scion.postinst", | ||
systemds = ["systemd/[email protected]"], | ||
version_file = ":git_version", | ||
) | ||
|
||
scion_pkg_rpm( | ||
name = "control_rpm", | ||
configs = [], | ||
depends = [ | ||
"/sbin/adduser", | ||
"scion-dispatcher", | ||
], | ||
description = "SCION inter-domain network architecture control service", | ||
executables = { | ||
"//control/cmd/control:control": "scion-control", | ||
}, | ||
package = "scion-control", | ||
systemds = ["systemd/[email protected]"], | ||
version_file = ":git_version", | ||
) | ||
|
||
scion_pkg_rpm( | ||
name = "dispatcher_rpm", | ||
configs = ["conffiles/dispatcher.toml"], | ||
depends = [ | ||
"/sbin/adduser", | ||
], | ||
description = "SCION dispatcher", | ||
executables = { | ||
"//dispatcher/cmd/dispatcher:dispatcher": "scion-dispatcher", | ||
}, | ||
package = "scion-dispatcher", | ||
postinst = "rpm/scion.postinst", | ||
systemds = ["systemd/scion-dispatcher.service"], | ||
version_file = ":git_version", | ||
) | ||
|
||
scion_pkg_rpm( | ||
name = "daemon_rpm", | ||
configs = ["conffiles/daemon.toml"], | ||
depends = [ | ||
"/sbin/adduser", | ||
], | ||
description = "SCION daemon", | ||
executables = { | ||
"//daemon/cmd/daemon:daemon": "scion-daemon", | ||
}, | ||
package = "scion-daemon", | ||
postinst = "rpm/scion.postinst", | ||
systemds = ["systemd/scion-daemon.service"], | ||
version_file = ":git_version", | ||
) | ||
|
||
scion_pkg_rpm( | ||
name = "gateway_rpm", | ||
configs = [ | ||
"conffiles/gateway.json", | ||
"conffiles/gateway.toml", | ||
], | ||
depends = [ | ||
"/sbin/adduser", | ||
"scion-dispatcher", | ||
"scion-daemon", | ||
], | ||
description = "SCION-IP Gateway", | ||
executables = { | ||
"//gateway/cmd/gateway:gateway": "scion-ip-gateway", | ||
}, | ||
package = "scion-ip-gateway", | ||
systemds = ["systemd/scion-ip-gateway.service"], | ||
version_file = ":git_version", | ||
) | ||
|
||
scion_pkg_rpm( | ||
name = "tools_rpm", | ||
depends = [ | ||
"/sbin/adduser", | ||
"scion-dispatcher", | ||
"scion-daemon", | ||
], | ||
description = "SCION tools", | ||
executables = { | ||
"//scion/cmd/scion:scion": "scion", | ||
"//scion-pki/cmd/scion-pki:scion-pki": "scion-pki", | ||
}, | ||
package = "scion-tools", | ||
version_file = ":git_version", | ||
) | ||
|
||
multiplatform_filegroup( | ||
name = "rpm", | ||
srcs = [ | ||
"control_rpm", | ||
"daemon_rpm", | ||
"dispatcher_rpm", | ||
"gateway_rpm", | ||
"router_rpm", | ||
"tools_rpm", | ||
], | ||
target_platforms = RPM_PLATFORMS, | ||
visibility = ["//dist:__subpackages__"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Create system user/group | ||
groupadd --system -f scion | ||
useradd --system --gid scion -M -s /sbin/nologin scion >& /dev/null || true | ||
|
||
# Create configuration directory | ||
mkdir /etc/scion/ >& /dev/null || true | ||
mkdir /var/lib/scion/ >& /dev/null || true | ||
chown scion:scion /etc/scion/ /var/lib/scion | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM fedora:40 | ||
|
||
RUN dnf --assumeyes install systemd | ||
|
||
ENV container docker | ||
|
||
# Only "boot" a minimal system with journald and nothing else | ||
CMD ["/usr/lib/systemd/systemd", "--unit", "systemd-journald.service"] |
Oops, something went wrong.