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.4.1
Release:        1%{?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
# https://github.com/scheibler/khard/pull/18
Patch0:         0001-setup.py-don-t-require-argparse-in-2.6-and-up.patch

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}
%patch0 -p1 -b .argparse

# 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


%files
%doc AUTHORS CHANGES README.md
%doc khard.conf.example
%license LICENSE
%{_bindir}/davcontroller
%{_bindir}/khard
%{python_sitelib}/*


%changelog
* 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