File gosgp.spec of Package gosgp
#
# spec file for package gosgp
#
# Copyright (c) 2023 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/
#
# nodebuginfo
Name: gosgp
Version: 0.1.2
Release: 0
Summary: Quick and Easy server testing/validation
License: GPL-2.0
URL: https://github.com/brejoc/gosgp
Source0: https://github.com/brejoc/gosgp/archive/refs/tags/%{version}.tar.gz#/gosgp-%{version}.tar.gz
Source1: vendor.tar.gz
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires: go-rpm-macros
%else
BuildRequires: golang-packaging
BuildRequires: golang(API) >= 1.18
%endif
%description
Command line SuperGenPass password generator written in go.
%prep
%setup -q
tar -zxf %{SOURCE1}
%build
GO111MODULE=on CGO_ENABLED=0 go build -mod=vendor -o %{name} -buildmode=pie \
-ldflags "-s -w -X main.version=%{version}" .
%install
install -D -m0755 %{name} %{buildroot}%{_bindir}/%{name}
%files
%license LICENSE
%{_bindir}/%{name}
%changelog