File aptly.spec of Package aptly

#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%global provider_prefix github.com/aptly-dev/aptly
%global import_path     %{provider_prefix}

Name:           aptly
Version:        v1.4.0
Release:        0
License:        MIT
Summary:        Swiss army knife for Debian repository management
Url:            https://www.aptly.info
Group:          System/Packages
Source0:        %{name}-%{version}.tar.xz

%if 0%{?rhel_version} > 0
BuildRequires:  go-srpm-macros
%endif

BuildRequires:  golang-packaging

BuildRequires:  xz
BuildRequires:  fdupes

%{go_nostrip}
%{go_provides}

%description
aptly is a swiss army knife for Debian repository management:
it allows you to mirror remote repositories, manage local package
repositories, take snapshots, pull new versions of packages along
with dependencies, publish as Debian repository.

%prep
%setup -q -n %{name}-%{version}

%build
%goprep %{import_path}

export GOROOT_TARGET="%{buildroot}%{_libdir}/golang"
%gobuild .

%install
%goinstall
%gosrc

%gofilelist

%fdupes %{buildroot}/%{go_contribsrcdir}

%check
%gotest %{import_path}

%files -f file.lst
%license LICENSE

%{_bindir}/%{name}

%changelog