bazel.spec 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. ##
  2. ## bazel.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2017 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: bazel
  25. Summary: Google's Build Tool
  26. URL: http://bazel.io/
  27. Vendor: Google
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: Building
  32. License: GPL
  33. Version: 0.8.0
  34. Release: 20171127
  35. # list of sources
  36. Source0: https://github.com/bazelbuild/bazel/releases/download/%{version}/bazel-%{version}-dist.zip
  37. Patch0: bazel.patch
  38. # build information
  39. BuildPreReq: OpenPKG, openpkg >= 20160101, java, JAVA-JDK
  40. PreReq: OpenPKG, openpkg >= 20160101, java, JAVA-JDK
  41. %description
  42. Bazel is Google's own build tool. It has built-in support for
  43. building both client and server software, including client
  44. applications for both Android and iOS platforms. It also provides
  45. an extensible framework that you can use to develop your own build
  46. rules.
  47. %track
  48. prog bazel = {
  49. version = %{version}
  50. url = https://github.com/bazelbuild/bazel/releases
  51. regex = (\d+\.\d+\.\d+)\.tar\.gz
  52. }
  53. %prep
  54. %setup -q -c
  55. chmod 644 scripts/bootstrap/bootstrap.sh
  56. chmod 644 src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
  57. %patch -p0
  58. %build
  59. %{l_shtool} subst %{l_value -s -a} \
  60. src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
  61. %{l_shtool} subst \
  62. -e "s;/etc/bazel.bazelrc;%{l_prefix}/etc/bazel.bazelrc;" \
  63. src/main/cpp/blaze_util_posix.cc
  64. %{l_shtool} subst \
  65. -e 's;/bin/bash;%{l_bash};g' \
  66. tools/cpp/link_dynamic_library.sh
  67. echo "build --strategy=Javac=standalone" >>scripts/packages/debian/bazel.bazelrc
  68. eval `%{l_prefix}/bin/java-toolkit -e`
  69. export PROTOC=%{l_prefix}/bin/protoc
  70. export BAZEL_SH=%{l_bash}
  71. if [ -x %{l_prefix}/bin/bazel ]; then
  72. %{l_bash} compile.sh compile %{l_prefix}/bin/bazel
  73. else
  74. %{l_bash} compile.sh compile
  75. fi
  76. %install
  77. %{l_shtool} mkdir -f -p -m 755 \
  78. $RPM_BUILD_ROOT%{l_prefix}/bin \
  79. $RPM_BUILD_ROOT%{l_prefix}/etc/bazel \
  80. $RPM_BUILD_ROOT%{l_prefix}/libexec/bazel
  81. %{l_shtool} install -c -m 755 \
  82. output/bazel $RPM_BUILD_ROOT%{l_prefix}/libexec/bazel/bazel
  83. ( echo "#!/bin/sh"
  84. echo "BAZEL_SH=%{l_bash}; export BAZEL_SH"
  85. echo "exec %{l_prefix}/libexec/bazel/bazel \${1+\"\$@\"}"
  86. ) >$RPM_BUILD_ROOT%{l_prefix}/bin/bazel
  87. chmod a+x $RPM_BUILD_ROOT%{l_prefix}/bin/bazel
  88. %{l_shtool} install -c -m 644 \
  89. scripts/packages/debian/bazel.bazelrc \
  90. $RPM_BUILD_ROOT%{l_prefix}/etc/bazel/
  91. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  92. %{l_files_std} \
  93. '%config %{l_prefix}/etc/bazel/*'
  94. %files -f files
  95. %clean