-
Notifications
You must be signed in to change notification settings - Fork 0
/
libcorrect.spec
77 lines (63 loc) · 2.3 KB
/
libcorrect.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
%global optflags %{optflags} -flto=auto
%global build_ldflags %{build_ldflags} -flto
%global gitcommit_full f5a28c74fba7a99736fe49d3a5243eca29517ae9
%global gitcommit %(c=%{gitcommit_full}; echo ${c:0:7})
%global date 20181010
Name: libcorrect
Version: 0
Release: 1.%{date}git%{gitcommit}%{?dist}
Summary: C library for Convolutional codes and Reed-Solomon
License: BSD
URL: https://github.com/quiet/libcorrect
Source0: %{url}/tarball/%{gitcommit_full}
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: ninja-build
%description
libcorrect is a library for Forward Error Correction. By using libcorrect,
extra redundancy can be encoded into a packet of data and then be sent
across a lossy channel. When the packet is received, it can be decoded to
recover the original, pre-encoded data.
%package devel
Summary: Development files for libcorrect
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
libcorrect is a library for Forward Error Correction. By using libcorrect,
extra redundancy can be encoded into a packet of data and then be sent
across a lossy channel. When the packet is received, it can be decoded to
recover the original, pre-encoded data.
This subpackage contains libraries and header files for developing
applications that want to make use of libcorrect.
%prep
%autosetup -p1 -n quiet-%{name}-%{gitcommit}
mkdir -p %{_target_platform}
echo "set_property(TARGET correct PROPERTY SOVERSION 0.0.0)" >> CMakeLists.txt
sed -e "s|DESTINATION lib|DESTINATION %{_lib}|" \
-e '/CMAKE_C_FLAGS/d' \
-e 's|}" HAVE_SSE)|}" HAVE_SSE_dd)|' \
-e "/(fec_shim_static/d" \
-e "s| fec_shim_static||" \
-e "/(correct_static/d" \
-e "s| correct_static||" -i CMakeLists.txt
%build
pushd %{_target_platform}
%cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_AR=/usr/bin/gcc-ar \
-DCMAKE_RANLIB=/usr/bin/gcc-ranlib \
-DCMAKE_NM=/usr/bin/gcc-nm \
..
popd
%ninja_build -C %{_target_platform}
%install
%ninja_install -C %{_target_platform}
%files
%license LICENSE
%doc README.md
%{_libdir}/libcorrect.so.0.0.0
%files devel
%{_includedir}/correct*.h
%{_libdir}/libcorrect.so
%changelog
* Thu Oct 24 2019 Vasiliy N. Glazov <[email protected]> - 0-1.20181010gitf5a28c7
- Initial release for Fedora