# Tests by default. No tests: rpmbuild -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %global _libdir64 %{_libdir}64 Name: cppunit Version: 1.15.1 Release: 1 Summary: C++ unit testing framework # no license in files License: LGPLv2+ Group: Development/Libraries URL: http://cppunit.sourceforge.net/ Source0: http://downloads.sourceforge.net/cppunit/%{name}-%{version}.tar.gz Requires: libgcc >= 8.3.0 Requires: libstdc++ >= 8.3.0 %description CppUnit is the C++ port of the famous JUnit framework for unit testing. Test output is in XML for automatic testing and GUI based for supervised tests. The library is available as 32-bit and 64-bit. %package devel Summary: Libraries and headers for cppunit development Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config %description devel This package contains the libraries and headers necessary for developing programs that use cppunit. 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 -q64" or "g++ -maix64". %package doc Summary: HTML formatted API documention for cppunit Group: Documentation %description doc The cppunit-doc package contains HTML formatted API documention generated by the popular doxygen documentation generation tool. %prep %setup -q rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -fr * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit %build # setup environment for 32-bit and 64-bit builds export AR="ar -X32_64" export NM="nm -X32_64" export CONFIG_SHELL=/opt/freeware/bin/bash export CONFIG_ENV_ARGS=/opt/freeware/bin/bash # first build the 64-bit version cd 64bit export OBJECT_MODE=64 export CC="gcc -maix64 -O2" export CXX="g++ -maix64 -O2" export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --mandir=%{_mandir} \ --enable-shared --disable-static gmake %{?_smp_mflags} V=1 if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi # now build the 32-bit version cd ../32bit export OBJECT_MODE=32 export CC="gcc -O2 -D_LARGE_FILES" export CXX="g++ -O2 -D_LARGE_FILES" 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 gmake %{?_smp_mflags} V=1 if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi # add the 64-bit shared objects to the shared library containing already the # 32-bit shared objects slibclean ${AR} -q src/%{name}/.libs/lib%{name}-1.15.a ../64bit/src/%{name}/.libs/lib%{name}-1.15.so.1 %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} #install on 64bit mode cd 64bit export OBJECT_MODE=64 gmake DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_64 done ) #install on 32bit mode cd ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_32 ln -sf "$fic"_64 $fic done ) rm -rf __dist-examples __dist-examples-dir cp -a examples __dist-examples make -C __dist-examples distclean # Makefile.am files are left as documentation find __dist-examples \( -name Makefile.in -o -name .gitignore -o -name '*.opt' -o -name '*.sln' -o -name '*.vcproj' \) -exec rm {} \; mkdir __dist-examples-dir mv __dist-examples __dist-examples-dir/examples %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/AUTHORS 32bit/COPYING 32bit/NEWS 32bit/README 32bit/THANKS 32bit/ChangeLog 32bit/TODO 32bit/BUGS 32bit/doc/FAQ %{_bindir}/DllPlugInTester* %{_libdir}/*.a %{_libdir64}/*.a %files devel %defattr(-,root,system,-) %{_includedir}/* %{_libdir}/pkgconfig/cppunit.pc %{_libdir64}/pkgconfig/cppunit.pc %files doc %defattr(-,root,system,-) %doc 32bit/__dist-examples-dir/examples/ #%doc 32bit/doc/html %changelog * Fri Aug 21 2020 Reshma V Kumar < reskumar@in.ibm.com> - 1.15.1-1 - Initial build for AIX Toolbox * Tue Oct 26 2010 Michael Perzl - 1.12.1-1 - first version for AIX V5.1 and higher