%define _libdir64 %{_prefix}/lib64 Summary: Generic Data Structures Library Name: gdsl Version: 1.6 Release: 1 License: GPL v2 Group: Libraries Source0: http://freesoftware.fsf.org/download/%{name}/%{name}-%{version}.tar.gz Source1: http://freesoftware.fsf.org/download/%{name}/%{name}-%{version}.tar.gz.sig URL: http://www.freesoftware.fsf.org/gdsl/ BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %description GDSL (Generic Data Structures Library) is a portable and OS-independant generic data structures manipulation library fully written in pure ANSI C from scratch, for C programmers. Most common data structures are available with powerful algorithms and hidden implementation. Available structures are lists, queues, stacks, hash tables, binary trees, search binary trees, red-black trees, 2D arrays, and permutations. %package devel Summary: Header files and development documentation for Generic Data Structures Library Group: Development/Libraries Requires: %{name} = %{version} %description devel Header files and development documentation for Generic Data Structures Library. %prep %setup -q 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" 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} \ --mandir=%{_mandir} \ --libdir=%{_libdir64} \ --enable-shared --disable-static make %{?_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} \ --mandir=%{_mandir} \ --enable-shared --disable-static make %{?_smp_mflags} %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 make 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}/lib%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}.so* ( cd ${RPM_BUILD_ROOT} for dir in bin 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/ChangeLog 32bit/NEWS 32bit/README 32bit/THANKS 32bit/TODO %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/src/examples/* 32bit/doc/html/*.html 32bit/doc/html/*.css 32bit/doc/html/*.png %{_bindir}/%{name}-config %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_mandir}/man3/* /usr/bin/%{name}-config /usr/include/* /usr/lib/*.la /usr/lib64/*.la %changelog * Thu Aug 23 2012 Michael Perzl - 1.6-1 - first version for AIX V5.1 and higher