Summary: Anti-Grain Geometry graphical rendering engine Name: agg Version: 2.5 Release: 1 Group: System Environment/Libraries URL: http://www.antigrain.com License: GPLv2+ Source0: http://www.antigrain.com/%{name}-%{version}.tar.gz Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: automake, libtool, patch BuildRequires: gcc >= 4.2.3-2, gcc-c++ >= 4.2.3-2 BuildRequires: freetype2-devel >= 2.3.12-1 BuildRequires: SDL-devel >= 1.2.14-3 Requires: libgcc >= 4.2.3-2, libstdc++ >= 4.2.3-2 Requires: freetype2 >= 2.3.12-1 Requires: SDL >= 1.2.14-3 Patch0: agg-2.4-depends.patch Patch1: agg-2.5-pkgconfig.patch %define _libdir64 %{_prefix}/lib64 %description A High Quality Rendering Engine for C++. The library is available as 32-bit and 64-bit. %package devel Summary: Support files necessary to compile applications with agg Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: freetype2-devel >= 2.3.12-1 Requires: SDL-devel >= 1.2.14-3 %description devel Libraries, headers, and support files necessary to compile applications using agg. 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" or gcc -maix64". %prep %setup -q export PATH=/opt/freeware/bin:$PATH %patch0 -p1 -b .depends %patch1 -p1 -b .pkgconfig aclocal autoheader autoconf libtoolize --force automake --foreign --add-missing --ignore-deps mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include" export CXXFLAGS="${CFLAGS}" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export CC="gcc -maix64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" export CXX="g++ -maix64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" 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} \ --enable-shared --disable-static \ --enable-ctrl \ --enable-platform \ --enable-freetype \ --enable-gpc # parallel build fails in examples/ because the .la is in _LDFLAGS instead of # _LIBADD make cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export CC="gcc -maix32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" export CXX="g++ -maix32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --enable-shared --disable-static \ --enable-ctrl \ --enable-platform \ --enable-freetype \ --enable-gpc # parallel build fails in examples/ because the .la is in _LDFLAGS instead of # _LIBADD make %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install cd ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects for f in agg aggfontfreetype agggpc aggplatformX11 aggplatformsdl ; do /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/lib${f}.a ${RPM_BUILD_ROOT}%{_libdir64}/lib${f}.so* done rm -rf __dist_examples __clean_examples cp -a examples __clean_examples make -C __clean_examples distclean rm -rf __clean_examples/Makefile.am __clean_examples/{win32*,macosx*,BeOS} mkdir __dist_examples mv __clean_examples __dist_examples/examples ( cd ${RPM_BUILD_ROOT} for dir in include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/authors 32bit/copying 32bit/readme 32bit/news %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/__dist_examples/examples %{_includedir}/* %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc %{_datadir}/aclocal/*.m4 /usr/include* %changelog * Thu Mar 10 2011 Michael Perzl - 2.5-1 - first version for AIX V5.1 and higher