d78090f
# Generated by go2rpm 1.6.0
dc39051
%bcond check 1
8aeee5c
# aerc has a lot of dependencies and is picky about them. Upstream does a good
8aeee5c
# job at keeping them updated. aerc is prone to crashes with Fedora's
8aeee5c
# dependency versions, many of which are out of date
dc39051
%bcond vendor 1
e78f8fd
0b604eb
# https://git.sr.ht/~rjarry/aerc
0b604eb
%global goipath         git.sr.ht/~rjarry/aerc
8d4be78
%global version0        0.17.0
e78f8fd
e78f8fd
%gometa
e78f8fd
e78f8fd
%global common_description %{expand:
b8bbb85
Aerc is an email client that runs in your terminal. It is highly
e78f8fd
efficient and extensible, perfect for the discerning hacker.}
e78f8fd
e78f8fd
Name:           aerc
8d4be78
Version:        %{forgeversion}
26e03e8
Release:        %autorelease
e78f8fd
Summary:        Email client for your terminal
e78f8fd
ed696d0
SourceLicense:  MIT
ed696d0
# See LICENSES.dependencies
ed696d0
License:        MIT AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC
e78f8fd
URL:            %{gourl}
8d4be78
Source0         %{forgesource}
ed696d0
Source1:        aerc-%{version}-vendor.tar.gz
ed696d0
# https://git.sr.ht/~gotmax23/fedora-scripts/tree/main/item/go-sig/go_vendor_licenses.py
ed696d0
Source2:        LICENSES.dependencies
e78f8fd
26342eb
BuildRequires:  desktop-file-utils
d32072e
# wrap and colorize filters are written in C
d32072e
BuildRequires:  gcc
08bef49
BuildRequires:  glibc-all-langpacks
26342eb
BuildRequires:  gnupg
4515f6b
BuildRequires:  notmuch-devel
d32072e
BuildRequires:  scdoc
4515f6b
e78f8fd
Requires:       notmuch
e78f8fd
e78f8fd
%description
e78f8fd
%{common_description}
e78f8fd
e78f8fd
%prep
8d4be78
%autosetup -p1 %{forgesetupargs} %{?with_vendor:-b1}
8aeee5c
%goprep -e %{?with_vendor:-k}
ed696d0
cp %{SOURCE2} .
00259ca
8aeee5c
%if %{without vendor}
9e1aafc
# From go.mod replace statements:
9e1aafc
# replace golang.org/x/crypto => github.com/ProtonMail/go-crypto v0.0.0-20200420072808-71bec3603bf3
9e1aafc
sed -i "s|golang.org/x/crypto|github.com/ProtonMail/go-crypto|" $(find . -name "*.go" -type f)
8aeee5c
%endif
9e1aafc
0423285
%generate_buildrequires
8aeee5c
%if %{without vendor}
0423285
%go_generate_buildrequires
8aeee5c
%endif
0423285
e78f8fd
%build
89992b3
%set_build_flags
53c793f
# GO_BUILDTAGS: Enable notmuch explicitly instead of relying on auto-detection
53c793f
#               in build script.
53c793f
# GO_LDFLAGS: Set to an empty string so the C LDFLAGS set by %%set_build_flags
53c793f
#             aren't read instead.
53c793f
GO_BUILDTAGS=notmuch GO_LDFLAGS=""
53c793f
53c793f
# BUILD_OPTS: Set `go build` flags
53c793f
# DATE: Set DATE based on SOURCE_DATE_EPOCH. The Makefile sets it based on the
53c793f
#       current time.
53c793f
# GOFLAGS: Set to an empty string. We want to clear the definition from the Makefile.
53c793f
# GO_EXTRA_LDFLAGS: Set `go build -ldflags` argument
53c793f
# Other values should be self-explanatory
53c793f
%make_build \
53c793f
  BUILD_OPTS=%{gobuild_baseflags_shescaped} \
53c793f
  DATE="$(date -d "@${SOURCE_DATE_EPOCH}" +%Y-%m-%d)" \
53c793f
  GOFLAGS= \
53c793f
  GO_EXTRA_LDFLAGS=%{gobuild_ldflags_shescaped} \
53c793f
  PREFIX=%{_prefix} \
53c793f
  VERSION=%{version} \
89992b3
e78f8fd
%install
e78f8fd
export PREFIX=%{_prefix}
e78f8fd
%make_install
26342eb
desktop-file-validate %{buildroot}/%{_datadir}/applications/aerc.desktop
26342eb
e78f8fd
%if %{with check}
e78f8fd
%check
08bef49
LANG=en_US.UTF-8 ./filters/test.sh
e78f8fd
%gocheck
e78f8fd
%endif
e78f8fd
e78f8fd
%files
ed696d0
%license LICENSE %{?with_vendor:vendor/modules.txt LICENSES.dependencies}
e78f8fd
%doc doc README.md
77411f0
%{_bindir}/aerc
7f775d5
%{_bindir}/carddav-query
3d890be
%{_datadir}/aerc/
26342eb
%{_datadir}/applications/aerc.desktop
4908418
%{_libexecdir}/aerc/
3d890be
%{_mandir}/man1/aerc-*.1.*
7f775d5
%{_mandir}/man1/carddav-query.1*
3d890be
%{_mandir}/man1/aerc.1*
3d890be
%{_mandir}/man5/aerc-*.5.*
3d890be
%{_mandir}/man7/aerc-*.7.*
e78f8fd
e78f8fd
%changelog
26e03e8
%autochangelog