diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2015-10-09 14:10:42 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2015-10-09 14:42:58 +0000 |
commit | 80245bcdcb77493fbe3d6789c98b96c570159960 (patch) | |
tree | e72446d9ff497eb8d0fdb12892f7bb11303be606 /scripts/packages/BUILD | |
parent | ec07479061adae837c460a1dabc5ee396bfc9abf (diff) |
Introduce debian and tar packaging rules
This refactor a bit the docker rules to reuse the tarball construction.
Also introduce the debian archive for the release process.
RELNOTES[NEW]: Debian and tar packaging is now supported
(see tools/build_defs/pkg/README.md).
--
MOS_MIGRATED_REVID=105053604
Diffstat (limited to 'scripts/packages/BUILD')
-rw-r--r-- | scripts/packages/BUILD | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/scripts/packages/BUILD b/scripts/packages/BUILD index d1383d5045..358ce074b5 100644 --- a/scripts/packages/BUILD +++ b/scripts/packages/BUILD @@ -41,3 +41,128 @@ self_extract_binary( "//tools:package-srcs", ], ) + +load("/tools/build_defs/pkg/pkg", "pkg_tar", "pkg_deb") + +pkg_tar( + name = "bazel-bin", + files = ["//src:bazel"], + mode = "0755", + package_dir = "/usr/bin", + strip_prefix = "/src", +) + +pkg_tar( + name = "bazel-rc", + files = ["debian/bazel.bazelrc"], + mode = "0644", + package_dir = "/etc", + strip_prefix = "debian", +) + +genrule( + name = "rename-bazel-completion", + srcs = ["//scripts:bash_completion"], + outs = ["etc/bash_completion.d/bazel"], + cmd = "cp $< $@", +) + +pkg_tar( + name = "bazel-completion", + files = [":etc/bash_completion.d/bazel"], + mode = "0644", +) + +pkg_tar( + name = "bazel-tools", + files = [ + "//third_party:srcs", + "//third_party/java/jdk/langtools:srcs", + "//tools:package-srcs", + ], + mode = "0644", + modes = {f: "0755" for f in [ + # List made out of `find -type f -executable` + "third_party/iossim/iossim", + "third_party/ijar/test/zip_test.sh", + "third_party/ijar/test/ijar_test.sh", + "third_party/ijar/test/testenv.sh", + "third_party/protobuf/protoc-osx-x86_32.exe", + "third_party/protobuf/protoc-linux-x86_64.exe", + "third_party/protobuf/protoc-osx-x86_64.exe", + "third_party/protobuf/protoc-linux-x86_32.exe", + "third_party/protobuf/protoc-windows-x86_32.exe", + "third_party/protobuf/protoc-windows-x86_64.exe", + "third_party/py/gflags/tests/flags_modules_for_testing/module_bar.py", + "third_party/py/gflags/tests/flags_modules_for_testing/module_baz.py", + "third_party/py/gflags/tests/flags_modules_for_testing/module_foo.py", + "third_party/py/gflags/tests/gflags_helpxml_test.py", + "third_party/py/gflags/tests/gflags_unittest.py", + "third_party/py/gflags/tests/gflags_validators_test.py", + "third_party/py/gflags/gflags2man.py", + "third_party/py/gflags/setup.py", + "third_party/py/gflags/debian/rules", + "third_party/py/gflags/gflags_validators.py", + "third_party/py/mock/setup.py", + "tools/android/jack/fail.sh", + "tools/android/shuffle_jars.sh", + "tools/android/merge_dexzips.sh", + "tools/android/idlclass.sh", + "tools/android/aar_generator.sh", + "tools/android/resources_processor.sh", + "tools/j2objc/j2objc_wrapper.py", + "tools/genrule/genrule-setup.sh", + "tools/objc/j2objc_dead_code_pruner.py", + "tools/python/2to3.sh", + "tools/cpp/osx_gcc_wrapper.sh", + "tools/test/test-setup.sh", + "tools/jdk/ijar", + "tools/build_defs/docker/testenv.sh", + "tools/build_defs/docker/build_test.sh", + ]}, + package_dir = "/usr/share/lib/bazel/tools", + strip_prefix = "/", +) + +pkg_tar( + name = "debian-data", + extension = "tar.gz", + tars = [ + ":bazel-bin", + ":bazel-completion", + ":bazel-tools", + ":bazel-rc", + ], +) + +genrule( + name = "embedded_label", + srcs = [":debian-data"], + outs = [ + "version.txt", + ], + cmd = "find -name stable-status.txt -exec cat '{}' ';' | grep EMBED_LABEL | cut -d ' ' -f 2- > $@\n", + stamp = 1, +) + +pkg_deb( + name = "bazel-debian", + architecture = "amd64", + built_using = "bazel (0.1.1)", + data = ":debian-data", + depends = [ + "openjdk-8-jdk", + "openjdk-8-source", + "pkg-config", + "zip", + "g++", + "zlib1g-dev", + "unzip", + "bash-completion", + ], + description_file = "debian/description", + homepage = "http://bazel.io", + maintainer = "The Bazel Authors <bazel-dev@googlegroups.com>", + package = "bazel", + version_file = ":version.txt", +) |