## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global pypi_name units-llnl %bcond python 1 Name: units-llnl Version: 0.12.3 Release: %{autorelease} Summary: LLNL units library %global forgeurl https://github.com/LLNL/units %global tag v%{version} %forgemeta License: BSD-3-Clause URL: %forgeurl Source: %forgesource # Make shared library versioned Patch: 0001-Make-shared-library-versioned.patch # Don't enforce use of bundled GTest Patch: 0002-Allow-using-locally-installed-GTest.patch BuildRequires: cmake BuildRequires: cmake(gtest) BuildRequires: pkgconfig(gmock) BuildRequires: gcc-c++ %global _description %{expand: The Units library provides a means of working with units of measurement at runtime, including conversion to and from strings. It provides a small number of types for working with units and measurements and operations necessary for user input and output with units.} %description %_description %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %_description %if %{with python} %package -n python3-%{pypi_name} Summary: %{summary} Requires: %{name}%{?_isa} = %{version}-%{release} BuildRequires: python3-devel BuildRequires: python3-nanobind-devel %description -n python3-%{pypi_name} %_description %endif %prep %forgeautosetup -p1 %if %{with python} # Drop lower bound from nanobind sed -r -i 's/(nanobind).*[0-9]\.[0-9]\.[0-9]/\1/' pyproject.toml %generate_buildrequires %pyproject_buildrequires -x test %endif %build %cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DUNITS_BUILD_SHARED_LIBRARY:BOOL=ON \ -DUNITS_ENABLE_TESTS:BOOL=ON \ -DUNITS_BUILD_CONVERTER_APP:BOOL=ON \ -DUNITS_ENABLE_SUBMODULE_UPDATE:BOOL=OFF %cmake_build %if %{with python} %pyproject_wheel -C cmake.define.UNITS_BUILD_SHARED_LIBRARY:BOOL=ON %endif %install %cmake_install %if %{with python} %pyproject_install %pyproject_save_files -l units_llnl %endif %check %ctest --verbose %if %{with python} # Set LD_LIBRARY_PATH since python module needs acces to libunits export LD_LIBRARY_PATH="%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" # Test core dumps on `s2 = f"the measurement is {m1:-}"` # https://github.com/LLNL/units/issues/372 k="${k-}${k+ and } not test_format" %pytest -r fEs ${k+-k "${k-}"} test/python %endif %files %license LICENSE %doc NOTICE CONTRIBUTORS.md CONTRIBUTING.md CHANGELOG.md %{_bindir}/units_convert %{_libdir}/libunits.so.0{,.*} %files devel %{_includedir}/units/ %{_libdir}/cmake/units/ %{_libdir}/libunits.so %if %{with python} %files -n python3-%{pypi_name} -f %{pyproject_files} %doc CHANGELOG.md python/README.md %endif %changelog ## START: Generated by rpmautospec * Tue Mar 25 2025 Sandro - 0.12.3-3 - Add Python module using shared lib * Tue Mar 25 2025 Sandro - 0.12.3-2 - Fix build of shared library and tests * Sun Mar 23 2025 Sandro - 0.12.3-1 - Initial package ## END: Generated by rpmautospec