Blob Blame History Raw
# python3-xlib is not available yet
%bcond_with python3

Name:           python-i3ipc
Version:        1.2.0
Release:        1%{?dist}
Summary:        An improved Python library to control i3wm
License:        BSD
URL:            https://github.com/acrisci/i3ipc-python
BuildArch:      noarch

Source0:        https://github.com/acrisci/i3ipc-python/archive/v%{version}.tar.gz

# Submitted as: https://github.com/acrisci/i3ipc-python/pull/41
Patch0:         0001-Fix-setup.py-encoding.patch

BuildRequires:  python2-devel
BuildRequires:  python3-devel

%global desc \
i3's interprocess communication (or ipc) is the interface i3wm uses to receive\
commands from client applications such as i3-msg. It also features\
a publish/subscribe mechanism for notifying interested parties of window\
manager events.\
\
i3ipc-python is a Python library for controlling the window manager. This\
project is intended to be useful for general scripting, and for applications\
that interact with the window manager like status line generators, notification\
daemons, and pagers.\

%description
%{desc}

%package -n python2-i3ipc
Summary:        %{summary}
Requires:       python-xlib
Requires:       python-enum34
%{?python_provide:%python_provide python2-i3ipc}

%description -n python2-i3ipc
%{desc}

%if %{with python3}
%package -n python3-i3ipc
Summary:        %{summary}
Requires:       python3-xlib
%{?python_provide:%python_provide python3-i3ipc}

%description -n python3-i3ipc
%{desc}
%endif

%prep
%setup -q -n i3ipc-python-%{version}

%patch0 -p1

sed -i '/^#!/d' i3ipc.py

%build
%py2_build
%if %{with python3}
%py3_build
%endif

%install
%py2_install
%if %{with python3}
%py3_install
%endif


%files -n python2-i3ipc
%{python2_sitelib}/*
%license LICENSE
%doc README.rst

%if %{with python3}
%files -n python3-i3ipc
%{python3_sitelib}/*
%license LICENSE
%doc README.rst
%endif

%changelog
* Sun Jun 19 2016 Michael Simacek <msimacek@redhat.com> - 1.2.0-1
- Initial packaging