summaryrefslogtreecommitdiff
path: root/codec2.spec
blob: 50645f9120b5693674e09c3ec54c9af668cdc4e3 (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
# Modified from https://src.fedoraproject.org/rpms/codec2/blob/rawhide/f/codec2.spec

Name:           codec2
Version:        1.2.0
Release:        1
Summary:        Next-Generation Digital Voice for Two-Way Radio
License:        LGPL-2.1-only

URL:            http://rowetel.com/codec2.html
Source0:        https://github.com/drowe67/codec2/archive/%{version}/%{name}-%{version}.tar.gz

BuildRequires:  cmake
BuildRequires:  gcc gcc-c++
BuildRequires:  libsamplerate-devel
BuildRequires:  lpcnetfreedv-devel
BuildRequires:  speex-devel
BuildRequires:  speexdsp-devel


%description
Codec 2 is an open source (LGPL licensed) speech codec for 2400 bit/s
and below. This is the runtime library package.


%package devel
Summary:        Development files for Codec 2
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
Codec 2 is an open source (LGPL licensed) speech codec for 2400 bit/s
and below. This package contains the development files required to
compile programs that use codec2.


%package devel-examples
Summary:        Example code for Codec 2
Requires:       %{name}-devel = %{version}-%{release}
BuildArch:      noarch

%description devel-examples
Example code for Codec 2


%prep
%autosetup -p1


%build
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DLPCNET=ON

%cmake_build


%install
%cmake_install

# Create and install pkgconfig file
mkdir -p %{buildroot}%{_libdir}/pkgconfig
cat > %{buildroot}%{_libdir}/pkgconfig/codec2.pc << EOF
prefix=%{_prefix}
exec_prefix=\${prefix}
includedir=\${prefix}/include/%{name}
libdir=\${exec_prefix}/%{_lib}

Name: codec2
Description: Next-Generation Digital Voice for Two-Way Radio
Version: 1.2.0
Cflags: -I\${includedir}
Libs: -L\${libdir} -l%{name}
EOF


%ldconfig_scriptlets


%files
%license COPYING
%doc README.md
%{_libdir}/*.so.*

%files devel
%{_includedir}/%{name}/
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/cmake/%{name}/

%changelog
* Fri Nov 22 2024 Suyun <ziyu.oerv@isrc.iscas.ac.cn> - 1.2.0-1
- Init package at 1.2.0