Blob Blame History Raw
# Generated by go2rpm 1.6.0
%bcond_without check

# https://git.sr.ht/~rjarry/aerc
%global goipath         git.sr.ht/~rjarry/aerc
Version:                0.12.0
%global topdir          %{name}-%{version}

%gometa

%global common_description %{expand:
Aerc is an email client that runs in your terminal. It's highly
efficient and extensible, perfect for the discerning hacker.}

%global golicenses      LICENSE
%global godocs          doc README.md

Name:           aerc
Release:        %autorelease
Summary:        Email client for your terminal

License:        MIT
URL:            %{gourl}
# The forge macros don't support Sourcehut.
# https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/209
Source:         %{gourl}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildRequires:  scdoc
BuildRequires:  desktop-file-utils
BuildRequires:  gnupg
BuildRequires:  notmuch-devel

Requires:       notmuch

%description
%{common_description}

%prep
%goprep

# Disable building of aerc that we handle manually in the SPEC and
# preserve mtimes
sed -e 's|install: $(DOCS) aerc|install: $(DOCS)|' \
    -e 's|install -m|install -pm|' \
    -i Makefile

%generate_buildrequires
%go_generate_buildrequires

%build
export BUILDTAGS=notmuch
export LDFLAGS="-X main.Prefix=%{_prefix} \
                -X main.ShareDir=%{_datadir}/aerc \
                -X git.sr.ht/~rjarry/aerc/config.shareDir=%{_datadir}
                -X main.Version=%{version} "
%gobuild -o aerc %{goipath}

%install
export PREFIX=%{_prefix}
%make_install
desktop-file-validate %{buildroot}/%{_datadir}/applications/aerc.desktop

%if %{with check}
%check
%gocheck
%endif

%files
%license LICENSE
%doc doc README.md
%{_bindir}/aerc
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/%{name}-*.1.*
%{_mandir}/man5/%{name}-*.5.*
%{_mandir}/man7/%{name}-*.7.*
%{_datadir}/aerc
%{_datadir}/applications/aerc.desktop

%changelog
%autochangelog