fa990d1
%if 0%{?fedora} || 0%{?rhel} >= 8
fa990d1
%bcond_without tests
fa990d1
%else
fa990d1
%bcond_with tests
fa990d1
%endif
54885a5
fa990d1
%if 0%{?fedora} || 0%{?rhel} >= 8
0a44d52
%global with_python3legacy 1
0a44d52
%global with_python3CFFI 1
faf1b1e
%endif
faf1b1e
fa990d1
%if 0%{?rhel} && 0%{?rhel} <= 7
5f399ac
%global with_python2 1
5f399ac
%endif
5f399ac
0c59488
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 9
0c59488
%bcond_without sfsexp
0c59488
%else
0c59488
%bcond_with sfsexp
0c59488
%endif
0c59488
4938382
# comparing {_emacs_version} in macros does not work well
4938382
# so we catch the major version bumps ;)
4938382
# read "with emacs at least"
4938382
%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10
4938382
%global with_emacs28 1
4938382
%endif
4337b8a
%if 0%{?fedora} >= 38 || 0%{?rhel} >= 10
4938382
%global with_emacs29 1
4938382
%endif
4938382
0a44d52
# build python 3 modules with python 3 ;)
0a44d52
%if 0%{?with_python3legacy} || 0%{?with_python3CFFI}
0a44d52
%global with_python3 1
0a44d52
%endif
0a44d52
cd274ed
Name:           notmuch
ae41bd0
Version:        0.38.3
8ebd074
Release:        %autorelease
cd274ed
Summary:        System for indexing, searching, and tagging email
af1a30a
License:        GPL-3.0-or-later
7b07038
URL:            https://notmuchmail.org/
a505fcf
Source0:        https://notmuchmail.org/releases/notmuch-%{version}.tar.xz
669d65f
Source1:        https://notmuchmail.org/releases/notmuch-%{version}.tar.xz.asc
669d65f
# Imported from public key servers; author provides no fingerprint!
8ef1102
Source2:        gpgkey-7A18807F100A4570C59684207E4E65C8720B706B.gpg
5a3e865
Patch1:         0001-test-allow-to-use-full-scan.patch
5a3e865
Patch2:         0002-test-use-NOTMUCH_NEW-consistently.patch
8ef1102
aa5800a
BuildRequires:  make
f92a0f4
%if 0%{?fedora} >= 41
f92a0f4
BuildRequires:  bash-completion-devel
f92a0f4
%else
cd274ed
BuildRequires:  bash-completion
f92a0f4
%endif
48a87df
BuildRequires:  desktop-file-utils
cd274ed
BuildRequires:  emacs
cd274ed
BuildRequires:  emacs-el
cd274ed
BuildRequires:  emacs-nox
57312ab
Buildrequires:  gcc gcc-c++
54885a5
BuildRequires:  libtool
f547632
BuildRequires:  doxygen
b3476de
BuildRequires:  texinfo
8ef1102
BuildRequires:  gnupg2
8ef1102
BuildRequires:  gnupg2-smime
68e72c0
BuildRequires:  gmime30-devel
cd274ed
BuildRequires:  libtalloc-devel
0134c56
BuildRequires:  perl-interpreter
cfe66d8
BuildRequires:  perl-generators
cd274ed
BuildRequires:  perl-podlators
5f399ac
%if 0%{?with_python2}
cd274ed
BuildRequires:  python2-devel
bfa9133
BuildRequires:  python2-docutils
bfa9133
BuildRequires:  python2-sphinx
5f399ac
%endif
cd274ed
BuildRequires:  ruby-devel
0c59488
%if %{with sfsexp}
0c59488
BuildRequires:  pkgconfig(sfsexp)
0c59488
%endif
cd274ed
BuildRequires:  xapian-core-devel
cd274ed
BuildRequires:  zlib-devel
Karel Klic 7a586b7
faf1b1e
%if 0%{?with_python3}
faf1b1e
BuildRequires:  python3-devel
faf1b1e
BuildRequires:  python3-docutils
faf1b1e
BuildRequires:  python3-sphinx
faf1b1e
%endif
faf1b1e
0a44d52
%if 0%{?with_python3CFFI}
0a44d52
BuildRequires:  python3-setuptools
fa990d1
  %if %{with tests}
4fecdfb
BuildRequires:  python3-pytest
fa990d1
# Not available on *EL, skip some tests there:
fa990d1
    %if 0%{?fedora}
4fecdfb
BuildRequires:  python3-pytest-shutil
fa990d1
    %endif
fa990d1
  %endif
