[Bug 1654689] Review Request: yubihsm-shell - Tools to interact with YubiHSM 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1654689

Robert-André Mauchin <zebob.m@xxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zebob.m@xxxxxxxxx



--- Comment #2 from Robert-André Mauchin <zebob.m@xxxxxxxxx> ---
 - Not needed anymore:

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

 - Globbing the major soname version of libraries is now forbidden to avoid
unintentional soname bump, be more precise instead:

%{_libdir}/libyubihsm.so.*
%{_libdir}/libyubihsm_http.so.*
%{_libdir}/libyubihsm_usb.so.*

 - Use a glob instead of .gz for man pages as the compression might change in
the future:

%{_mandir}/man1/yubihsm-shell.1.*
%{_mandir}/man1/yubihsm-wrap.1.*



For the go packaging, usually you start with:

sudo gofed repo2spec --detect https://github.com/pathtotherepo

Then fill in the blanks.

Your package is a bit different since it's a binary and not a library. You'll
have to find the deps too:

=============================
# Run tests in check section
%bcond_without check

# https://github.com/Yubico/yubihsm-connector
%global goipath         github.com/Yubico/yubihsm-connector
Version:                2.0.0

%global common_description %{expand:
YubiHSM connector.}

%gometa

Name:           yubihsm-connector
Release:        1%{?dist}
Summary:        YubiHSM connector
# Detected licences
# - *No copyright* Apache License (v2.0) at 'LICENSE'
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: 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)


%description
%{common_description}


%package devel
Summary:       %{summary}
BuildArch:     noarch

%description devel
%{common_description}

This package contains library source intended for
building other packages which use import path with
%{goipath} prefix.


%prep
%forgeautosetup

rm -rf vendor/


%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


%files
%license LICENSE
%{_bindir}/yubihsm-connector
%config(noreplace) %{_sysconfdir}/yubihsm-connector.yaml
%{_unitdir}/yubihsm-connector.service
%{_udevrulesdir}/70-yubihsm-connector.rules


%changelog
* Fri Nov 30 2018 Jakub Jelen <jjelen@xxxxxxxxxx> - 2.0.0-1
- First package for Fedora
==============================


You'll heed to package github.com/thorduri/go-libusb which is not available in
Fedora. It should look like this:

============================
# Run tests in check section
# Requires a usb device
%bcond_with check

# https://github.com/thorduri/go-libusb
%global goipath         github.com/thorduri/go-libusb
%global commit          bbed4ca2a465660f336e1e5a4b2fe549667a2ca1


%global common_description %{expand:
The gousb package is an attempt at wrapping the libusb library into a 
Go-like binding.}

%gometa

Name:           %{goname}
Version:        0
Release:        0.1%{?dist}
Summary:        Idiomatic Go bindings for libusb-1.0 
# Detected licences
# - *No copyright* Apache License (v2.0) at 'LICENSE'
License:        ASL 2.0
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  pkgconfig(libusb)

%description
%{common_description}


%package devel
Summary:       %{summary}
BuildArch:     noarch
Requires:      pkgconfig(libusb)

%description devel
%{common_description}

This package contains library source intended for
building other packages which use import path with
%{goipath} prefix.


%prep
%forgeautosetup


%install
%goinstall


%if %{with check}
%check
%gochecks
%endif


%files devel -f devel.file-list
%license LICENSE
%doc README.md


%changelog
* Fri Nov 30 2018 Jakub Jelen <jjelen@xxxxxxxxxx> - 0-0.1.20181130gitbbed4ca
- First package for Fedora
==========================


You can check the builds here:
https://copr.fedorainfracloud.org/coprs/eclipseo/golangtest/builds/

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux