%define _libdir64 %{_prefix}/lib64 Name: libgta Version: 1.0.7 Release: 1 Summary: Library that implements the Generic Tagged Arrays file format Group: System Environment/Libraries License: LGPLv2+ URL: http://gta.nongnu.org Source0: http://download.savannah.nongnu.org/releases/gta/%{name}-%{version}.tar.bz2 Source1: http://download.savannah.nongnu.org/releases/gta/%{name}-%{version}.tar.xz.sig Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: doxygen, make, tar BuildRequires: bzip2 >= 1.0.2 BuildRequires: zlib-devel >= 1.2.3-7 BuildRequires: xz-devel >= 5.2.2-1 Requires: bzip2 >= 1.0.2 Requires: zlib >= 1.2.3-7 Requires: xz >= 5.2.2-1 %description Libgta is a portable library that implements the GTA (Generic Tagged Arrays) file format. It provides interfaces for C and C++. The library is available as 32-bit and 64-bit. %package devel Summary: Development Libraries 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 "cc -q64" or "gcc -maix64". %package doc Summary: API documentation for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} %description doc The %{name}-doc package contains HTML API documentation and examples for %{name}. %prep export PATH=/opt/freeware/bin:$PATH %setup -q %patch0 # fake a as AIX5L V5.1 and XLC/C++ V7 doesn't have one cat > stdbool.h << EOF #ifndef stdbool_h_wrapper #define stdbool_h_wrapper typedef enum {false = 0, true = 1} bool; #endif EOF mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CONFIG_SHELL=/usr/bin/ksh export CONFIG_ENV_ARGS=/usr/bin/ksh export CC="xlc_r" export CXX="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} \ --enable-shared --disable-static 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} \ --enable-shared --disable-static 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 ( 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 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.so* ( 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/COPYING 32bit/AUTHORS 32bit/README %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %{_includedir}/* %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc /usr/include/* %files doc %defattr(-,root,system,-) %doc 32bit/doc/example* %doc 32bit/doc/reference %changelog * Fri Jan 01 2016 Michael Perzl - 1.0.7-1 - updated to version 1.0.7-1 * Sun Mar 09 2014 Michael Perzl - 1.0.5-1 - updated to version 1.0.5-1 * Wed Dec 19 2012 Michael Perzl - 1.0.4-1 - updated to version 1.0.4-1 * Mon Sep 24 2012 Michael Perzl - 1.0.3-1 - updated to version 1.0.3-1 * Mon Jul 09 2012 Michael Perzl - 1.0.2-1 - first version for AIX V5.1 and higher