Ignore:
Timestamp:
Mar 14, 2023, 6:16:06 PM (2 years ago)
Author:
tellie
Message:

spec: cmake: Release version 3.20.6-2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • spec/trunk/SPECS/cmake.spec

    r1695 r1830  
    1 # Do we add appdata-files? (disabled)
     1# Do we add appdata-files?
    22# consider conditional on whether %%_metainfodir is defined or not instead -- rex
     3%if 0%{?fedora} || 0%{?rhel} > 7
     4%bcond_without appdata
     5%else
    36%bcond_with appdata
     7%endif
    48
    59# Set to bcond_without or use --with bootstrap if bootstrapping a new release
    610# or architecture
     11%if !0%{?os2_version}
     12%bcond_with bootstrap
     13%else
    714%bcond_without bootstrap
    8 
    9 # Build with Emacs support (disabled)
     15%endif
     16
     17# Build with Emacs support
     18%if !0%{?os2_version}
     19%bcond_without emacs
     20%else
    1021%bcond_with emacs
    11 
    12 # Run git tests (disabled)
     22%global _emacs_sitelispdir %{_prefix}/share/emacs
     23%endif
     24
     25# Run git tests
     26%if !0%{?os2_version}
     27%bcond_without git_test
     28%else
    1329%bcond_with git_test
     30%endif
    1431
    1532# Set to bcond_with or use --without gui to disable qt4 gui build
     
    2037
    2138# Setting the Python-version used by default
     39%if 0%{?rhel} && 0%{?rhel} < 8
    2240%bcond_with python3
     41%else
     42%bcond_without python3
     43%endif
    2344
    2445# Enable RPM dependency generators for cmake files written in Python
    2546%bcond_without rpm
    2647
    27 # enable this when we have Sphinx-build (disabled)
     48%if !0%{?os2_version}
     49%bcond_without sphinx
     50%else
    2851%bcond_with sphinx
    29 
    30 # Run tests (disabled)
     52%endif
     53
     54%if 0%{?os2_version}
     55%bcond_with bundled_jsoncpp
     56%bcond_without bundled_rhash
     57%else
     58%if !0%{?rhel}
     59%bcond_with bundled_jsoncpp
     60%bcond_with bundled_rhash
     61%else
     62%bcond_without bundled_jsoncpp
     63%bcond_without bundled_rhash
     64%endif
     65%endif
     66
     67# Run tests
     68%if !0%{?os2_version}
     69%bcond_without test
     70%else
    3171%bcond_with test
    32 
    33 # Enable X11 tests (disabled)
     72%endif
     73
     74# Enable X11 tests
     75%if !0%{?os2_version}
     76%bcond_without X11_test
     77%else
    3478%bcond_with X11_test
     79%endif
     80
     81# Do not build non-lto objects to reduce build time significantly.
     82%global optflags %(echo '%{optflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g')
    3583
    3684# Place rpm-macros into proper location
     
    4088%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
    4189
     90# Setup _vpath_builddir if not defined already
     91%{!?_vpath_builddir:%global _vpath_builddir %(echo '%{_target_platform}' | sed -e 's!/!!g')}
     92
    4293%global major_version 3
    43 %global minor_version 10
     94%global minor_version 20
    4495# Set to RC version if building RC, else %%{nil}
    45 #global rcsuf rc3
     96#global rcsuf rc1
    4697%{?rcsuf:%global relsuf .%{rcsuf}}
    4798%{?rcsuf:%global versuf -%{rcsuf}}
     99
     100# For handling bump release by rpmdev-bumpspec and mass rebuild
     101%global baserelease 1
    48102
    49103# Uncomment if building for EPEL
     
    51105%global orig_name cmake
    52106
    53 
    54107Name:           %{orig_name}%{?name_suffix}
    55 Version:        %{major_version}.%{minor_version}.3
    56 Release:        1%{?dist}
     108Version:        %{major_version}.%{minor_version}.6
     109Release:        2%{?dist}
    57110Summary:        Cross-platform make system
    58111
     
    64117License:        BSD and MIT and zlib
    65118URL:            http://www.cmake.org
     119%if !0%{?os2_version}
     120Source0:        http://www.cmake.org/files/v%{major_version}.%{minor_version}/%{orig_name}-%{version}%{?versuf}.tar.gz
     121Source1:        %{name}-init.el
     122%else
    66123Vendor:         bww bitwise works GmbH
    67 %scm_source github http://github.com/bitwiseworks/cmake-os2 master
     124%scm_source github http://github.com/bitwiseworks/cmake-os2 %{version}-os2
     125%endif
    68126Source2:        macros.%{name}
    69127# See https://bugzilla.redhat.com/show_bug.cgi?id=1202899
     
    72130Source5:        %{name}.req
    73131
     132%if !0%{?os2_version}
     133# Always start regular patches with numbers >= 100.
     134# We need lower numbers for patches in compat package.
     135# And this enables us to use %%autosetup
     136#
     137# Patch to fix RindRuby vendor settings
     138# http://public.kitware.com/Bug/view.php?id=12965
     139# https://bugzilla.redhat.com/show_bug.cgi?id=822796
     140Patch100:       %{name}-findruby.patch
     141# Add dl to CMAKE_DL_LIBS on MINGW
     142# https://gitlab.kitware.com/cmake/cmake/issues/17600
     143%if 0%{?fedora} && 0%{?fedora} < 38
     144Patch102:       %{name}-mingw-dl.patch
     145%endif
     146
     147# Patch for renaming on EPEL
     148%if 0%{?name_suffix:1}
     149Patch1:         %{name}-rename.patch
     150%endif
     151%endif
     152
    74153BuildRequires:  coreutils
    75154BuildRequires:  findutils
    76 BuildRequires:  gcc
    77 #BuildRequires:  gcc-gfortran
     155BuildRequires:  gcc-c++
     156%if !0%{?os2_version}
     157BuildRequires:  gcc-gfortran
     158%endif
    78159BuildRequires:  sed
     160%if !0%{?os2_version}
     161%if %{with git_test}
     162# Tests fail if only git-core is installed, bug #1488830
    79163BuildRequires:  git
     164%else
     165BuildConflicts: git-core
     166%endif
     167%endif
    80168%if %{with X11_test}
    81169BuildRequires:  libX11-devel
     
    87175BuildRequires:  %{_bindir}/sphinx-build
    88176%endif
    89 %if %{without bootstrap}
     177%if %{without bootstrap} || 0%{?os2_version}
    90178BuildRequires:  bzip2-devel
    91179BuildRequires:  curl-devel
    92180BuildRequires:  expat-devel
    93 #BuildRequires:  jsoncpp-devel
    94 #BuildRequires:  libarchive-devel
    95 #BuildRequires:  libuv-devel
    96 #BuildRequires:  rhash-devel
     181%if %{with bundled_jsoncpp}
     182Provides: bundled(jsoncpp)
     183%else
     184BuildRequires:  jsoncpp-devel
     185%endif
     186%if !0%{?os2_version}
     187%if 0%{?fedora} || 0%{?rhel} >= 7
     188BuildRequires:  libarchive-devel
     189%else
     190BuildRequires:  libarchive3-devel
     191%endif
     192%endif
     193BuildRequires:  libuv-devel
     194%if %{with bundled_rhash}
     195Provides:  bundled(rhash)
     196%else
     197BuildRequires:  rhash-devel
     198%endif
    97199BuildRequires:  xz-devel
    98200BuildRequires:  zlib-devel
     201%if !0%{?os2_version}
     202BuildRequires:  vim-filesystem
     203%endif
    99204%endif
    100205%if %{with emacs}
    101206BuildRequires:  emacs
    102207%endif
     208BuildRequires:  openssl-devel
    103209%if %{with rpm}
    104210%if %{with python3}
     
    110216%endif
    111217%if %{with gui}
     218%if 0%{?fedora} || 0%{?rhel} > 7 || 0%{?os2_version}
    112219BuildRequires: pkgconfig(Qt5Widgets)
    113 %if %{with appdata}
     220%else
     221BuildRequires: pkgconfig(QtGui)
     222%endif
     223%if !0%{?os2_version}
    114224BuildRequires: desktop-file-utils
    115225%endif
     226%endif
     227
     228%if !0%{?os2_version}
     229BuildRequires: pkgconfig(bash-completion)
     230%global bash_completionsdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null || echo '%{_datadir}/bash-completion/completions')
    116231%endif
    117232
     
    120235BuildRequires:  %{name}-rpm-macros
    121236%endif
     237BuildRequires: make
    122238
    123239Requires:       %{name}-data = %{version}-%{release}
    124240Requires:       %{name}-rpm-macros = %{version}-%{release}
     241%if !0%{?os2_version}
     242Requires:       %{name}-filesystem%{?_isa} = %{version}-%{release}
     243%else
    125244Requires:       %{name}-filesystem = %{version}-%{release}
     245%endif
     246
     247# Explicitly require make.  (rhbz#1862014)
     248Requires:       make
    126249
    127250# Provide the major version name
    128251Provides: %{orig_name}%{major_version} = %{version}-%{release}
    129252
     253# Source/kwsys/MD5.c
     254# see https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries
     255Provides: bundled(md5-deutsch)
     256
     257# https://fedorahosted.org/fpc/ticket/555
     258Provides: bundled(kwsys)
    130259
    131260%description
     
    144273Requires:       %{name}-rpm-macros = %{version}-%{release}
    145274%if %{with emacs}
     275%if 0%{?fedora} || 0%{?rhel} >= 7
    146276Requires:       emacs-filesystem%{?_emacs_version: >= %{_emacs_version}}
     277%endif
     278%endif
     279%if !0%{?os2_version}
     280Requires:       vim-filesystem
    147281%endif
    148282
     
    172306Summary:        Qt GUI for %{name}
    173307
     308%if !0%{?os2_version}
     309Requires:       %{name}%{?_isa} = %{version}-%{release}
     310Requires:       hicolor-icon-theme
     311Requires:       shared-mime-info%{?_isa}
     312%else
    174313Requires:       %{name} = %{version}-%{release}
    175 %if %{with appdata}
    176 Requires:       hicolor-icon-theme
    177 Requires:       shared-mime-info
    178314%endif
    179315
     
    195331
    196332
     333%if 0%{?os2_version}
    197334%debug_package
    198 
     335%endif
    199336
    200337%prep
     338%if !0%{?os2_version}
     339%autosetup -n %{orig_name}-%{version}%{?versuf} -p 1
     340%else
    201341%scm_setup
     342%endif
    202343
    203344%if %{with rpm}
     
    215356
    216357%build
    217 export CFLAGS="%{optflags}"
    218 export CXXFLAGS="%{optflags}"
     358%if 0%{?set_build_flags:1}
     359%{set_build_flags}
     360%else
     361CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS
     362CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS
     363FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS
     364FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS
     365%if !0%{?os2_version}
     366%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;}
     367%else
    219368export LDFLAGS="-Zomf -Zhigh-mem -lcx %{?__global_ldflags}"
    220369export VENDOR="%{vendor}"
    221 mkdir build
    222 cd build
    223 #             --%{?with_bootstrap:no-}system-libs \
    224 #             --parallel=`/usr/bin/getconf _NPROCESSORS_ONLN` \
    225 ../bootstrap --prefix=%{_prefix} --datadir=/share/%{name} \
    226              --docdir=/share/doc/%{name} --mandir=/share/man \
    227              --verbose --system-bzip2 --system-curl --system-expat \
    228              --system-liblzma --system-zlib \
     370%endif
     371%endif
     372%if !0%{?os2_version}
     373SRCDIR="$(/usr/bin/pwd)"
     374mkdir %{_vpath_builddir}
     375pushd %{_vpath_builddir}
     376%else
     377SRCDIR="$(/@unixroot/usr/bin/pwd)"
     378mkdir %{_vpath_builddir}
     379cd %{_vpath_builddir}
     380%endif
     381$SRCDIR/bootstrap --prefix=%{_prefix} \
     382                  --datadir=/share/%{name} \
     383                  --docdir=/share/doc/%{name} \
     384                  --mandir=/share/man \
     385%if !0%{?os2_version}
     386                  --%{?with_bootstrap:no-}system-libs \
     387%else
     388                  --bootstrap-system-libuv \
     389                  --system-libs \
     390                  --no-system-libarchive \
     391                  --no-system-nghttp2 \
     392                  --no-system-zstd \
     393%endif
     394                  --parallel="$(echo %{?_smp_mflags} | sed -e 's|-j||g')" \
     395%if %{with bundled_rhash}
     396                  --no-system-librhash \
     397%endif
     398%if %{with bundled_jsoncpp}
     399                  --no-system-jsoncpp \
     400%endif
    229401%if %{with sphinx}
    230              --sphinx-man --sphinx-html} \
    231 %else
    232              --sphinx-build=%{_bindir}/false \
    233 %endif
    234              --%{!?with_gui:no-}qt-gui \
    235              -- -DCMAKE_USE_OPENSSL:BOOL=ON \
    236 ;
    237 make VERBOSE=1
     402                  --sphinx-man --sphinx-html \
     403%else
     404                  --sphinx-build=%{_bindir}/false \
     405%endif
     406                  --%{!?with_gui:no-}qt-gui \
     407                  -- \
     408                  -DCMAKE_C_FLAGS_RELEASE:STRING="-O2 -g -DNDEBUG" \
     409                  -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 -g -DNDEBUG" \
     410                  -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-O2 -g -DNDEBUG" \
     411                  -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
     412                  -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF
     413%if !0%{?os2_version}
     414popd
     415%make_build -C %{_vpath_builddir}
     416%else
     417cd ..
     418make -C %{_vpath_builddir}
     419%endif
    238420
    239421
    240422%install
    241 rm -rf %{buildroot}
    242423mkdir -p %{buildroot}%{_pkgdocdir}
    243 %make_install -C build CMAKE_DOC_DIR=%{buildroot}%{_pkgdocdir}
    244 find %{buildroot}/%{_datadir}/%{name}/Modules -type f | xargs chmod -x
    245 [ -n "$(find %{buildroot}/%{_datadir}/%{name}/Modules -name \*.orig)" ] &&
     424%make_install -C %{_vpath_builddir} CMAKE_DOC_DIR=%{buildroot}%{_pkgdocdir}
     425find %{buildroot}%{_datadir}/%{name}/Modules -type f | xargs chmod -x
     426[ -n "$(find %{buildroot}%{_datadir}/%{name}/Modules -name \*.orig)" ] &&
    246427  echo "Found .orig files in %{_datadir}/%{name}/Modules, rebase patches" &&
    247428  exit 1
    248429# Install major_version name links
     430%if !0%{?os2_version}
     431%{!?name_suffix:for f in ccmake cmake cpack ctest; do ln -s $f %{buildroot}%{_bindir}/${f}%{major_version}; done}
     432%else
    249433%{!?name_suffix:for f in ccmake cmake cpack ctest; do ln -s ${f}.exe %{buildroot}%{_bindir}/${f}%{major_version}; done}
    250 # Install bash completion symlinks
    251 #mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
    252 #for f in %{buildroot}%{_datadir}/%{name}/completions/*
    253 #do
    254 #  ln -s ../../%{name}/completions/$(basename $f) %{buildroot}%{_datadir}/bash-completion/completions
    255 #done
     434%endif
     435
     436%if 0%{?os2_version}
     437rm -rf %{buildroot}%{_prefix}/share/vim
     438rm -rf %{buildroot}%{_prefix}/share/bash-completion
     439%endif
    256440%if %{with emacs}
    257441# Install emacs cmake mode
    258 mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{name}
    259 install -p -m 0644 Auxiliary/cmake-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name}/%{name}-mode.el
     442mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{name} %{buildroot}%{_emacs_sitestartdir}
     443mv %{buildroot}%{_emacs_sitelispdir}/%{name}-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name}
    260444%{_emacs_bytecompile} %{buildroot}%{_emacs_sitelispdir}/%{name}/%{name}-mode.el
    261 mkdir -p %{buildroot}%{_emacs_sitestartdir}
    262 install -p -m 0644 %SOURCE1 %{buildroot}%{_emacs_sitestartdir}
     445install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir}
     446%else
     447rm -rf %{buildroot}%{_emacs_sitelispdir}
    263448%endif
    264449# RPM macros
     
    296481%if %{with gui}
    297482# Desktop file
    298 %if %{with appdata}
     483%if !0%{?os2_version}
    299484desktop-file-install --delete-original \
    300485  --dir=%{buildroot}%{_datadir}/applications \
    301486  %{buildroot}%{_datadir}/applications/%{name}-gui.desktop
    302 
     487%endif
     488
     489%if %{with appdata}
    303490# Register as an application to be visible in the software center
    304491#
     
    349536find %{buildroot}%{_libdir}/%{orig_name} -type f | \
    350537  sed -e 's!^%{buildroot}!"!g' -e 's!$!"!g' > lib_files.mf
     538%if !0%{?os2_version}
     539find %{buildroot}%{_bindir} -type f -or -type l -or -xtype l | \
     540  sed -e '/.*-gui$/d' -e '/^$/d' -e 's!^%{buildroot}!"!g' -e 's!$!"!g' >> lib_files.mf
     541%else
    351542find %{buildroot}%{_bindir} -type f -or -type l -or -xtype l | \
    352543  sed -e '/.*-gui.exe$/d' -e '/^$/d' -e 's!^%{buildroot}!"!g' -e 's!$!"!g' >> lib_files.mf
    353 
     544%endif
    354545
    355546%if %{with test}
    356547%check
    357 cd build
    358 #CMake.FileDownload, CTestTestUpload, and curl require internet access
    359 # RunCMake.CPack_RPM is broken if disttag contains "+", bug #1499151
    360 NO_TEST="CMake.FileDownload|CTestTestUpload|curl|RunCMake.CPack_RPM"
    361 NO_TEST="$NO_TEST|CPackComponentsForAll-RPM-IgnoreGroup"
    362 # RunCMake.File_Generate fails on S390X
    363 %ifarch s390x
    364 NO_TEST="$NO_TEST|RunCMake.File_Generate"
    365 %endif
    366 export NO_TEST
    367 bin/ctest%{?name_suffix} -V -E "$NO_TEST" %{?_smp_mflags}
     548%if !0%{?os2_version}
     549pushd %{_vpath_builddir}
     550%else
     551cd %{_vpath_builddir}
     552%endif
     553# CTestTestUpload requires internet access.
     554NO_TEST="CTestTestUpload"
     555# Likely failing for hardening flags from system.
     556NO_TEST="$NO_TEST|CustomCommand|RunCMake.PositionIndependentCode"
     557# curl test may fail during bootstrap
     558%if %{with bootstrap}
     559NO_TEST="$NO_TEST|curl"
     560%endif
     561bin/ctest%{?name_suffix} %{?_smp_mflags} -V -E "$NO_TEST" --output-on-failure
     562## do this only periodically, not for every build -- besser82 20221102
     563# Keep an eye on failing tests
     564#bin/ctest%{?name_suffix} %{?_smp_mflags} -V -R "$NO_TEST" --output-on-failure || :
     565%if !0%{?os2_version}
     566popd
     567%else
    368568cd ..
     569%endif
    369570%endif
    370571
     
    385586%files data -f data_files.mf
    386587%{_datadir}/aclocal/%{name}.m4
    387 #%{_datadir}/bash-completion
     588%if !0%{?os2_version}
     589%{bash_completionsdir}/c*
     590%endif
    388591%if %{with emacs}
     592%if 0%{?fedora} || 0%{?rhel} >= 7
     593%{_emacs_sitelispdir}/%{name}
     594%{_emacs_sitestartdir}/%{name}-init.el
     595%else
    389596%{_emacs_sitelispdir}
    390597%{_emacs_sitestartdir}
    391598%endif
    392 
     599%endif
     600%if !0%{?os2_version}
     601%{vimfiles_root}/indent/%{name}.vim
     602%{vimfiles_root}/syntax/%{name}.vim
     603%endif
     604%if 0%{?os2_version}
     605%ghost %{_datadir}/%{name}/Modules/Platform/os2.cmake
     606%endif
    393607
    394608%files doc
    395609# Pickup license-files from main-pkg's license-dir
    396610# If there's no license-dir they are picked up by %%doc previously
    397 #%{?_licensedir:%license %{_datadir}/licenses/%{name}*}
     611%{?_licensedir:%license %{_datadir}/licenses/%{name}*}
    398612%doc %{_pkgdocdir}
    399613
     
    404618%if %{with gui}
    405619%files gui
     620%if !0%{?os2_version}
     621%{_bindir}/%{name}-gui
     622%else
    406623%{_bindir}/%{name}-gui.exe
     624%endif
    407625%if %{with appdata}
    408626%{_metainfodir}/*.appdata.xml
    409 %{_datadir}/applications/CMake%{?name_suffix}.desktop
    410 %{_datadir}/mime/packages/
     627%endif
     628%if !0%{?os2_version}
     629%{_datadir}/applications/%{name}-gui.desktop
     630%{_datadir}/mime/packages
    411631%{_datadir}/icons/hicolor/*/apps/CMake%{?name_suffix}Setup.png
    412632%endif
     
    427647
    428648%changelog
     649* Fri Feb 24 2023 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.20.6-2
     650- fix a crash
     651- enable system jsoncpp
     652
     653* Fri Jan 27 2023 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.20.6-1
     654- update to vendor version 3.20.6
     655- resync spec file with fedora
     656
     657* Fri Jan 31 2020 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.15.3-1
     658- update to vendor version 3.15.3
     659- build with gcc9
     660- add rc file handling
     661- disable 1121 wlink messages
     662- don't use emxexp for c++ by default anymore, it relies on declspec
     663  if you want the old way use -DOS2_USE_CXX_EMXEXP=ON
     664
    429665* Mon Sep 16 2019 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.10.3-1
    430666- update to vendor version 3.10.3
Note: See TracChangeset for help on using the changeset viewer.