# Place rpm-macros into proper location %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) # No Testcase run by default. To enable: rpm(or rpmbuild) -ba --define 'dotests 1' cmake*.spec %{!?dotests: %define dotests 0} Name: cmake Version: 3.14.3 Release: 1 Summary: Cross-platform, open-source build system Group: Development/Tools License: BSD URL: http://www.cmake.org Source0: https://cmake.org/files/v3.13/%{name}-%{version}.tar.gz Source1: cmake-init-aix Source2: macros.%{name} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root # we don't want any dependencies BuildConflicts: libidn BuildRequires: findutils, sed, coreutils BuildRequires: ncurses-devel >= 6.1-2 Patch1: cmake-3.14.1_NewAIXbehavior.patch Patch2: cmake-3.14.1_NewAIXbehavior_tests.patch Patch3: cmake-3.14.1_NewAIXbehavior_readme.patch Requires: %{name}-data = %{version}-%{release} Requires: %{name}-rpm-macros = %{version}-%{release} Requires: %{name}-filesystem = %{version}-%{release} Requires: ncurses >= 6.1-2 Requires: libgcc >= 6.3.0 Requires: libstdc++ >= 6.3.0 # 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. %package data Summary: Common data-files for %{name} Group: Development/Tools Requires: %{name} = %{version}-%{release} Requires: %{name}-filesystem = %{version}-%{release} Requires: %{name}-rpm-macros = %{version}-%{release} %description data This package contains common data-files for %{name}. %package filesystem Summary: Directories used by CMake modules Group: Development/Tools %description filesystem This package owns all directories used by CMake modules. %package rpm-macros Summary: Common RPM macros for %{name} Group: Development/Tools Requires: AIX-rpm # when subpkg introduced Conflicts: cmake-data < 3.10.1-2 #BuildArch: noarch %description rpm-macros This package contains common RPM macros for %{name}. %prep %setup -q %patch1 -p1 %patch2 -p1 %patch3 -p1 %build SO=`/usr/bin/df -k /var | 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 !" exit 1 fi SO=`/usr/bin/df -k /opt/freeware | 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 /opt !" 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. # -mcmodel is better, but not available in AIX6.1. export CFLAGS="-maix64 -DSYSV -D_AIX -D_ALL_SOURCE -DFUNCPROTO=15" %ifos aix6.1 export CFLAGS="$CFLAGS -D_AIX61" export LDFLAGS="-Wl,-bbigtoc" %endif %ifos aix7.1 aix7.2 #export CFLAGS="$CFLAGS -D_AIX71 -D_AIX72 -mcmodel=large" export CFLAGS="$CFLAGS -D_AIX71 -D_AIX72" export LDFLAGS="-Wl,-bbigtoc" %endif echo "C compiler version:" export CC=gcc export CXX=g++ $CC --version # no "-I/usr/vacpp/include" & "-I/opt/freeware/include" allowed otherwise compile of internal libs fails export CXXFLAGS="$CFLAGS" export FFLAGS="-maix64" export OBJECT_MODE=64 # It's weird cmake is not correctly processing --datadir & --docdir option. # It automatically adds prefix path before it so we need to give /share & /doc for them respectively ./bootstrap \ --verbose \ --parallel=16 \ --init=%{SOURCE1} \ --prefix=%{_prefix} \ --datadir=/share/%{name} \ --docdir=/doc/%{name}-%{version} # This phase requires nearly 6GB on /opt gmake --trace %{?_smp_mflags} -j16 VERBOSE=1 if [ "%{dotests}" == 1 ] then (gmake test || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} BUILD_CMAKE=`pwd` export OBJECT_MODE=64 gmake DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* find %{buildroot}/%{_datadir}/%{name}/Modules -type f | xargs chmod -x # RPM macros /opt/freeware/bin/install -p -m0644 -D %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name} /opt/freeware/bin/sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" %{buildroot}%{rpm_macros_dir}/macros.%{name} touch -r %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name} # Install copyright files for main package mkdir -p %{buildroot}/%{_docdir}/%{name}/ cp -p Copyright.txt %{buildroot}/%{_docdir}/%{name}/ /opt/freeware/bin/find Source Utilities -type f -iname copy\* | while read f do fname=$(basename $f) dir=$(dirname $f) dname=$(basename $dir) cp -p $f %{buildroot}/%{_docdir}/%{name}/${fname}_${dname} done cd $BUILD_CMAKE # create manifests for splitting files and directories for filesystem-package /opt/freeware/bin/find %{buildroot}%{_datadir}/%{name} -type d | \ sed -e 's!^%{buildroot}!%%dir "!g' -e 's!$!"!g' > data_dirs.mf /opt/freeware/bin/find %{buildroot}%{_datadir}/%{name} -type f | \ sed -e 's!^%{buildroot}!"!g' -e 's!$!"!g' > data_files.mf cp -r ./Auxiliary/bash-completion %{buildroot}%{_datadir} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,system,-) %{_prefix}/doc/%{name}-%{version}/ %{_bindir}/* %{_datadir}/%{name}/ %files data -f data_files.mf %defattr(-,root,system,-) %{_datadir}/aclocal/%{name}.m4 %{_datadir}/bash-completion %files filesystem -f data_dirs.mf %defattr(-,root,system,-) %files rpm-macros %defattr(-,root,system,-) %{rpm_macros_dir}/macros.%{name} %changelog * Fri Apr 26 2019 Ayappan P - 3.14.3-1 - Included patches created by bull team to fix library creation * Mon Feb 25 2019 Ayappan P - 3.13.4-1 - First release for AIX Toolbox * Fri Jun 15 2018 Sena Apeke - 3.11.4-1 - Add new version 3.11.4 * Thu May 03 2018 Ton 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