# By default, tests are run. # No tests: rpmbuild -ba --without dotests *.spec %bcond_without dotests %global major_version 3 %global minor_version 16 Name: cmake Version: %{major_version}.%{minor_version}.0 Release: 1 Summary: Cross-platform, open-source build system Group: Development/Tools License: BSD URL: http://www.cmake.org Source0: https://github.com/Kitware/CMake/releases/download/v3.16.0/%{name}-%{version}.tar.gz Patch1: cmake-3.16.0_NewAIXbehavior.patch Patch2: cmake-3.16.0_NewAIXbehavior_tests.patch Patch3: cmake-3.16.0_NewAIXbehavior_readme.patch BuildRequires: gcc make Requires: %{name}-data = %{version}-%{release} Requires: ncurses >= 6.1-2 Requires: libgcc >= 8.3.0-1 Requires: libstdc++ >= 8.3.0-1 # Unsued package on AIX. Obsoletes: %{name}-filesystem Obsoletes: %{name}-rpm-macros # cmake depends on the availability of functions, like futimens, appearing in 7.1 # So, cmake must be built on AIX 6.1 and on AIX 7.1 # The AIX 6.1 version should work on AIX 7.* too, but without some features %ifos aix6.1 Requires: AIX-rpm >= 6.1.0.0 Requires: AIX-rpm < 6.2.0.0 %endif %ifos aix7.1 aix7.2 Requires: AIX-rpm >= 7.1.0.0 %endif %description CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice. CMake is quite sophisticated: it is possible to support complex environments requiring system configuration, pre-processor generation, code generation, and template instantiation. Behavior of CMake on AIX has been changed in 3.14 to obey to AIX rules. See /opt/freeware/share/cmake-3.16/Modules/readme_aix.txt for more informations. %package data Summary: Common data-files for %{name} Group: Development/Tools Requires: %{name} = %{version}-%{release} %description data This package contains common data-files for %{name}. %prep %setup -q %patch1 -p1 %patch2 -p1 %patch3 -p1 %build env | /usr/bin/sort # Quiet ar needed for test export AR="/usr/bin/ar -c" # Verify disk space for tests. SO=`/usr/bin/df -k /var/tmp | awk '{if(NR==2)print $3}'` echo "Disk space available for building cmake must be >= 2GB" if [ "$SO" -lt 2000000 ] then echo "Not enough disk space on /var/tmp !" exit 1 fi SO=`/usr/bin/df -k /home | awk '{if(NR==2)print $3}'` echo "Disk space available for building cmake must be >= 6.5GB" if [ "$SO" -lt 6500000 ] then echo "Not enough disk space on /home !" exit 1 fi # Utilities/cmlibuv/src/unix/fs.c : # #elif defined(_AIX71) # return futimens(req->file, ts); # -mcmodel=large or -Wl,-bbigtoc is required to link ctest. # 32 bits only: -Wl,-bmaxdata:0x80000000" LDFLAGS="-pthread" CFLAGS="-D_LARGE_FILES -DSYSV -D_AIX -D_ALL_SOURCE -DFUNCPROTO=15 -mcmodel=large -pthread -maix64" export LDFLAGS="$LDFLAGS" %ifos aix6.1 export CFLAGS="$CFLAGS -D_AIX61" %else # aix7.1 aix7.2 export CFLAGS="$CFLAGS -D_AIX71 -D_AIX72" %endif export OBJECT_MODE=64 echo "C compiler version:" export CC=gcc export CXX=g++ $CC --version $CXX --version export CXXFLAGS="$CFLAGS" %define _smp_parallel %(echo %{?_smp_mflags} | sed "s|-j|--parallel=|") ./bootstrap \ --verbose \ %{_smp_parallel} \ --prefix=%{_prefix} # This phase requires nearly 6GB on /opt gmake --trace %{?_smp_mflags} VERBOSE=1 %if %{with dotests} ( gmake test || true ) %endif %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export AR="/usr/bin/ar -c" export OBJECT_MODE=64 %define _cmakedatadir %{_datadir}/%{name}-%{major_version}.%{minor_version} %define _cmakedocdir %{_docdir}/%{name}-%{major_version}.%{minor_version} BUILD_CMAKE=`pwd` gmake DESTDIR=${RPM_BUILD_ROOT} install %{?_smp_mflags} /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* find %{buildroot}%{_cmakedatadir}/Modules -type f | xargs chmod -x # Install copyright files for main package mkdir -p %{buildroot}/%{_cmakedocdir} cp -p Copyright.txt %{buildroot}%{_cmakedocdir}/ cd $BUILD_CMAKE cp -r ./Auxiliary/bash-completion %{buildroot}%{_datadir} # CMake provides an include file... in share directory. mkdir %{buildroot}%{_includedir}/ mv %{buildroot}%{_cmakedatadir}/include/cmCPluginAPI.h %{buildroot}%{_includedir}/ rmdir %{buildroot}%{_cmakedatadir}/include chmod +x %{buildroot}%{_cmakedatadir}/Modules/Platform/AIX/ExportImportList %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) # Licence %{_cmakedocdir} %{_bindir}/* %files data %defattr(-,root,system,-) # aclocal, cmake scripts, bash-completion and documentation %{_cmakedatadir} %{_includedir}/* %changelog * Tue Dec 17 2019 Reshma V Kumar - 3.16.0-1 - Update to version 3.16.0 for AIX Toolbox * Wed Nov 27 2019 Etienne Guesnet - 3.16.0-1 - New version 3.16.0 - Automatic export of symbols * Wed Sep 11 2019 Etienne Guesnet - 3.15.3-1 - New version 3.15.3 - Now compile on 64 bit - Do not distribute macro nor filesystem subpackage - Improve way to create a library * Tue Apr 23 2019 Etienne Guesnet - 3.14.3-1 - Port new version 3.14.3 - Add more 64bit tests * Thu Apr 18 2019 Etienne Guesnet - 3.14.2-1 - Port new version 3.14.2 - Erase unused files. * Wed Apr 17 2019 Etienne Guesnet - 3.14.1-1 - Port new version 3.14.1 - Improved AIX port. * Fri Jun 15 2018 Sena Apeke - 3.11.4-1 - Add new version 3.11.4 * Thu May 03 2018 Tony Reix - 3.11.1-1 - upgrade for AIX V6.1 * Fri Jul 24 2015 Laurent Gay - 3.2.3-1 - upgrade for AIX V6.1 * Tue May 24 2011 Gerard Visiedo - 2.8.4-1 - initial version for AIX V5.3