-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/bazelbuild/rules_pkg
- Loading branch information
Showing
33 changed files
with
573 additions
and
95 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
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
Empty file.
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,55 @@ | ||
# Copyright 2020 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
load("@rules_pkg//pkg:mappings.bzl", "pkg_files") | ||
load("@rules_pkg//pkg:rpm.bzl", "pkg_rpm") | ||
|
||
cc_binary( | ||
name = "test", | ||
copts = ["-g"], | ||
srcs = [ | ||
"test.c", | ||
], | ||
) | ||
|
||
pkg_files( | ||
name = "rpm_files", | ||
srcs = [ | ||
":test", | ||
], | ||
) | ||
|
||
pkg_rpm( | ||
name = "test-rpm", | ||
srcs = [ | ||
":rpm_files", | ||
], | ||
release = "0", | ||
version = "1", | ||
license = "Some license", | ||
summary = "Summary", | ||
description = "Description", | ||
debuginfo = True, | ||
) | ||
|
||
# If you have rpmbuild, you probably have rpm2cpio too. | ||
# Feature idea: Add rpm2cpio and cpio to the rpmbuild toolchain | ||
genrule( | ||
name = "inspect_content", | ||
srcs = [":test-rpm"], | ||
outs = ["content.txt"], | ||
cmd = "rpm2cpio $(locations :test-rpm) | cpio -ivt >$@", | ||
) |
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,32 @@ | ||
# Copyright 2024 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
module(name = "rules_pkg_example_rpm_system_rpmbuild_bzlmod") | ||
|
||
bazel_dep(name = "rules_pkg") | ||
|
||
local_path_override( | ||
module_name = "rules_pkg", | ||
path = "../../..", | ||
) | ||
|
||
find_rpmbuild = use_extension( | ||
"@rules_pkg//toolchains/rpm:rpmbuild_configure.bzl", | ||
"find_system_rpmbuild_bzlmod", | ||
) | ||
use_repo(find_rpmbuild, "rules_pkg_rpmbuild") | ||
|
||
register_toolchains( | ||
"@rules_pkg_rpmbuild//:all", | ||
) |
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,17 @@ | ||
# Using system rpmbuild with bzlmod and generating debuginfo | ||
|
||
## Summary | ||
|
||
This example uses the `find_system_rpmbuild_bzlmod` module extension to help | ||
us register the system rpmbuild as a toolchain in a bzlmod environment. | ||
|
||
It configures the system toolchain to be aware of which debuginfo configuration | ||
to use (defaults to "none", the example uses "centos7"). | ||
|
||
## To use | ||
|
||
``` | ||
bazel build :* | ||
rpm2cpio bazel-bin/test-rpm.rpm | cpio -ivt | ||
cat bazel-bin/content.txt | ||
``` |
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,3 @@ | ||
int main() { | ||
return 0; | ||
} |
Empty file.
Empty file.
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
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
Oops, something went wrong.