+#
+# Conditional build:
+%bcond_without python3 # CPython 3.x module
+
Summary: XML-XCB protocol description files
Summary(pl.UTF-8): Pliki opisu protokołu XML-XCB
Name: xcb-proto
Version: 1.14
-Release: 1
+Release: 2
License: MIT
Group: Development/Libraries
#Source0: https://xcb.freedesktop.org/dist/%{name}-%{version}.tar.bz2
URL: https://xcb.freedesktop.org/
BuildRequires: libxml2-progs
BuildRequires: python >= 1:2.5
+%{?with_python3:BuildRequires: python3}
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
BuildRequires: tar >= 1:1.22
BuildRequires: xz
Requires: python >= 1:2.5
+Requires: python-xcbgen = %{version}-%{release}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
dowiązania dla innych języków, analizatory protokołu czy generatory
dokumentacji.
+%package -n python-xcbgen
+Summary: Python 2 xcbgen module
+Summary(pl.UTF-8): Moduł xcbgen dla Pythona 2
+Group: Libraries/Python
+
+%description -n python-xcbgen
+Python 2 xcbgen module.
+
+%description -n python-xcbgen -l pl.UTF-8
+Moduł xcbgen dla Pythona 2.
+
+%package -n python3-xcbgen
+Summary: Python 3 xcbgen module
+Summary(pl.UTF-8): Moduł xcbgen dla Pythona 3
+Group: Libraries/Python
+
+%description -n python3-xcbgen
+Python 3 xcbgen module.
+
+%description -n python3-xcbgen -l pl.UTF-8
+Moduł xcbgen dla Pythona 3.
+
%prep
%setup -q
+%if %{with python3}
+mkdir build3
+%endif
+mkdir build2
%build
-%configure
+%if %{with python3}
+cd build3
+PYTHON=%{__python3} \
+../%configure
+%{__make}
+cd ..
+%endif
+
+cd build2
+PYTHON=%{__python} \
+../%configure
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
+%if %{with python3}
+cd build3
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+cd ..
+%endif
+
+cd build2
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
%doc COPYING NEWS README.md TODO doc/xml-xcb.txt
%{_datadir}/xcb
%{_pkgconfigdir}/xcb-proto.pc
+
+%files -n python-xcbgen
+%defattr(644,root,root,755)
%{py_sitescriptdir}/xcbgen
+
+%if %{with python3}
+%files -n python3-xcbgen
+%defattr(644,root,root,755)
+%{py3_sitedir}/xcbgen
+%endif