File golang-l3t.spec of Package golang-l3t

#
# spec file for package golang
#
# Copyright (c) 2018 SUSE LINUX 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/
#


%global provider        github
%global provider_tld    com
%global project         bhdn
%global repo            golang-l3t
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path     %{provider_prefix}

Name:           golang-l3t
Version:        0.0.1
Release:        0
Summary:        This is l3t
License:        LGPL-3.0
Group:          Development/Languages/Other
Url:            https://%{provider_prefix}
Source0:        %{repo}-%{version}.tar.gz
Source1:	vendor.tar.gz
Source2:	l3t-autocomplete.sh
Conflicts:      l3t
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  golang-packaging
BuildRequires:  fdupes

%{go_nostrip}
%{go_provides}
%{go_exclusivearch}

%description
l3t in golang

%prep
%setup -q
tar xf %{SOURCE1}
rm -f go.{mod,sum}

%build
%goprep %{import_path}
%gobuild l3t/

%install
%goinstall
%__install -D -m 0755 %{SOURCE2} %{buildroot}%{_sysconfdir}/bash_completion.d/l3t.sh
for alias in bzag bze bzg bzo l3ac l3an l3as l3g l3ls l3n l3o l3p l3s l3se l3srg l3t-ptf-create l3t-make-sr-links l3t-split-supportconfig l3t-showrc l3z; do
  %__ln_s %{_bindir}/l3t %{buildroot}%{_bindir}/$alias
done

%files
%defattr(-,root,root)
%{_bindir}/l3t
%{_bindir}/bzag
%{_bindir}/bzg
%{_bindir}/bze
%{_bindir}/bzo
%{_bindir}/l3ac
%{_bindir}/l3an
%{_bindir}/l3as
%{_bindir}/l3g
%{_bindir}/l3ls
%{_bindir}/l3n
%{_bindir}/l3o
%{_bindir}/l3p
%{_bindir}/l3s
%{_bindir}/l3se
%{_bindir}/l3srg
%{_bindir}/l3t-make-sr-links
%{_bindir}/l3t-split-supportconfig
%{_bindir}/l3t-ptf-create
%{_bindir}/l3t-showrc
%{_bindir}/l3z
%{_sysconfdir}/bash_completion.d/l3t.sh
%doc README.md

%changelog