0a44d52
BuildRequires:  python3-cffi
0a44d52
%endif
0a44d52
fa990d1
%if %{with tests}
fa990d1
# Not available on *EL, skip some tests there:
fa990d1
  %if 0%{?fedora}
fa990d1
BuildRequires:  dtach
fa990d1
  %endif
fa990d1
BuildRequires:  gdb
1508419
  %if %{with sfsexp}
1508419
BuildRequires:  git-core
1508419
  %endif
fa990d1
BuildRequires:  man
fa990d1
BuildRequires:  openssl
fa990d1
# You might also want to rebuild with valgrind-devel libasan libasan-static.
fa990d1
%endif
fa990d1
b3476de
Requires(post): /sbin/install-info
b3476de
Requires(postun): /sbin/install-info
b3476de
Karel Klic 7a586b7
%description
Karel Klic 7a586b7
Fast system for indexing, searching, and tagging email.  Even if you
Karel Klic 7a586b7
receive 12000 messages per month or have on the order of millions of
Karel Klic 7a586b7
messages that you've been saving for decades, Notmuch will be able to
Karel Klic 7a586b7
quickly search all of it.
Karel Klic 7a586b7
Karel Klic 7a586b7
Notmuch is not much of an email program. It doesn't receive messages
Karel Klic 7a586b7
(no POP or IMAP support). It doesn't send messages (no mail composer,
Karel Klic 7a586b7
no network code at all). And for what it does do (email search) that
Karel Klic 7a586b7
work is provided by an external library, Xapian. So if Notmuch
Karel Klic 7a586b7
provides no user interface and Xapian does all the heavy lifting, then
Karel Klic 7a586b7
what's left here? Not much.
Karel Klic 7a586b7
cd274ed
%package    devel
cd274ed
Summary:    Development libraries and header files for the Notmuch library
cd274ed
Requires:   %{name} = %{version}-%{release}
Karel Klic 7a586b7
Karel Klic 7a586b7
%description devel
Karel Klic 7a586b7
Notmuch-devel contains the development libraries and header files for
Karel Klic 7a586b7
Notmuch email program.  These libraries and header files are
Karel Klic 7a586b7
necessary if you plan to do development using Notmuch.
Karel Klic 7a586b7
Karel Klic 7a586b7
Install notmuch-devel if you are developing C programs which will use the
Karel Klic 7a586b7
Notmuch library.  You'll also need to install the notmuch package.
Karel Klic 7a586b7
1508419
%if %{with sfsexp}
1508419
%package    git
1508419
Summary:    Manage notmuch tags with git
1508419
Requires:   %{name} = %{version}-%{release}
1508419
Requires:   git-core
1508419
%if 0%{?with_python3CFFI}
1508419
Recommends: python3-notmuch2
1508419
%endif
1508419
1508419
%description git
1508419
This package contains a simple tool to save, restore, and synchronize
1508419
notmuch tags via git repositories.
1508419
%endif
1508419
Karel Klic 7a586b7
%package -n emacs-notmuch
cd274ed
Summary:    Not much support for Emacs
cd274ed
BuildArch:  noarch
cd274ed
Requires:   %{name} = %{version}-%{release}
cd274ed
Requires:   emacs(bin) >= %{_emacs_version}
Karel Klic 7a586b7
Karel Klic 7a586b7
%description -n emacs-notmuch
Karel Klic 7a586b7
%{summary}.
Karel Klic 7a586b7
5f399ac
%if 0%{?with_python2}
faf1b1e
%package -n python2-notmuch
faf1b1e
Summary:    Python2 bindings for notmuch
13e4797
Requires:   %{name} = %{version}-%{release}
faf1b1e
%{?python_provide:%python_provide python2-notmuch}
Luke Macken edb925d
faf1b1e
Requires:       python2
faf1b1e
faf1b1e
%description -n python2-notmuch
Luke Macken edb925d
%{summary}.
5f399ac
%endif
Luke Macken edb925d
0a44d52
%if 0%{?with_python3legacy}
faf1b1e
%package -n python3-notmuch
0a44d52
Summary:    Python3 bindings for notmuch (legacy)
13e4797
Requires:   %{name} = %{version}-%{release}
faf1b1e
%{?python_provide:%python_provide python3-notmuch}
faf1b1e
faf1b1e
Requires:       python3
faf1b1e
faf1b1e
%description -n python3-notmuch
faf1b1e
%{summary}.
faf1b1e
%endif
faf1b1e
0a44d52
%if 0%{?with_python3CFFI}
0a44d52
%package -n python3-notmuch2
0a44d52
Summary:    Python3 bindings for notmuch (cffi)
13e4797
Requires:   %{name} = %{version}-%{release}
0a44d52
%{?python_provide:%python_provide python3-notmuch2}
0a44d52
0a44d52
Requires:       python3
0a44d52
0a44d52
%description -n python3-notmuch2
0a44d52
%{summary}.
0a44d52
%endif
0a44d52
Luke Macken 9d5e62c
%package -n ruby-notmuch
cd274ed
Summary:    Ruby bindings for notmuch
cd274ed
Requires:   %{name} = %{version}-%{release}
Luke Macken 9d5e62c
Luke Macken 9d5e62c
%description -n ruby-notmuch
Luke Macken 9d5e62c
%{summary}.
Luke Macken 9d5e62c
cd274ed
%package    mutt
cd274ed
Summary:    Notmuch (of a) helper for Mutt
cd274ed
BuildArch:  noarch
cd274ed
Requires:   %{name} = %{version}-%{release}
cd274ed
Requires:   perl(Term::ReadLine::Gnu)
Karel Klic b465405
Karel Klic b465405
%description mutt
Karel Klic b465405
notmuch-mutt provide integration among the Mutt mail user agent and
Karel Klic b465405
the Notmuch mail indexer.
Karel Klic b465405
36f9bf3
%package    vim
36f9bf3
Summary:    A Vim plugin for notmuch
3788846
Requires:   ruby-%{name} = %{version}-%{release}
36f9bf3
Requires:   rubygem-mail
36f9bf3
Requires:   vim-enhanced
36f9bf3
# Required for updating helptags in scriptlets.
36f9bf3
Requires(post):    vim-enhanced
36f9bf3
Requires(postun):  vim-enhanced
36f9bf3
36f9bf3
%description vim
36f9bf3
notmuch-vim is a Vim plugin that provides a fully usable mail client
36f9bf3
interface, utilizing the notmuch framework.
36f9bf3
Karel Klic 7a586b7
%prep
669d65f
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
00cce31
%autosetup -p1
Karel Klic 7a586b7
Karel Klic 7a586b7
%build
fa990d1
# DEBUG mtime/stat
00cce31
%configure --emacslispdir=%{_emacs_sitelispdir}
00cce31
%make_build CFLAGS="$RPM_OPT_FLAGS -fPIC"
Karel Klic 7a586b7
Luke Macken edb925d
# Build the python bindings
Luke Macken edb925d
pushd bindings/python
5f399ac
    %if 0%{?with_python2}
