# Run tests in check section %bcond_without check # https://github.com/Yubico/yubihsm-connector %global goipath github.com/Yubico/yubihsm-connector %gometa Name: yubihsm-connector Version: 2.0.0 Release: 1%{?dist} Summary: YubiHSM Connector License: ASL 2.0 URL: %{gourl} Source0: %{gourl}/archive/%{version}/%{name}-%{version}.tar.gz %{?systemd_requires} Requires(pre): shadow-utils #BuildRequires: systemd-rpm-macros BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} BuildRequires: golang(github.com/kardianos/service) BuildRequires: golang(github.com/thorduri/go-libusb/usb) BuildRequires: golang(github.com/sirupsen/logrus) BuildRequires: golang(github.com/sirupsen/logrus/hooks/syslog) BuildRequires: golang(github.com/spf13/cobra) BuildRequires: golang(github.com/spf13/viper) BuildRequires: golang(gopkg.in/yaml.v2) Recommends: yubihsm-shell %description %{summary} %package devel Summary: %{summary} BuildArch: noarch %description devel %{summary} This package contains library source intended for building other packages which use import path with %{goipath} prefix. %prep %forgeautosetup rm -rf vendor/ #%%gosetup -q %build %gobuildroot pushd src/yubihsm-connector/ go generate popd %gobuild -o _bin/yubihsm-connector %{goipath}/src/yubihsm-connector/ %install install -Dpm 0755 _bin/yubihsm-connector %{buildroot}%{_bindir}/yubihsm-connector install -Dpm 0644 deb/yubihsm-connector.yaml %{buildroot}%{_sysconfdir}/yubihsm-connector.yaml install -Dpm 0644 deb/yubihsm-connector.service %{buildroot}%{_unitdir}/yubihsm-connector.service install -Dpm 0644 deb/70-yubihsm-connector.rules %{buildroot}%{_udevrulesdir}/70-yubihsm-connector.rules %if %{with check} %check %gochecks %endif %pre getent group yubihsm-connector >/dev/null || groupadd -r yubihsm-connector getent passwd yubihsm-connector >/dev/null || \ useradd -r -g yubihsm-connector -M -s /sbin/nologin \ -c "YubiHSM connector account" yubihsm-connector \ --system exit 0 %post %systemd_post yubihsm-connector.service %preun %systemd_preun yubihsm-connector.service %postun %systemd_postun_with_restart yubihsm-connector.service #define license tag if not already defined %{!?_licensedir:%global license %doc} %files %license LICENSE %{_bindir}/yubihsm-connector %config(noreplace) %{_sysconfdir}/yubihsm-connector.yaml %{_unitdir}/yubihsm-connector.service %{_udevrulesdir}/70-yubihsm-connector.rules %changelog * Thu Jan 31 2019 Jakub Jelen - 2.0.0-1 - First package for Fedora