60 lines
1.8 KiB
RPMSpec
60 lines
1.8 KiB
RPMSpec
%undefine __cmake_in_source_build
|
|
Name: fmt
|
|
Version: 8.0.1
|
|
Release: 1
|
|
License: MIT
|
|
Summary: Small, safe and fast formatting library for C++
|
|
URL: https://github.com/fmtlib/fmt
|
|
Source0: https://github.com/fmtlib/fmt/archive/%{version}.tar.gz
|
|
BuildRequires: gcc gcc-c++ ninja-build 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} = %{version}-%{release}
|
|
%description devel
|
|
This package contains the header file for using %{name}.
|
|
|
|
%prep
|
|
%autosetup -p1
|
|
|
|
%build
|
|
%cmake \
|
|
-G Ninja \
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
|
cmake --build ./ %{?_smp_flags} --verbose
|
|
|
|
%install
|
|
install -d -m 0755 %{buildroot}/%{_includedir}/%{name}
|
|
install -d -m 0755 %{buildroot}/%{_libdir}
|
|
install -d -m 0755 %{buildroot}/%{_libdir}/cmake/%{name}
|
|
install -d -m 0755 %{buildroot}/%{_libdir}/pkgconfig
|
|
cp -arf include/fmt/* %{buildroot}/%{_includedir}/%{name}
|
|
cp -arf lib%{name}.so %{buildroot}/%{_libdir}
|
|
cp -arf lib%{name}.so.8.0.1 %{buildroot}/%{_libdir}
|
|
cp -arf lib%{name}.so.8 %{buildroot}/%{_libdir}
|
|
cp -arf fmt.pc %{buildroot}/%{_libdir}/pkgconfig
|
|
cp -arf *.cmake %{buildroot}/%{_libdir}/cmake/%{name}
|
|
|
|
|
|
%check
|
|
ctest -VV %{?_smp_flags}
|
|
|
|
%files
|
|
%license LICENSE.rst
|
|
%doc ChangeLog.rst README.rst
|
|
%{_libdir}/lib%{name}.so.8*
|
|
|
|
%files devel
|
|
%{_includedir}/%{name}
|
|
%{_libdir}/lib%{name}.so
|
|
%{_libdir}/cmake/%{name}
|
|
%{_libdir}/pkgconfig/%{name}.pc
|
|
|
|
%changelog
|
|
* Sat Aug 7 2021 liyanan <liyanan32@huawei.com> - 8.0.1-1
|
|
- package init
|