-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.gn
92 lines (78 loc) · 1.82 KB
/
BUILD.gn
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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import("//build/copy_target_outputs.gni")
import("//build/rpmbuild.gni")
import("//build/substitute_file.gni")
import("//build/symlink.gni")
action("archive") {
outputs = [ "$target_out_dir/nsbox-sources.tar" ]
depfile = "$target_gen_dir/nsbox-sources.d"
script = "//build/source_archive.py"
args = [
"--source-root",
rebase_path("//", root_build_dir),
"--prefix",
"$product_name-$release_version",
"--out-tar",
rebase_path(outputs[0], root_build_dir),
"--out-dep",
rebase_path(depfile, root_build_dir),
"--include-vendor",
]
}
substitute_file("nsbox.spec") {
deps = [ "//:release_files" ]
source = "nsbox.spec"
vars = [
[
"PRODUCT_NAME",
product_name,
],
[
"RDNS_NAME",
rdns_name,
],
[
"VERSION",
release_version,
],
[
"COMMIT",
release_commit,
],
]
}
rpmbuild("rpm") {
package_name = product_name
version = release_version
release = "1"
has_debug = true
extra_binary_packages = [ "$product_name-bender" ]
extra_noarch_packages = [ "$product_name-selinux" ]
if (!is_stable_build) {
extra_binary_packages += [
"nsbox-edge-alias",
"nsbox-edge-bender-alias",
]
}
archive_source = get_target_outputs(":archive")
substituted_spec = get_target_outputs(":nsbox.spec")
spec = substituted_spec[0]
sources = [ archive_source[0] ]
deps = [
":archive",
":nsbox.spec",
]
}
copy_target_outputs("install") {
deps = [
":archive",
":nsbox.spec",
":rpm",
]
outputs = [ "$root_build_dir/rpm/{{source_file_part}}" ]
}
group("fedora") {
deps = [ ":install" ]
}