File dba-cairo-1142-static.spec of Package dba-cairo-1142-static

%define real_name cairo
%define prefix    /DBA/%{real_name}/%{version}
%define	version	1.14.2
%define vers    1142
%define dba_pix 1
%define dba_png 0
%define dba_xml 1
%if 0%{?sles_version} == 10
%define dba_pix 0

Name:		dba-%{real_name}-%{vers}-static
Summary:	A 2D graphics library version 1.14.2
Version:	%{version}
Release:	1%{?dist}
License:	LGPL-2.0
Group:		System Environment/Libraries
Patch3:         cairo-multilib.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires: autoconf automake libtool
BuildRequires: perl(ExtUtils::MakeMaker) perl(Digest::MD5) perl(Data::Dumper) perl(Module::Build)
BuildRequires: pkgconfig
%if 0%{?suse_version}
BuildRequires:  xorg-x11-devel
BuildRequires:  libX11-devel
BuildRequires: freetype-devel
BuildRequires: fontconfig-devel
BuildRequires: glib2-devel
BuildRequires: Mesa-devel

%if %{dba_pix}
BuildRequires:  dba-pixman-0326-static
%define pixpath /DBA/pixman/0.32.6
#!BuildIgnore:  libpixman-1-0-devel pixman-devel
BuildRequires:  pixman-devel

%if %{dba_png}
BuildRequires:  dba-libpng-1617-static
%define pngpath /DBA/libpng/1.6.17
#!BuildIgnore:  libpng-devel libpng
BuildRequires:  libpng-devel

%if %{dba_xml}
BuildRequires:  dba-libxml2-291-static
BuildRequires:  libxml2-devel
%define xmlpath /DBA/libxml2/2.9.1
BuildRequires:  libxml2-devel

%if 0%{?suse_version} >= 1100
BuildRequires:	-post-build-checks

Cairo is a 2D graphics library designed to provide high-quality display
and print output. Currently supported output targets include the X Window
System, OpenGL (via glitz), in-memory image buffers, and image files (PDF,
PostScript, and SVG).

Cairo is designed to produce consistent output on all output media while
taking advantage of display hardware acceleration when available (e.g.
through the X Render Extension or OpenGL).

%setup -q -n %{real_name}-%{version}
%patch3 -p1 -b .multilib

export CFLAGS="%{optflags}"
export LDFLAGS="$LDFLAGS -lX11"

%if %{dba_pix}
export CFLAGS="$CFLAGS -I%{pixpath}/include"
export CPPFLAGS="$CPPFLAGS -I%{pixpath}/include"
export LDFLAGS="$LDFLAGS -L%{pixpath}/lib"

%if %{dba_xml}
export CFLAGS="$CFLAGS -I%{xmlpath}/include"
export CPPFLAGS="$CPPFLAGS -I%{xmlpath}/include"
export LDFLAGS="$LDFLAGS -L%{xmlpath}/lib"

./configure \
  --prefix=%{prefix} \
  --disable-shared \
  --enable-static \
  --with-pic \
  --disable-xlib \
  --enable-win32=no \
%if %{dba_xml}
  --enable-xml \
  --enable-ft		\
  --enable-ps		\
  --enable-pdf		\
  --enable-svg		\
  --enable-tee		\
  --enable-gl		\
  --enable-gobject	\

sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make V=1 %{?_smp_mflags}

make install V=1 DESTDIR=$RPM_BUILD_ROOT
rm -f `find %{buildroot} -name *.la`

# add cairo*.pc to pkgconfig directory
if [ -d %{_libdir}/pkgconfig ]; then
  FILES=`ls cairo*.pc`
  cd %{_libdir}/pkgconfig
  for F in $FILES
  if [ -e $F ]; then
    %{__rm} -f $F
  %{__ln_s} -f %{prefix}/lib/pkgconfig/$F .

%dir %{prefix}

* Fri Apr 24 2015 Holger Manthey <>
- inital version