File go-modiff.spec of Package go-modiff
#
# spec file for package go-modiff
#
# Copyright (c) 2019 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 https://bugs.opensuse.org/
#
# nodebuginfo
# Remove stripping of Go binaries.
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
# Project name when using go tooling.
%define project github.com/saschagrunert/go-modiff
# Project upstream commit.
%define commit 6472551
Name: go-modiff
Version: 1.3.5
Release: 0
Summary: Command line tool for diffing Go module dependency changes between versions
License: MIT
Group: Development/Languages/Go
Url: https://github.com/saschagrunert/go-modiff
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
BuildRequires: fdupes
BuildRequires: golang(API) >= 1.18
ExcludeArch: s390
%if 0%{?is_opensuse}
ExcludeArch: s390x
%endif
%description
Command line tool for diffing Go module dependency changes between versions
https://github.com/saschagrunert/go-modiff
%prep
%setup -q
%setup -q -T -D -a 1
# Delete upstream vendor directory, use locally verified vendored sources
find . -iname "vendor" -type d
%build
export CGO_ENABLED=0
go build \
-buildmode=pie \
%{project}/cmd/%{name} ;
%install
# Install the binary.
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
# Build the markdown documentation.
%{buildroot}/%{_bindir}/%{name} d --markdown > docs/go-modiff.8.md
# Build the man pages.
%{buildroot}/%{_bindir}/%{name} d --man > docs/go-modiff.8
# Install the man pages.
mkdir -p "%{buildroot}/%{_mandir}/man8"
install -D -m 0644 docs/%{name}*.8 "%{buildroot}/%{_mandir}/man8"
%fdupes %{buildroot}
%files
%defattr(-,root,root)
%doc README.md docs/go-modiff.8.md
%if 0%{?suse_version} < 1500
%doc LICENSE
%else
%license LICENSE
%endif
%{_bindir}/%{name}
%{_mandir}/man8/%{name}*.8.gz
%changelog