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

%global goipath
Version:                0.14.0
%global topdir          %{name}-%{version}


%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

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

License:        MIT
URL:            %{gourl}
# The forge macros don't support Sourcehut.
Source:         %{gourl}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# doc: fix English typos
Patch:          0001-doc-fix-English-typos.patch
# filters: install them in $PREFIX/libexec/aerc/filters
# Depends on previous patch. Slightly modified to remove conflict.
Patch:          0002-filters-install-them-in-PREFIX-libexec-aerc-filters.patch

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

Requires:       notmuch


%autopatch -p1

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

# From go.mod replace statements:
# replace => v0.0.0-20200420072808-71bec3603bf3
# replace => v0.0.0-20201126061756-caa2daf7093c
sed -i "s|||" $(find . -name "*.go" -type f)
sed -i "s|||" $(find . -name "*.go" -type f)

echo 'golang('

export BUILDTAGS=notmuch
export LDFLAGS="\
                -X main.Version=%{version} \
                -X main.Prefix=%{_prefix} \
                -X main.ShareDir=%{_datadir}/aerc \
                -X{_datadir} \
                -X{_libexecdir} \
%gobuild -o aerc %{goipath}
%gobuild -o wrap filters/wrap.go

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

%if %{with check}

%license LICENSE
%doc doc