# Static library only -- no debug package %define debug_package %{nil} %define devname %mklibname dragonbox -d Name: dragonbox Version: 1.1.3 Release: 2 Source0: https://github.com/jk-jeon/dragonbox/archive/refs/tags/%{version}.tar.gz Summary: Float-to-string conversion library URL: https://github.com/jk-jeon/dragonbox License: Apache-2.0 Group: System/Libraries BuildRequires: cmake ninja %description Dragonbox is a float-to-string conversion algorithm. It generates a pair of integers from a floating-point number: the decimal significand and the decimal exponent of the input floating-point number. These integers can then be used for string generation of decimal representation of the input floating-point number, the procedure commonly called ftoa or dtoa. The algorithm guarantees three things: 1. It has the roundtrip guarantee; that is, a correct parser interprets the generated output string as the original input floating-point number. 2. The output is of the shortest length; that is, no other output strings that are interpreted as the input number can contain less number of significand digits than the output of Dragonbox. 3. The output is correctly rounded: the number generated by Dragonbox is the closest to the actual value of the input number among possible outputs of minimum number of digits. %package -n %{devname} Summary: Development files for the %{name} float-to-string conversion library Group: Development/C %description -n %{devname} Development files (Headers etc.) for %{name}. Dragonbox is a float-to-string conversion algorithm. It generates a pair of integers from a floating-point number: the decimal significand and the decimal exponent of the input floating-point number. These integers can then be used for string generation of decimal representation of the input floating-point number, the procedure commonly called ftoa or dtoa. The algorithm guarantees three things: 1. It has the roundtrip guarantee; that is, a correct parser interprets the generated output string as the original input floating-point number. 2. The output is of the shortest length; that is, no other output strings that are interpreted as the input number can contain less number of significand digits than the output of Dragonbox. 3. The output is correctly rounded: the number generated by Dragonbox is the closest to the actual value of the input number among possible outputs of minimum number of digits. %prep %autosetup -p1 %cmake -G Ninja %build %ninja_build -C build %install %ninja_install -C build %files -n %{devname} %{_includedir}/* %{_libdir}/cmake/* %{_libdir}/*.a