Blob Blame History Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

Name:           khard
Version:        0.9.0
Release:        2%{?dist}
Summary:        An address book for the Linux console

License:        GPLv3
URL:            https://github.com/scheibler/%{name}
Source0:        https://github.com/scheibler/%{name}/archive/v%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
Requires:       python-configobj
Requires:       python-vobject
Requires:       python-argparse

%description
Khard is an address book for the Linux console. It creates, reads, modifies and
removes carddav address book entries at your local machine.


%prep
%setup -q -n %{name}-%{version}

# Make the script executable (the source handles __name__ == '__main__').
# See: https://github.com/scheibler/khard/issues/8
chmod +x davcontroller/davcontroller.py


%build
%{__python} setup.py build


%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
for lib in %{buildroot}%{python_sitelib}/{khard,davcontroller}/*.py; do
    sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
    touch -r $lib $lib.new &&
    mv $lib.new $lib
done
mkdir -p %{buildroot}%{_datadir}/zsh/site-functions/
install -p -m 0644 misc/zsh/_khard %{buildroot}%{_datadir}/zsh/site-functions/_khard


%files
%doc AUTHORS CHANGES README.md
%doc misc/khard/khard.conf.example
%license LICENSE
%{_bindir}/davcontroller
%{_bindir}/khard
%{python_sitelib}/*
%{_datadir}/zsh/site-functions/


%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Sat Apr 23 2016 Ben Boeckel <mathstuf@gmail.com> - - 0.9.0-1
- update to 0.9.0

* Mon Apr 04 2016 Ben Boeckel <mathstuf@gmail.com> - 0.8.1-1
- update to 0.8.1

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Oct 25 2015 Ben Boeckel <mathstuf@gmail.com> - 0.6.3-1
- update to 0.6.3

* Tue Oct 13 2015 Ben Boeckel <mathstuf@gmail.com> - 0.6.2-1
- update to 0.6.2
- ship zsh completion file

* Sat Jul 25 2015 Ben Boeckel <mathstuf@gmail.com> - 0.4.1-1
- update to 0.4.1
- remove shebang lines

* Tue Mar 03 2015 Ben Boeckel <mathstuf@gmail.com> - 0.2.1-2
- use python2-devel in BR
- chmod +x davcontroller.py
- remove twinkle plugin (twinkle isn't in Fedora)

* Tue Mar 03 2015 Ben Boeckel <mathstuf@gmail.com> - 0.2.1-1
- initial package