File scep.spec of Package scep

#
# spec file for package scep
#
# 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/
#


%global binaries scepclient scepserver

Name:           scep
Version:        v2.1.0+git.10.699e8df
Release:        0
Summary:        A Simple Certificate Enrollment Protocol server
License:        MIT
URL:            https://github.com/micromdm/scep
Source:         scep-%{version}.tar.bz2
Source1:        vendor.tar.gz
BuildRequires:  golang-packaging
BuildRequires:  golang(API)

%description
scep is a Simple Certificate Enrollment Protocol server and client.

%prep
%autosetup -a1

%build
for binary in %{binaries} ; do
go build -mod=vendor -buildmode=pie -ldflags "-X main.version=%{version}" -o ${binary} ./cmd/${binary}/
done

%install
for binary in %{binaries} ; do
install -D -m 0755 ${binary} %{buildroot}%{_sbindir}/${binary}
done

%files
%{_sbindir}/scep*
%license LICENSE
%doc README.md

%changelog
openSUSE Build Service is sponsored by