faf1b1e
    %py2_build
5f399ac
    %endif
faf1b1e
    %if 0%{?with_python3}
faf1b1e
    %py3_build
faf1b1e
    %endif
Luke Macken edb925d
popd
Luke Macken edb925d
4fecdfb
# Build the python cffi bindings
4fecdfb
pushd bindings/python-cffi
4fecdfb
    %if 0%{?with_python3CFFI}
4fecdfb
    %py3_build
4fecdfb
    %endif
4fecdfb
popd
4fecdfb
Karel Klic b465405
# Build notmuch-mutt
Karel Klic b465405
pushd contrib/notmuch-mutt
Karel Klic b465405
    make
Karel Klic b465405
popd
Karel Klic b465405
fa990d1
%if %{with tests}
fa990d1
%check
fa990d1
# armv7hl pulls in libasan but we build without, and should test without it.
4938382
NOTMUCH_SKIP_TESTS="asan"
1508419
# notmuch-git and its tests require sfsexp.
4938382
NOTMUCH_SKIP_TESTS="$NOTMUCH_SKIP_TESTS%{!?with_sfsexp: git}"
4938382
# T460-emacs-tree.14 leads to sporadic failures with emacs 29
4938382
NOTMUCH_SKIP_TESTS="$NOTMUCH_SKIP_TESTS%{?with_emacs29: emacs-tree.14}"
4938382
# T460-emacs-tree.23 uses outline-cycle-buffer which requires emacs 28
4938382
NOTMUCH_SKIP_TESTS="$NOTMUCH_SKIP_TESTS%{!?with_emacs28: emacs-tree.23}"
3919c0d
# At least on koji/copr, test suite suffers from race conditions when parallelised.
fa990d1
# At least some rhel builds show mtime/stat related Heisenbugs when
fa990d1
# notmuch new takes shortcuts, so enforce --full-scan there.
4938382
NOTMUCH_SKIP_TESTS="$NOTMUCH_SKIP_TESTS" \
3919c0d
NOTMUCH_TEST_SERIALIZE="yesplease" \
3919c0d
make test V=1 %{?rhel:NOTMUCH_TEST_FULLSCAN=1}
fa990d1
%endif
fa990d1
Karel Klic 7a586b7
%install
00cce31
%make_install
Karel Klic 7a586b7
Karel Klic 7a586b7
# Enable dynamic library stripping.
Karel Klic 7a586b7
find %{buildroot}%{_libdir} -name *.so* -exec chmod 755 {} \;
Karel Klic 7a586b7
1508419
%if %{with sfsexp}
1508419
install -m0755 notmuch-git nmbug %{buildroot}%{_bindir}/
1508419
%endif
1508419
Luke Macken edb925d
# Install the python bindings and documentation
Luke Macken edb925d
pushd bindings/python
5f399ac
    %if 0%{?with_python2}
