File bazel.spec of Package bazel

# spec file for package bazel
#
# Copyright (c) 2018 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# they warn against doing this ... :-\
%define _disable_source_fetch 0

Name:           bazel
Version:        0.15.0
Release:        0
Summary:        Correct, reproducible, and fast builds for everyone
License:        Apache-2.0
Group:          Development/Tools/Building
URL:            http://bazel.io/
Source0:        https://github.com/bazelbuild/bazel/archive/%{version}/%{name}-%{version}-dist.zip#/%{name}-%{version}-dist.zip
Source1:        https://github.com/bazelbuild/bazel/archive/%{version}/%{name}-%{version}-dist.zip.sig
BuildRequires:  java-1_8_0-openjdk-devel
BuildRequires:  zlib-devel
BuildRequires:  pkgconfig(bash-completion)
BuildRequires:  python
BuildRequires:  gcc-c++
BuildRequires:  unzip
BuildRequires:  zip
Requires:       java-1_8_0-openjdk-devel
#build it only on x86 64-bit until we fix it in other arch
#https://github.com/bazelbuild/bazel/issues/3643
ExclusiveArch:  x86_64
%define bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null)


%description
Correct, reproducible, and fast builds for everyone.
Build and test Java, C++, Android, iOS, Go and a wide
variety of other language platforms. 

%prep
%setup -q -c
#Remove executable permissions
chmod 0644 AUTHORS CHANGELOG.md CONTRIBUTORS LICENSE

%build
CC=gcc
CXX=g++
./compile.sh
#FIXME If not installing, why build?
#./output/bazel build //scripts:bazel-complete.bash
./output/bazel shutdown

%install
export NO_BRP_STRIP_DEBUG=true
export NO_DEBUGINFO_STRIP_DEBUG=true
%define __debug_install_post %nil
: >debugfiles.list
: >debugsources.list
: >debugsourcefiles.list

#mkdir -p %%{buildroot}/%%{bashcompdir}
install -Dm0755 output/bazel %{buildroot}%{_bindir}/bazel
#cp bazel-out/local-fastbuild/bin/scripts/bazel-complete.bash %%{buildroot}/%%{bashcompdir}/bazel

%files
%defattr(-,root,root)
%doc AUTHORS CHANGELOG.md CONTRIBUTORS
%license LICENSE
%{_bindir}/bazel
#%%{bashcompdir}/bazel


%changelog