## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec %global source_name c4fs %global source_summary C++ file system utilities %global source_version 0.0.1 %global source_release %autorelease -b 3 -s %{date}git%{shortcommit0} %global source_license MIT %global source_description %{source_summary} %global forge_url0 https://github.com/biojppm/c4fs # The project contains a version number, but a release has never been tagged. # The project is normally used as a git submodule and referred to by commit # hash. %global forge_commit0 1abba005074022f07d2d9d11ec6a786f2a1f1380 %global shortcommit0 %(c=%{forge_commit0}; echo ${c:0:7}) %global date 20211227 %global forge_patchlist0 %{expand: # Upstream always wants to build with c4core as a git submodule, but we want to # unbundle it and build with an external library. We therefore maintain this # patch without sending it upstream. c4fs-1abba00-external-c4core.patch } %global so_version 0.0.1 %global source_tags %{expand: BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: c4project # Our choice; the default make backend should work just as well BuildRequires: ninja-build BuildRequires: cmake(c4core) # For each header-only library, the guidelines require us to BR the -static # package for tracking. BuildRequires: doctest-devel BuildRequires: doctest-static } %forgeauto_init %forgeauto_pkg %package devel Summary: Development files for c4fs Requires: c4fs%{?_isa} = %{version}-%{release} Requires: c4core-devel%{?_isa} Requires: cmake-filesystem %description devel The c4fs-devel package contains libraries and header files for developing applications that use c4fs. %sourcelist %forgeauto_sources %patchlist %forgeauto_patches %prep %forgeauto_prep # Remove/unbundle additional dependencies # c4project (CMake build scripts) rm -rvf ext/c4core/cmake cp -rvp %{_datadir}/cmake/c4project ext/c4core/cmake # Patch out download of doctest: awk '/^ if\(_DOCTEST\)$/ { x=1 } x != 1 x == 1 && /^ endif\(\)$/ { x=0 }' \ '%{_datadir}/cmake/c4project/c4Project.cmake' \ > 'ext/c4core/cmake/c4Project.cmake' # This comment fixes confused vim syntax highlighting: ' # Do not try to link against a nonexistent doctest library (doctest is # header-only, and we do not have the complete CMake project for doctest that # would provide a target that knows this): sed -r -i 's/\bdoctest\b//' test/CMakeLists.txt %build %cmake -DC4FS_BUILD_TESTS=ON -GNinja %cmake_build %install %cmake_install # Fix wrong installation paths for multilib; it would be nontrivial to patch # the source to get this right in the first place. if [ '%{_libdir}' != '%{_prefix}/lib' ] then mkdir -p '%{buildroot}%{_libdir}' mv -v %{buildroot}%{_prefix}/lib/libc4fs.so* '%{buildroot}%{_libdir}/' mkdir -p '%{buildroot}%{_libdir}/cmake' mv -v %{buildroot}%{_prefix}/lib/cmake/c4fs '%{buildroot}%{_libdir}/cmake/' fi %check %cmake_build --target c4fs-test-run-verbose %files %license LICENSE.txt %doc README.md %{_libdir}/libc4fs.so.%{so_version} %files devel # %%{_includedir}/c4 is owned by c4core-devel %{_includedir}/c4/fs %{_libdir}/libc4fs.so %{_libdir}/cmake/c4fs %changelog * jeu. déc. 30 2021 Robert-André Mauchin %doc_init-1 - Convert to new forge macros * lun. déc. 27 2021 Benjamin A. Beasley 0.0.1-2 - Update to 1abba00 * lun. déc. 27 2021 Benjamin A. Beasley 0.0.1-1 - Initial package (close RHBZ#2025359)