faf1b1e
    %py2_install
5f399ac
    %endif
0a44d52
    %if 0%{?with_python3legacy}
0a44d52
    %py3_install
0a44d52
    %endif
0a44d52
popd
0a44d52
0a44d52
# Install the python cffi bindings and documentation
0a44d52
pushd bindings/python-cffi
0a44d52
    %if 0%{?with_python3CFFI}
faf1b1e
    %py3_install
faf1b1e
    %endif
Luke Macken edb925d
popd
Luke Macken edb925d
Luke Macken 9d5e62c
# Install the ruby bindings
Luke Macken 9d5e62c
pushd bindings/ruby
Luke Macken 9d5e62c
    make install DESTDIR=%{buildroot}
Luke Macken 9d5e62c
popd
Luke Macken 9d5e62c
Karel Klic b465405
# Install notmuch-mutt
f0087bb
install -m0755 contrib/notmuch-mutt/notmuch-mutt \
f0087bb
    %{buildroot}%{_bindir}/notmuch-mutt
f0087bb
install -m0644 contrib/notmuch-mutt/notmuch-mutt.1 \
f0087bb
    %{buildroot}%{_mandir}/man1/notmuch-mutt.1
Karel Klic b465405
36f9bf3
# Install notmuch-vim
36f9bf3
pushd vim
36f9bf3
    make install DESTDIR=%{buildroot} prefix="%{_datadir}/vim/vimfiles"
