%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

%define xpyb_version 1.2

Summary:        A C binding to the X11 protocol
Summary(ja):    X11 プロトコルの C による実装
Name:           libxcb
Version:        1.8
Release:        1%{?_dist_release}

Group:          System Environment/Libraries
License:        MIT
URL:            http://xcb.freedesktop.org/
Source0:        http://xcb.freedesktop.org/dist/%{name}-%{version}.tar.bz2

Patch10:        libxcb-1.7-no-pthread-stubs.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires:  autoconf automake libtool pkgconfig
#BuildRequires:  doxygen
#BuildRequires:  graphviz
BuildRequires:  libXau-devel
BuildRequires:  libxslt
BuildRequires:  xcb-proto >= 1.6
BuildRequires:  xorg-x11-proto-devel
BuildRequires:  xorg-x11-util-macros
BuildRequires:  python-devel

Obsoletes:	%{name}-python < 1.8

%description
The X protocol C-language Binding (XCB) is a replacement for Xlib featuring a
small footprint, latency hiding, direct access to the protocol, improved
threading support, and extensibility.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package        doc
Summary:        Documentation for %{name}
Group:          Documentation

%description    doc
The %{name}-doc package contains documentation for the %{name} library.

%package        -n compat32-%{name}
Summary:        A C binding to the X11 protocol
Summary(ja):    X11 プロトコルの C による実装
Group:          System Environment/Libraries

%description    -n compat32-%{name}
The X protocol C-language Binding (XCB) is a replacement for Xlib featuring a
small footprint, latency hiding, direct access to the protocol, improved
threading support, and extensibility.

%package        -n compat32-%{name}-devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       compat32-%{name} = %{version}-%{release}
Requires:       %{name}-devel = %{version}-%{release}

%description    -n compat32-%{name}-devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%setup -q
%patch10 -p1

%build
autoreconf -v --install
%configure --disable-static --docdir=%{_datadir}/doc/%{name}-%{version} --disable-selinux
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' | xargs rm -f
install -m 644 COPYING NEWS README $RPM_BUILD_ROOT/%{_datadir}/doc/%{name}-%{version}

find $RPM_BUILD_ROOT -name '*.la' -delete

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%post -n compat32-%{name} -p /sbin/ldconfig
%postun -n compat32-%{name} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/xcb
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

%files doc
%defattr(-,root,root,-)
%{_datadir}/doc/%{name}-%{version}

%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root,-)
%{_libdir}/*.so.*

%files  -n compat32-%{name}-devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%endif

%changelog
* Sun Jan 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.8-1
- new upstream release
- remove Source2
- remove python sub package

* Sun Nov 07 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.7-1
- new upstream release
- update Patch10

* Tue Sep 21 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.5-3
- add BuildRequires: python-devel

* Tue Sep 21 2010 IWAI, Masaharu <iwai@alib.jp> 1.5-2
- build with rpm-4.8.1-1 for pkg-config file

* Mon Mar 08 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 1.5-1
- new upstream release

* Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 1.4-2
- rebuild with python-2.6

* Tue Nov 17 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4-1
- new upstream release
- add libxcb python binding (xpyb)

* Sun May 03 2009 NAKAMURA Kenta <kenta@vinelinux.org> 1.2-2
- added compat32 package for x86_64 arch support

* Wed Mar 18 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2-1
- new upstream release

* Mon Sep 29 2008 Shu KONNO <owa@bg.wakwak.com> 1.1-2
- spec in utf-8
- added japanese summary

* Sun May 18 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.1-1
- new versioning policy

* Sun Jan 13 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.1-0vl1
- initial build for Vine Linux

* Mon Nov 12 2007 Adam Jackson <ajax@redhat.com> 1.1-1
- libxcb 1.1

* Fri Aug 24 2007 Adam Jackson <ajax@redhat.com> 1.0-3
- libxcb-1.0-abstract-socket.patch: When connecting to the X server, prefer
  abstract-namespace unix sockets to filesystem-bound sockets.

* Wed Aug 22 2007 Adam Jackson <ajax@redhat.com> - 1.0-2
- Rebuild for PPC toolchain bug

* Fri Jun 29 2007 Adam Jackson <ajax@redhat.com> 1.0-1
- Initial revision.
