-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
129 lines (113 loc) · 4.16 KB
/
Makefile.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_WORKSPACE_SKIP_MEMBERS = ["libcfgparser", "libinstall", "libshadow", "libsysconfig"]
CARGO_BUILD_TYPE = "debug"
skip_core_tasks = true
[env.development]
CARGO_BUILD_TYPE = "debug"
[env.production]
CARGO_BUILD_TYPE = "release"
[tasks.format]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--", "--emit=files"]
[tasks.clean]
command = "cargo"
args = ["clean"]
[tasks.build_all]
run_task = [
{ name = "build_debug", condition = { profiles = ["development"] } },
{ name = "build_release", condition = { profiles = ["production"] } },
]
[tasks.build_debug]
command = "cargo"
args = ["build"]
[tasks.build_release]
command = "cargo"
args = ["build", "--release", "--target", "x86_64-unknown-illumos"]
[tasks.test]
command = "cargo"
args = ["test"]
[tasks.check]
command = "cargo"
args = ["check"]
[tasks.install]
workspace = false
dependencies = ["build_all"]
run_task = [
{ name = "install_macos", condition = { platforms = ["mac"] } },
{ name = "install_linux", condition = { platforms = ["linux"] } },
{ name = "install_default" },
]
[tasks.install_macos]
workspace = false
env = {"INSTALL" = "/usr/local/bin/ginstall"}
run_task = { name = "run_install", fork = true }
[tasks.install_linux]
workspace = false
env = {"INSTALL" = "/usr/bin/install"}
run_task = { name = "run_install", fork = true }
[tasks.install_default]
workspace = false
env = {"INSTALL" = "/usr/bin/ginstall"} # For some reason cargo make does not detect the illumos platform properly thus make it the detault
run_task = { name = "run_install", fork = true }
[tasks.install_env]
[tasks.install_env.env]
"proto_dir" = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/prototype"
"syscfg_usr_lib" = "${proto_dir}/usr/lib/sysconfig"
"usr_bin" = "${proto_dir}/usr/bin"
"manifest_dir" = "${proto_dir}/lib/svc/manifest"
"build_dir" = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${CARGO_MAKE_RUST_TARGET_TRIPLE}/${CARGO_BUILD_TYPE}"
[tasks.package_tarball]
workspace = false
dependencies = ["install"]
script_runner = "bash"
script_extension = "bash"
script_runner_args = ["-e"]
script = '''
cd ${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/prototype
tar -czf ../illumos-installer.tar.gz *
'''
[tasks.package_ips]
workspace = false
dependencies = ["install"]
script_runner = "bash"
script_extension = "bash"
script_runner_args = ["-e"]
script = '''
cd ${CARGO_MAKE_CRATE_TARGET_DIRECTORY}
rm -rf manifests ${REPO_NAME}
mkdir manifests
pkgsend generate prototype | pkgfmt > manifests/${COMPONENT_NAME}.p5m.1
pkgmogrify \
-DCOMPONENT_NAME="${COMPONENT_NAME}" \
-DCOMPONENT_FMRI="${COMPONENT_FMRI}" \
-DIPS_COMPONENT_VERSION="${IPS_COMPONENT_VERSION}" \
-DBUILD_VERSION="${BUILD_VERSION}" \
-DCOMPONENT_SUMMARY="${COMPONENT_SUMMARY}" \
-DCOMPONENT_CLASSIFICATION="${COMPONENT_CLASSIFICATION}" \
-DCOMPONENT_PROJECT_URL="${COMPONENT_PROJECT_URL}" \
-DCONSOLIDATION="${CONSOLIDATION}" \
-DCOMPONENT_LICENSE_FILE="${COMPONENT_LICENSE_FILE}" \
-DCOMPONENT_LICENSE="${COMPONENT_LICENSE}" \
manifests/${COMPONENT_NAME}.p5m.1 ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/pkg/sysconfig.mog | pkgfmt > manifests/${COMPONENT_NAME}.p5m.2
pkgdepend generate -md prototype manifests/${COMPONENT_NAME}.p5m.2 | pkgfmt > manifests/${COMPONENT_NAME}.p5m.3
pkgdepend resolve -m manifests/${COMPONENT_NAME}.p5m.3
pkglint manifests/${COMPONENT_NAME}.p5m.3.res
pkgrepo create ${REPO_NAME}
pkgrepo -s ${REPO_NAME} set publisher/prefix=toasterson
pkgsend -s ${REPO_NAME} publish -d prototype -d ${CARGO_MAKE_WORKING_DIRECTORY} manifests/${COMPONENT_NAME}.p5m.3.res
pkgrecv -s ${REPO_NAME} -a -d ${COMPONENT_NAME}.p5p ${COMPONENT_FMRI}
'''
[tasks.package_ips.env]
"COMPONENT_NAME" = "sysconfig"
"COMPONENT_FMRI" = "service/management/${COMPONENT_NAME}"
"IPS_COMPONENT_VERSION" = "0.5.11"
"BUILD_VERSION" = "${IPS_COMPONENT_VERSION}-2022.0.1.0"
"COMPONENT_SUMMARY" = "A System configuration tool for configuring a new system"
"COMPONENT_CLASSIFICATION" = "org.opensolaris.category.2008:System/Administration and Configuration"
"COMPONENT_PROJECT_URL" = "https://openindiana.org"
"CONSOLIDATION" = "userland"
"COMPONENT_LICENSE_FILE" = "LICENSE"
"COMPONENT_LICENSE" = "MPL v2.0"
"REPO_NAME" = "repository"