-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCargo.toml
107 lines (92 loc) · 5.21 KB
/
Cargo.toml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Define a workspace to ensure compatibility with workspaces:
[workspace]
members = [
"adder"
]
[package]
name = "mytest"
description = "Long enough for Lintian, short enough and without period for rpmlint"
version = "0.1.1"
edition = "2021"
authors = ["Some Author <[email protected]>"]
homepage = "https://github.com/NLnetLabs/ploutos-testing"
# Per https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields
# this must be one of the short IDs at https://github.com/spdx/license-list-data/blob/v3.11/licenses.md
license = "BSD-3-Clause"
[dependencies]
adder = { path = "adder" }
[package.metadata.deb]
name = "mytest"
priority = "optional"
section = "net"
extended-description-file = "pkg/debian/description.txt"
license-file = ["LICENSE", "0"]
depends = "$auto, passwd, libssl1.1" # your application/(pre|post|un)install script dependencies
maintainer-scripts = "pkg/debian/"
changelog = "target/debian/changelog" # this will be generated by the pkg workflow
copyright = "Copyright (c) 2022, Your Company. All rights reserved."
assets = [
["target/release/mytest", "/usr/bin/mytest", "755"],
]
systemd-units = { unit-name = "mytest", unit-scripts = "pkg/common", enable = true }
# By adding the variants defined below we will also then need to provide variant specific systemd files.
# In pkg/common/ you will see symbolic links used to ensure that the systemd unit files around. Note that
# if they are missing there will be no failure from cargo-deb during packaging, the failure is only
# detected during the pkg-test phase (and as that phase is disabled for Debian Stretch and Debian Buster
# because the LXC images don't exist/don't work properly) the fact that buster specific variant below has
# no corresponding sym link in pkg/common/ doesn't actually cause our workflow to fail... Maybe cargo-deb
# should warn about expected but missing systemd files? Maybe cargo-deb should fallback to the non-variant
# specific unit files?
[package.metadata.deb.variants.ubuntu-jammy]
depends = "$auto, passwd, libssl3"
maintainer = "Ubuntu Jammy Maintainer <[email protected]>"
[package.metadata.deb.variants.debian-buster-arm-unknown-linux-gnueabihf]
depends = "adduser, passwd, libc6 (>= 2.27), libssl1.1"
[package.metadata.deb.variants.debian-bookworm]
depends = "$auto, passwd, libssl3"
[package.metadata.deb.variants.ubuntu-noble]
depends = "$auto, passwd, libssl3"
[package.metadata.deb.variants.minimal]
depends = "libc6 (>= 2.27), rsync" # a deliberately different dependency that we can test for on older O/S's.
maintainer = "Minimal Maintainer <[email protected]>"
[package.metadata.deb.variants.minimal-cross]
depends = "adduser, passwd, libc6 (>= 2.27), libssl1.1"
maintainer = "Minimal Cross Maintainer <[email protected]>"
[package.metadata.generate-rpm]
name = "mytest"
# "BSD" is the 3-clause license. Inheriting "license" from above causes rpmlint to complain with "invalid-license".
# See: https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing
license = "BSD"
assets = [
{ source = "target/release/mytest", dest = "/usr/bin/mytest", mode = "755" },
# For DEB packages the service unit file is detected and handled automatically, but for RPM packages we have to
# add it manually as an asset. To support different service unit files for different "variants" defined in this
# file the NLnet Labs Rust Cargo Packaging workflow copies the file specified by setting `systemd_service_unit_file`
# variable in the `package_build_rules` matrix to `target/rpm/mytest.*` (where `pkg` is also a matrix variable).
{ source = "target/rpm/mytest.mytest.service", dest = "/lib/systemd/system/mytest.service", mode = "644" },
{ source = "target/rpm/mytest.mytest.timer", dest = "/lib/systemd/system/mytest.timer", mode = "644" },
]
# These get set using cargo-generate-rpm --set-metadata at package build time, but only if Ploutos was given an
# `rpm_scriptlets_path` that points to a file that exists.
#post_install_script = ...
#pre_uninstall_script = ...
#post_uninstall_script = ...
[package.metadata.generate-rpm-alt-base-myalt]
# This section defines an "alternate" package, i.e. has the "alt-base-<PKG_NAME>" section name extension, it will
# be ignored by the cargo generate-rpm plugin. Instead Ploutos will replace the main [package.metadata.generate-rpm]
# section with this one. Also, if the Ploutos input 'rpm_scriptlets_path' was provided, Ploutos will look for a file
# at '<rpm_scriptlets_path>-<PKG_NAME>' instead of at '<rpm_scriptlets_path>' allowing this package to use alternate
# scripts (or the same scripts via a symbolic link) to the main package.
#
# This is for testing building of a second RPM package using different settings than the main package. In this case
# the main package will have RPM scriptlets injected into it, while this one should not (as the source tree does not
# contain a pkg/rpm/scriptlets-altpkg.toml file). This package also deliberately lacks the systemd unit files that the
# scriptlets refer to.
name = "myalt"
license = "BSD"
assets = [
{ source = "target/release/mytest", dest = "/usr/bin/myalt", mode = "755" },
]
# ensure that the useradd is present by requiring the package that provides it
[package.metadata.generate-rpm.requires]
shadow-utils = "*"