Name: cppformat Version: 1.1.0 Release: 1%{?dist} Summary: Small, safe and fast formatting library for C++ License: BSD URL: https://github.com/cppformat/cppformat Source0: https://github.com/cppformat/cppformat/releases/download/%{version}/%{name}-%{version}.zip # .so name fixed upstream ( see https://github.com/cppformat/cppformat/commit/fb362ef88003041e0ea7236deaba5387df205390 ) Patch0: cppformat_so_name.patch # Install dir fixed upstream ( https://github.com/cppformat/cppformat/commit/c3ebcce89dd9a0b244509365378dea7e6f720524 ) Patch1: cppformat_lib64.patch BuildRequires: cmake %description C++ Format is an open-source formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains the header file for using %{name}. %package doc Summary: Documentation files for %{name} # See https://github.com/cppformat/cppformat#documentation-license License: Python BuildArch: noarch %description doc This package contains documentation for developer documentation for %{name}. %prep %setup -q %patch0 %patch1 %build cmakeopts="-DFMT_LIB_DIR=%{_lib}" # NOTE: Only link against needed libraries ( fixed upstream https://github.com/cppformat/cppformat/commit/e498ffbb3d6587c6b4e3d95359a35fc5da9c40eb ) cmakeopts="$cmakeopts -DCMAKE_SHARED_LINKER_FLAGS='-Wl,--as-needed'" # NOTE: Specifying CMAKE_SKIP_RPATH=OFF is so it will link properly on RHEL 6 # See https://bugzilla.redhat.com/show_bug.cgi?id=640672 %if 0%{?rhel}%{?fedora} == 6 cmakeopts="$cmakeopts -DCMAKE_SKIP_RPATH=OFF" %endif %cmake $cmakeopts . make %{?_smp_mflags} all # Extract the LICENSE (fixed upstream see https://github.com/cppformat/cppformat/commit/fde90aa551cb3cf77624b72a166144768d2db763 ) grep "^License" -A 25 README.rst | tail -n 21 > LICENSE # Remove the hidden directories in the documentation rm doc/html/.buildinfo rm -r doc/html/.doctrees %install make install DESTDIR=%{buildroot} %check make test %files %{_libdir}/libformat.so.* %{!?_licensedir:%global license %%doc} %license LICENSE %files devel %{_includedir}/format.h %{_libdir}/libformat.so %files doc %doc doc/html/ %license doc/LICENSE.python %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %changelog * Tue Apr 28 2015 Dave Johansen - 1.1.0-1 - Initial RPM release