36f9bf3
popd
36f9bf3
1508419
%if %{without sfsexp}
1508419
# Do not install notmuch-git which requires sfsexp
1508419
rm -f %{buildroot}%{_mandir}/man1/nmbug.1*
1508419
rm -f %{buildroot}%{_mandir}/man1/notmuch-git.1*
1508419
rm -f %{buildroot}%{_infodir}/nmbug.info*
1508419
rm -f %{buildroot}%{_infodir}/notmuch-git.info*
1508419
%endif
1508419
2f636c1
rm -f %{buildroot}/%{_datadir}/applications/mimeinfo.cache
b3476de
rm -f %{buildroot}%{_infodir}/dir
2f636c1
36f9bf3
%post vim
36f9bf3
cd %{_datadir}/vim/vimfiles/doc
36f9bf3
vim -u NONE -esX -c "helptags ." -c quit
36f9bf3
36f9bf3
%postun vim
36f9bf3
cd %{_datadir}/vim/vimfiles/doc
36f9bf3
vim -u NONE -esX -c "helptags ." -c quit
36f9bf3
Karel Klic 7a586b7
%files
f0087bb
%doc AUTHORS COPYING COPYING-GPL-3 README
0a44d52
%{_datadir}/zsh/site-functions/_notmuch
0a44d52
%{_datadir}/zsh/site-functions/_email-notmuch
Gonéri Le Bouder c94e0a6
%{_datadir}/bash-completion/completions/notmuch
Karel Klic 7a586b7
%{_bindir}/notmuch
1508419
%{_libdir}/libnotmuch.so.5*
Karel Klic b465405
%{_mandir}/man1/notmuch.1*
e0439e4
%{_mandir}/man1/notmuch-address.1*
1508419
%{_mandir}/man1/notmuch-compact.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-config.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-count.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-dump.1*
Luke Macken fd6b017
%{_mandir}/man1/notmuch-insert.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-new.1*
7b07038
%{_mandir}/man1/notmuch-reindex.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-reply.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-restore.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-search.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-setup.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-show.1*
Karel Klic b465405
%{_mandir}/man1/notmuch-tag.1*
1508419
%{_mandir}/man5/notmuch-hooks.5*
1508419
%{_mandir}/man7/notmuch-properties.7*
1508419
%{_mandir}/man7/notmuch-search-terms.7*
1508419
%{_mandir}/man7/notmuch-sexp-queries.7*
1508419
%{_infodir}/notmuch.info*
1508419
%{_infodir}/notmuch-address.info*
1508419
%{_infodir}/notmuch-compact.info*
1508419
%{_infodir}/notmuch-config.info*
1508419
%{_infodir}/notmuch-count.info*
1508419
%{_infodir}/notmuch-dump.info*
1508419
%{_infodir}/notmuch-hooks.info*
1508419
%{_infodir}/notmuch-insert.info*
1508419
%{_infodir}/notmuch-new.info*
1508419
%{_infodir}/notmuch-properties.info*
1508419
%{_infodir}/notmuch-reindex.info*
1508419
%{_infodir}/notmuch-reply.info*
1508419
%{_infodir}/notmuch-restore.info*
1508419
%{_infodir}/notmuch-search-terms.info*
1508419
%{_infodir}/notmuch-search.info*
1508419
%{_infodir}/notmuch-setup.info*
1508419
%{_infodir}/notmuch-sexp-queries.info*
1508419
%{_infodir}/notmuch-show.info*
1508419
%{_infodir}/notmuch-tag.info*
Karel Klic 7a586b7
Karel Klic 7a586b7
%files devel
Karel Klic 7a586b7
%{_libdir}/libnotmuch.so
Karel Klic 7a586b7
%{_includedir}/*
f547632
%{_mandir}/man3/notmuch*.3*
Karel Klic 7a586b7
1508419
%if %{with sfsexp}
1508419
%files git
1508419
%{_bindir}/nmbug
1508419
%{_bindir}/notmuch-git
1508419
%{_mandir}/man1/nmbug.1*
1508419
%{_mandir}/man1/notmuch-git.1*
1508419
%{_infodir}/nmbug.info*
1508419
%{_infodir}/notmuch-git.info*
1508419
%endif
1508419
Karel Klic 7a586b7
%files -n emacs-notmuch
Karel Klic 249d02a
%{_emacs_sitelispdir}/*.el
Karel Klic 7a586b7
%{_emacs_sitelispdir}/*.elc
15af86a
%{_emacs_sitelispdir}/notmuch-logo.svg
2f636c1
%{_datadir}/applications/notmuch-emacs-mua.desktop
1508419
%{_bindir}/notmuch-emacs-mua
1508419
%{_mandir}/man1/notmuch-emacs-mua.1*
1508419
%{_infodir}/notmuch-emacs-mua.info*
1508419
%{_infodir}/notmuch-emacs.info*
Karel Klic 7a586b7
5f399ac
%if 0%{?with_python2}
faf1b1e
%files -n python2-notmuch
faf1b1e
%doc bindings/python/README
faf1b1e
%{python2_sitelib}/notmuch*
5f399ac
%endif
faf1b1e
0a44d52
%if 0%{?with_python3legacy}
faf1b1e
%files -n python3-notmuch
Luke Macken edb925d
%doc bindings/python/README
faf1b1e
%{python3_sitelib}/notmuch*
f55308f
%endif
Luke Macken edb925d
0a44d52
%if 0%{?with_python3CFFI}
0a44d52
%files -n python3-notmuch2
0a44d52
%{python3_sitearch}/notmuch*
0a44d52
%endif
0a44d52
Luke Macken 9d5e62c
%files -n ruby-notmuch
Luke Macken 9d5e62c
%{ruby_vendorarchdir}/*
Luke Macken 9d5e62c
Karel Klic b465405
%files mutt
Karel Klic b465405
%{_bindir}/notmuch-mutt
Karel Klic b465405
%{_mandir}/man1/notmuch-mutt.1*
Karel Klic b465405
36f9bf3
%files vim
36f9bf3
%{_datadir}/vim/vimfiles/doc/notmuch.txt
36f9bf3
%{_datadir}/vim/vimfiles/plugin/notmuch.vim
36f9bf3
%{_datadir}/vim/vimfiles/syntax/notmuch-compose.vim
36f9bf3
%{_datadir}/vim/vimfiles/syntax/notmuch-folders.vim
36f9bf3
%{_datadir}/vim/vimfiles/syntax/notmuch-git-diff.vim
36f9bf3
%{_datadir}/vim/vimfiles/syntax/notmuch-search.vim
36f9bf3
%{_datadir}/vim/vimfiles/syntax/notmuch-show.vim
36f9bf3
Karel Klic 7a586b7
%changelog
8ebd074
%autochangelog