%global commit 390d37ad19f2629c9f7436784403899ed483a3fa Name: notmuch-abook Version: 1.7 Release: 1%{?dist} Summary: Notmuch addressbook License: WTFPL URL: https://github.com/guyzmo/notmuch-abook Source0: https://github.com/guyzmo/notmuch-abook/archive/%{commit}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel Requires: python3-notmuch Requires: python3-docopt Requires: vim-filesystem %description Notmuch addressbook %prep %autosetup -n %{name}-%{commit} # Remove lib shebang sed -i 1,2d pythonx/notmuch_abook.py # Remove pysqlite from requirements sed -i 's/"pysqlite",//' setup.py # Support python3 sed -i -e 's/python/python3/' -e 's/py /py3 /' plugin/notmuch_abook.vim # Fix module path sed -i 's/py3 import notmuch_abook/py3 from notmuch_abook import notmuch_abook/' plugin/notmuch_abook.vim %build %py3_build %install %py3_install install -d %{buildroot}%{_datadir}/vim/vimfiles/plugin/ mv %{buildroot}%{_prefix}/plugin/notmuch_abook.vim %{buildroot}%{_datadir}/vim/vimfiles/plugin/notmuch_abook.vim %files %doc README.md %{python3_sitelib}/* %{_bindir}/notmuch_abook %{_datadir}/vim/vimfiles/plugin/notmuch_abook.vim %changelog * Tue Apr 04 2017 Tristan Cacqueray - 1.7-1 - Initial packaging