|
|
4f38092 |
# Run tests in check section
|
|
|
4f38092 |
%bcond_without check
|
|
|
4f38092 |
|
|
|
4f38092 |
# https://github.com/Yubico/yubihsm-connector
|
|
|
4f38092 |
%global goipath github.com/Yubico/yubihsm-connector
|
|
|
60f874b |
Version: 2.1.0
|
|
|
5d52765 |
%global tag %{version}
|
|
|
5d52765 |
|
|
|
5d52765 |
%gometa
|
|
|
5d52765 |
|
|
|
5d52765 |
%global common_description %{expand:
|
|
|
5d52765 |
Backend to talk to YubiHSM 2}
|
|
|
4f38092 |
|
|
|
4f38092 |
Name: yubihsm-connector
|
|
|
c6150c7 |
Release: 2%{?dist}
|
|
|
4f38092 |
Summary: YubiHSM Connector
|
|
|
4f38092 |
|
|
|
5d52765 |
# Upstream license specification: Apache-2.0
|
|
|
5d52765 |
License: ASL 2.0
|
|
|
4f38092 |
URL: %{gourl}
|
|
|
5d52765 |
Source0: %{gosource}
|
|
|
4f38092 |
|
|
|
4f38092 |
%{?systemd_requires}
|
|
|
5d52765 |
Requires(pre): shadow-utils
|
|
|
5d52765 |
BuildRequires: systemd-rpm-macros
|
|
|
60f874b |
#BuildRequires: git
|
|
|
60f874b |
BuildRequires: golang(github.com/google/gousb)
|
|
|
60f874b |
BuildRequires: golang(github.com/google/uuid)
|
|
|
5d52765 |
BuildRequires: golang(github.com/kardianos/service)
|
|
|
5d52765 |
BuildRequires: golang(github.com/sirupsen/logrus)
|
|
|
5d52765 |
BuildRequires: golang(github.com/sirupsen/logrus/hooks/syslog)
|
|
|
5d52765 |
BuildRequires: golang(github.com/spf13/cobra)
|
|
|
5d52765 |
BuildRequires: golang(github.com/spf13/viper)
|
|
|
5d52765 |
BuildRequires: golang(gopkg.in/yaml.v2)
|
|
|
5d52765 |
Recommends: yubihsm-shell
|
|
|
4f38092 |
|
|
|
4f38092 |
%description
|
|
|
5d52765 |
%{common_description}
|
|
|
4f38092 |
|
|
|
5d52765 |
%gopkg
|
|
|
4f38092 |
|
|
|
4f38092 |
%prep
|
|
|
5d52765 |
%goprep
|
|
|
4f38092 |
|
|
|
4f38092 |
%build
|
|
|
60f874b |
export GO111MODULE=off
|
|
|
60f874b |
sed -i "s| -mod=vendor||" main.go
|
|
|
4f38092 |
go generate
|
|
|
60f874b |
%gobuild -o %{gobuilddir}/bin/yubihsm-connector %{goipath}
|
|
|
4f38092 |
|
|
|
4f38092 |
%install
|
|
|
5d52765 |
install -Dpm 0755 %{gobuilddir}/bin/yubihsm-connector %{buildroot}%{_bindir}/yubihsm-connector
|
|
|
4f38092 |
install -Dpm 0644 deb/yubihsm-connector.yaml %{buildroot}%{_sysconfdir}/yubihsm-connector.yaml
|
|
|
4f38092 |
install -Dpm 0644 deb/yubihsm-connector.service %{buildroot}%{_unitdir}/yubihsm-connector.service
|
|
|
4f38092 |
install -Dpm 0644 deb/70-yubihsm-connector.rules %{buildroot}%{_udevrulesdir}/70-yubihsm-connector.rules
|
|
|
4f38092 |
|
|
|
4f38092 |
%if %{with check}
|
|
|
4f38092 |
%check
|
|
|
5d52765 |
%gocheck
|
|
|
4f38092 |
%endif
|
|
|
4f38092 |
|
|
|
4f38092 |
%pre
|
|
|
4f38092 |
getent group yubihsm-connector >/dev/null || groupadd -r yubihsm-connector
|
|
|
4f38092 |
getent passwd yubihsm-connector >/dev/null || \
|
|
|
4f38092 |
useradd -r -g yubihsm-connector -M -s /sbin/nologin \
|
|
|
4f38092 |
-c "YubiHSM connector account" yubihsm-connector \
|
|
|
4f38092 |
--system
|
|
|
4f38092 |
exit 0
|
|
|
4f38092 |
|
|
|
4f38092 |
%post
|
|
|
4f38092 |
%systemd_post yubihsm-connector.service
|
|
|
4f38092 |
|
|
|
4f38092 |
%preun
|
|
|
4f38092 |
%systemd_preun yubihsm-connector.service
|
|
|
4f38092 |
|
|
|
4f38092 |
%postun
|
|
|
4f38092 |
%systemd_postun_with_restart yubihsm-connector.service
|
|
|
4f38092 |
|
|
|
4f38092 |
%files
|
|
|
4f38092 |
%license LICENSE
|
|
|
4f38092 |
%{_bindir}/yubihsm-connector
|
|
|
4f38092 |
%config(noreplace) %{_sysconfdir}/yubihsm-connector.yaml
|
|
|
4f38092 |
%{_unitdir}/yubihsm-connector.service
|
|
|
4f38092 |
%{_udevrulesdir}/70-yubihsm-connector.rules
|
|
|
4f38092 |
|
|
|
4f38092 |
%changelog
|
|
|
c6150c7 |
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-2
|
|
|
c6150c7 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
|
c6150c7 |
|
|
|
60f874b |
* Mon Jan 13 2020 Jakub Jelen <jjelen@redhat.com> - 2.1.0-1
|
|
|
60f874b |
- New upstream release (#1788637)
|
|
|
60f874b |
|
|
|
a4de768 |
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-3
|
|
|
a4de768 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
|
a4de768 |
|
|
|
5d52765 |
* Fri Jul 12 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.0.0-2
|
|
|
5d52765 |
- Update to latest Go macros
|
|
|
5d52765 |
|
|
|
4f38092 |
* Thu Jan 31 2019 Jakub Jelen <jjelen@redhat.com> - 2.0.0-1
|
|
|
4f38092 |
- First package for Fedora
|