%define _libdir64 %{_prefix}/lib64 Name: libxcb Version: 1.7 Release: 1 Summary: A C binding to the X11 protocol Group: System Environment/Libraries License: MIT URL: http://xcb.freedesktop.org/ Source0: http://xcb.freedesktop.org/dist/%{name}-%{version}.tar.bz2 # This is stolen straight from the pthread-stubs source: # http://cgit.freedesktop.org/xcb/pthread-stubs/blob/?id=6900598192bacf5fd9a34619b11328f746a5956d # we don't need the library because AIX has working pthreads, but we need # the pkgconfig file so libs that link against libxcb know this... Source1: pthread-stubs.pc.in # Patch0: %{name}-%{version}-aix.patch Patch1: %{name}-%{version}-config_h.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: libxslt BuildRequires: make BuildRequires: pkg-config BuildRequires: python-devel BuildRequires: xcb-proto >= 1.6 %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. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "xlc_r -q64" or "gcc -maix64". %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CC="xlc_r" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} patch -s -p1 < %{PATCH1} gmake %{?_smp_mflags} cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} patch -s -p1 < %{PATCH1} gmake %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 gmake DESTDIR=${RPM_BUILD_ROOT} install cd ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install sed 's,@libdir@,%{_libdir},;s,@prefix@,%{_prefix},;s,@exec_prefix@,%{_exec_prefix},' %{SOURCE1} > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/pthread-stubs.pc sed 's,@libdir@,%{_libdir64},;s,@prefix@,%{_prefix},;s,@exec_prefix@,%{_exec_prefix},' %{SOURCE1} > $RPM_BUILD_ROOT%{_libdir64}/pkgconfig/pthread-stubs.pc ( cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done ) # add the 64-bit shared objects to the shared library containing already the # 32-bit shared objects export AR="ar -X32_64" ${AR} -q ${RPM_BUILD_ROOT}%{_libdir}/libxcb.a ${RPM_BUILD_ROOT}%{_libdir64}/libxcb.so.1 for f in composite damage dpms dri2 glx randr record render res\ screensaver shape shm sync xevie xf86dri xfixes xinerama \ xprint xtest xv xvmc ; do ${AR} -q ${RPM_BUILD_ROOT}%{_libdir}/libxcb-${f}.a ${RPM_BUILD_ROOT}%{_libdir64}/libxcb-${f}.so.0 done %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/COPYING 32bit/NEWS 32bit/README %{_libdir}/*.a %{_libdir64}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/COPYING 32bit/NEWS 32bit/README %{_includedir}/xcb %{_libdir}/*.la %{_libdir64}/*.la %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc %changelog * Wed Nov 10 2010 Michael Perzl - 1.7-1 - first version for AIX V5.1 and higher