Blob Blame Raw
# Generated by go2rpm
%bcond_with check

%global source_date_epoch_from_changelog Y

# https://github.com/rfjakob/gocryptfs
%global goipath         github.com/rfjakob/gocryptfs
Version:                1.7
%global extractdir      gocryptfs_v1.7_src

%gometa

%global common_description %{expand:
Encrypted overlay filesystem written in Go.}

Name:           %{goname}
Release:        2%{?dist}
Summary:        Encrypted overlay filesystem written in Go

License:        MIT
URL:            %{gourl}
Source0:        https://%{goipath}/releases/download/v%{version}/gocryptfs_v%{version}_src.tar.gz

BuildRequires:  golang(github.com/hanwen/go-fuse/fuse)
BuildRequires:  golang(github.com/hanwen/go-fuse/fuse/nodefs)
BuildRequires:  golang(github.com/hanwen/go-fuse/fuse/pathfs)
BuildRequires:  golang(github.com/jacobsa/crypto/siv)
BuildRequires:  golang(github.com/rfjakob/eme)
BuildRequires:  golang(golang.org/x/crypto/hkdf)
BuildRequires:  golang(golang.org/x/crypto/scrypt)
BuildRequires:  golang(golang.org/x/crypto/ssh/terminal)
BuildRequires:  golang(golang.org/x/sync/syncmap)
BuildRequires:  golang(golang.org/x/sys/unix)
BuildRequires:  openssl-devel

%description
%{common_description}

%package devel
Summary:       %{summary}

%description devel
%{common_description}

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

%package -n gocryptfs
Summary:       %{summary}
Requires:  fuse

%description -n gocryptfs
%{common_description}

%package -n gocryptfs-xray
Summary:       %{summary}

%description -n gocryptfs-xray
%{common_description}

This package contains the xray tool.

%prep
%forgeautosetup

%build
USVERSION=$(cat VERSION)
GCVERSION=$USVERSION-Fedora-%{version}-%{release}
FUSEVERSION=$(rpm -q golang-github-hanwen-fuse-devel --queryformat '%%{version}')
BUILDDATE=$(date +%Y-%m-%d -d @$SOURCE_DATE_EPOCH)
# bex - notice the space here - it is needed and silly see https://pagure.io/go-rpm-macros/issue/19
LDFLAGS="-X main.GitVersion=$GCVERSION -X main.GitVersionFuse=$FUSEVERSION -X main.BuildDate=$BUILDDATE "
%gobuildroot
%gobuild -o %{gobuilddir}/bin/gocryptfs %{goipath}
for cmd in gocryptfs-xray; do
  %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done

%install
%goinstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
install -D -m 644 Documentation/gocryptfs.1 %{buildroot}%{_mandir}/man1/gocryptfs.1
install -D -m 644 Documentation/gocryptfs-xray.1 %{buildroot}%{_mandir}/man1/gocryptfs-xray.1

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

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

%files -n gocryptfs
%license LICENSE
%doc README.md
%{_bindir}/gocryptfs
%{_mandir}/man1/gocryptfs.1*

%files -n gocryptfs-xray
%license LICENSE
%{_bindir}/gocryptfs-xray
%{_mandir}/man1/gocryptfs-xray.1*

%changelog
* Sun Aug 10 18:32:00 CEST 2019 Brian (bex) Exelbierd <bex@pobox.com> - 1.7-1
- Update Requires

* Sun Jun 23 11:36:48 CEST 2019 Brian (bex) Exelbierd <bex@pobox.com> - 1.7-1
- Initial package