]>
Commit | Line | Data |
---|---|---|
2adf1e07 JB |
1 | # |
2 | # Conditional build: | |
9bee86e5 JB |
3 | %bcond_with pcap # audio playing from PCAP files |
4 | %bcond_without static_libs # static library | |
5 | # transport | |
b49a5518 | 6 | %bcond_without srtp # SRTP (secure RTP) support |
d1086c6e | 7 | %bcond_without zrtp # support for RFC 6189: Media Path Key Agreement for Unicast Secure RTP |
574e0d82 JB |
8 | # audio I/O |
9 | %bcond_without alsa # ALSA sound I/O support | |
10 | %bcond_with arts # aRts sound I/O support | |
9bee86e5 | 11 | %bcond_with oss # OSS support (deprecated) |
574e0d82 JB |
12 | %bcond_with portaudio # PortAudio sound I/O support |
13 | %bcond_without pulseaudio # PulseAudio sound I/O support | |
9bee86e5 JB |
14 | # audio codecs |
15 | %bcond_without bcg729 # support for G279AnnexB in RTC3389 implementation of Comfort Noise Payload | |
aa21f6e6 | 16 | %bcond_without bv16 # BV16 codec support |
9bee86e5 JB |
17 | %bcond_without spandsp # G726 codec support via spandsp |
18 | # video I/O | |
19 | %bcond_without opengl # X11+OpenGL rendering support | |
b4167869 | 20 | %bcond_without sdl # SDL support |
9bee86e5 | 21 | # video codecs |
71e8b123 | 22 | %bcond_without matroska # Matroska support via bcmatroska2 |
cbb08a67 | 23 | %bcond_without zxing # QRcode support via zxing-cpp-nu |
2adf1e07 | 24 | # |
bbb0ffde | 25 | Summary: Audio/Video real-time streaming |
2adf1e07 | 26 | Summary(pl.UTF-8): Przesyłanie strumieni audio/video w czasie rzeczywistym |
bbb0ffde | 27 | Name: mediastreamer |
3b97d067 | 28 | Version: 5.3.41 |
fae06489 | 29 | Release: 1 |
cbb08a67 | 30 | License: AGPL v3+ |
bbb0ffde | 31 | Group: Libraries |
348172d7 JB |
32 | #Source0Download: https://gitlab.linphone.org/BC/public/mediastreamer2/tags |
33 | Source0: https://gitlab.linphone.org/BC/public/mediastreamer2/-/archive/%{version}/mediastreamer2-%{version}.tar.bz2 | |
3b97d067 | 34 | # Source0-md5: 0347b03d73401f51c067e7100a242677 |
c28fe572 | 35 | Patch0: build.patch |
9bee86e5 | 36 | Patch1: %{name}-cmake-link.patch |
d8296b8a | 37 | Patch2: libupnp-1.14.patch |
9bee86e5 JB |
38 | Patch3: %{name}-cmake-datadir.patch |
39 | Patch4: %{name}-cmake-install-pkgconfig.patch | |
b4167869 JB |
40 | Patch5: %{name}-cmake-SDL.patch |
41 | Patch6: %{name}-types.patch | |
cbb08a67 JB |
42 | Patch7: ffmpeg_5_0_fixes.patch |
43 | Patch8: %{name}-cmake-find.patch | |
44 | URL: https://www.linphone.org/technical-corner/mediastreamer2-ortp | |
2adf1e07 | 45 | %{?with_opengl:BuildRequires: OpenGL-GLX-devel} |
9bee86e5 | 46 | %{?with_sdl:BuildRequires: SDL-devel >= 1.2.0} |
574e0d82 JB |
47 | %{?with_alsa:BuildRequires: alsa-lib-devel} |
48 | %{?with_arts:BuildRequires: artsc-devel} | |
cbb08a67 JB |
49 | %{?with_bcg729:BuildRequires: bcg729-devel >= 1.1.1-2} |
50 | %{?with_matroska:BuildRequires: bcmatroska2-devel >= 5.3} | |
51 | BuildRequires: bctoolbox-devel >= 5.3.0 | |
aa21f6e6 | 52 | %{?with_bv16:BuildRequires: bv16-floatingpoint-devel} |
cbb08a67 JB |
53 | %{?with_zrtp:BuildRequires: bzrtp-devel >= 5.3.0} |
54 | BuildRequires: cmake >= 3.22 | |
55 | BuildRequires: dav1d-devel | |
bbb0ffde | 56 | BuildRequires: doxygen |
2adf1e07 | 57 | # libavcodec >= 51.0.0, libswscale >= 0.7.0 |
cbb08a67 | 58 | BuildRequires: ffmpeg-devel >= 4.4 |
c07fcbab | 59 | BuildRequires: gettext-tools |
2adf1e07 | 60 | %{?with_opengl:BuildRequires: glew-devel >= 1.5} |
2adf1e07 | 61 | BuildRequires: intltool >= 0.40 |
bbb0ffde | 62 | BuildRequires: libgsm-devel |
9bee86e5 | 63 | BuildRequires: libjpeg-turbo-devel |
2adf1e07 | 64 | %{?with_pcap:BuildRequires: libpcap-devel} |
cbb08a67 JB |
65 | %{?with_srtp:BuildRequires: libsrtp2-devel >= 2} |
66 | BuildRequires: libstdc++-devel >= 6:7 | |
2adf1e07 | 67 | BuildRequires: libtheora-devel >= 1.0-0.alpha7 |
dcc4ee79 | 68 | BuildRequires: libupnp-devel >= 1.8 |
bbb0ffde | 69 | BuildRequires: libv4l-devel |
2adf1e07 | 70 | BuildRequires: libvpx-devel >= 0.9.6 |
85ee47be | 71 | BuildRequires: libyuv-devel |
2adf1e07 | 72 | BuildRequires: opus-devel >= 0.9.0 |
cbb08a67 | 73 | BuildRequires: ortp-devel >= 5.3.0 |
bbb0ffde | 74 | BuildRequires: pkgconfig |
574e0d82 | 75 | %{?with_portaudio:BuildRequires: portaudio-devel} |
2adf1e07 | 76 | %{?with_pulseaudio:BuildRequires: pulseaudio-devel >= 0.9.21} |
9bee86e5 | 77 | BuildRequires: python3 >= 1:3 |
80dd7e6f | 78 | BuildRequires: rpmbuild(macros) >= 1.605 |
61d85515 | 79 | BuildRequires: sed >= 4.0 |
9bee86e5 | 80 | %{?with_spandsp:BuildRequires: spandsp-devel >= 0.0.6} |
f52b820a | 81 | BuildRequires: speex-devel >= 1:1.2-beta3 |
fed1d2a7 | 82 | BuildRequires: speexdsp-devel >= 1.2-beta3 |
bbb0ffde | 83 | BuildRequires: xorg-lib-libX11-devel |
61d85515 | 84 | BuildRequires: xorg-lib-libXv-devel |
cbb08a67 JB |
85 | %{?with_zxing:BuildRequires: zxing-cpp-nu-devel} |
86 | %{?with_bcg729:Requires: bcg729 >= 1.1.1-2} | |
87 | %{?with_matroska:Requires: bcmatroska2 >= 5.3} | |
88 | Requires: bctoolbox >= 5.3.0 | |
89 | %{?with_zrtp:Requires: bzrtp >= 5.3.0} | |
2adf1e07 JB |
90 | %{?with_opengl:Requires: glew >= 1.5} |
91 | Requires: libtheora >= 1.0-0.alpha7 | |
2adf1e07 JB |
92 | Requires: libvpx >= 0.9.6 |
93 | Requires: opus >= 0.9.0 | |
cbb08a67 | 94 | Requires: ortp >= 5.3.0 |
2adf1e07 | 95 | %{?with_pulseaudio:Requires: pulseaudio-libs >= 0.9.21} |
e6d0cfff | 96 | Requires: spandsp >= 0.0.6 |
f52b820a | 97 | Requires: speex >= 1:1.2-beta3 |
fed1d2a7 | 98 | Requires: speexdsp >= 1.2-beta3 |
9bee86e5 | 99 | Obsoletes: mediastreamer-plugin-msbcg729 < 1.1 |
bbb0ffde AM |
100 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
101 | ||
102 | %description | |
103 | Mediastreamer2 is a GPL licensed library to make audio and video | |
104 | real-time streaming and processing. Written in pure C, it is based | |
105 | upon the oRTP library. | |
106 | ||
2adf1e07 JB |
107 | %description -l pl.UTF-8 |
108 | Mediastreamer2 to udostępniona na licencji GPL biblioteka do | |
109 | przesyłania i przetwarzania strumieni audio/video w czasie | |
110 | rzeczywistym. Jest napisana w czystym C, oparta na bibliotece oRTP. | |
111 | ||
bbb0ffde | 112 | %package devel |
210be78d JB |
113 | Summary: Header files and development documentation for mediastreamer libraries |
114 | Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do bibliotek mediastreamer | |
bbb0ffde | 115 | Group: Development/Libraries |
2adf1e07 JB |
116 | Requires: %{name} = %{version}-%{release} |
117 | %{?with_opengl:Requires: OpenGL-devel} | |
574e0d82 | 118 | %{?with_alsa:Requires: alsa-lib-devel} |
cbb08a67 JB |
119 | %{?with_bcg729:Requires: bcg729-devel >= 1.1.1-2} |
120 | %{?with_matroska:Requires: bcmatroska2-devel >= 5.3} | |
121 | Requires: bctoolbox-devel >= 5.3.0 | |
aa21f6e6 | 122 | %{?with_bv16:Requires: bv16-floatingpoint-devel} |
cbb08a67 JB |
123 | %{?with_zrtp:Requires: bzrtp-devel >= 5.3.0} |
124 | Requires: ffmpeg-devel >= 4.4 | |
2adf1e07 | 125 | %{?with_opengl:Requires: glew-devel >= 1.5} |
cbb08a67 | 126 | %{?with_srtp:Requires: libsrtp2-devel >= 2} |
2adf1e07 | 127 | Requires: libtheora-devel >= 1.0-0.alpha7 |
dcc4ee79 | 128 | Requires: libupnp-devel >= 1.8 |
2adf1e07 JB |
129 | Requires: libv4l-devel |
130 | Requires: libvpx-devel >= 0.9.6 | |
131 | Requires: opus-devel >= 0.9.0 | |
cbb08a67 | 132 | Requires: ortp-devel >= 5.3.0 |
574e0d82 | 133 | %{?with_portaudio:Requires: portaudio-devel} |
2adf1e07 JB |
134 | %{?with_pulseaudio:Requires: pulseaudio-devel >= 0.9.21} |
135 | Requires: spandsp-devel >= 0.0.6 | |
f52b820a | 136 | Requires: speex-devel >= 1:1.2-beta3 |
fed1d2a7 | 137 | Requires: speexdsp-devel >= 1.2-beta3 |
2adf1e07 JB |
138 | Requires: xorg-lib-libX11-devel |
139 | Requires: xorg-lib-libXv-devel | |
bbb0ffde AM |
140 | |
141 | %description devel | |
210be78d JB |
142 | Header files and development documentation for mediastreamer |
143 | libraries. | |
2adf1e07 JB |
144 | |
145 | %description devel -l pl.UTF-8 | |
210be78d | 146 | Pliki nagłówkowe i dokumentacja do bibliotek mediastreamer. |
bbb0ffde AM |
147 | |
148 | %package static | |
210be78d JB |
149 | Summary: Static mediastreamer libraries |
150 | Summary(pl.UTF-8): Statyczne biblioteki mediastreamer | |
bbb0ffde | 151 | Group: Development/Libraries |
2adf1e07 | 152 | Requires: %{name}-devel = %{version}-%{release} |
bbb0ffde AM |
153 | |
154 | %description static | |
210be78d | 155 | Static mediastreamer libraries. |
bbb0ffde | 156 | |
2adf1e07 | 157 | %description static -l pl.UTF-8 |
210be78d | 158 | Statyczne biblioteki mediastreamer. |
2adf1e07 | 159 | |
bbb0ffde | 160 | %prep |
348172d7 | 161 | %setup -q -n mediastreamer2-%{version} |
9a501a0e | 162 | %patch0 -p1 |
9bee86e5 | 163 | %patch1 -p1 |
d8296b8a | 164 | %patch2 -p1 |
9bee86e5 JB |
165 | %patch3 -p1 |
166 | %patch4 -p1 | |
b4167869 JB |
167 | %patch5 -p1 |
168 | %patch6 -p1 | |
cbb08a67 JB |
169 | %patch7 -p1 |
170 | %patch8 -p1 | |
c28fe572 | 171 | |
9bee86e5 JB |
172 | # cmake checks for python3, so don't require python 2 as well |
173 | %{__sed} -i -e '1s,/usr/bin/python$,%{__python3},' tools/xxd.py | |
bbb0ffde | 174 | |
e1a2423a | 175 | %{__sed} -i -e 's/"-Werror" /"-Werror" "-Wno-error=address" "-Wno-error=unused-parameter"/' CMakeLists.txt |
5786ff67 | 176 | |
bbb0ffde | 177 | %build |
cbb08a67 JB |
178 | configure() { |
179 | set -x | |
180 | builddir="$1" | |
181 | shift | |
182 | # note: NON_FREE_FEATURES refer to H263, H264, MPEG4 via libavcodec | |
183 | %cmake -B "$builddir" \ | |
9bee86e5 JB |
184 | -DCMAKE_INSTALL_INCLUDEDIR=include \ |
185 | -DCMAKE_INSTALL_LIBDIR=%{_lib} \ | |
186 | %{!?with_alsa:-DENABLE_ALSA=OFF} \ | |
187 | %{?with_arts:-DENABLE_ARTSC=ON} \ | |
aa21f6e6 | 188 | %{!?with_bv16:-DENABLE_BV16=OFF} \ |
9bee86e5 JB |
189 | %{?with_spandsp:-DENABLE_G726=ON} \ |
190 | %{!?with_bcg729:-DENABLE_G729=OFF} \ | |
191 | %{?with_bcg729:-DENABLE_G729B_CNG=ON} \ | |
192 | %{!?with_opengl:-DENABLE_GL=OFF} \ | |
193 | %{!?with_opengl:-DENABLE_GLX=OFF} \ | |
194 | %{!?with_matroska:-DENABLE_MKV=OFF} \ | |
cbb08a67 | 195 | -DENABLE_NON_FREE_FEATURES=ON \ |
9bee86e5 JB |
196 | %{?with_oss:-DENABLE_OSS=ON} \ |
197 | %{?with_pcap:-DENABLE_PCAP=ON} \ | |
198 | %{?with_portaudio:-DENABLE_PORTAUDIO=ON} \ | |
199 | %{?with_pulseaudio:-DENABLE_PULSEAUDIO=ON} \ | |
200 | %{!?with_zxing:-DENABLE_QRCODE=OFF} \ | |
201 | %{?with_sdl:-DENABLE_SDL=ON} \ | |
202 | %{!?with_srtp:-DENABLE_SRTP=OFF} \ | |
9bee86e5 | 203 | -DENABLE_UNIT_TESTS=OFF \ |
cbb08a67 JB |
204 | %{!?with_zrtp:-DENABLE_ZRTP=OFF} \ |
205 | "$@" | |
206 | } | |
207 | ||
208 | # NLS missing in cmake | |
209 | # GSM_USE_BUILD_INTERFACE to include <gsm.h> instead of <gsm/gsm.h> | |
210 | CPPFLAGS="%{rpmcppflags} -DENABLE_NLS=1 -DGETTEXT_PACKAGE=\\\"mediastreamer\\\" -DLOCALEDIR=\\\"%{_localedir}\\\" -DGSM_USE_BUILD_INTERFACE=1" | |
211 | # CPPFLAGS are not used, so append | |
212 | CFLAGS="%{rpmcflags} $CPPFLAGS" | |
213 | CXXFLAGS="%{rpmcxxflags} $CPPFLAGS" | |
214 | ||
215 | %if %{with static_libs} | |
216 | configure builddir-static \ | |
217 | -DBUILD_SHARED_LIBS=OFF | |
218 | ||
219 | %{__make} -C builddir-static | |
220 | %endif | |
221 | ||
222 | configure builddir | |
61d85515 | 223 | |
cbb08a67 | 224 | %{__make} -C builddir |
bbb0ffde AM |
225 | |
226 | %install | |
227 | rm -rf $RPM_BUILD_ROOT | |
228 | ||
cbb08a67 JB |
229 | %if %{with static_libs} |
230 | %{__make} -C builddir-static install \ | |
9bee86e5 | 231 | DESTDIR=$RPM_BUILD_ROOT |
cbb08a67 | 232 | %endif |
9bee86e5 | 233 | |
cbb08a67 JB |
234 | %{__make} -C builddir install \ |
235 | DESTDIR=$RPM_BUILD_ROOT | |
9bee86e5 JB |
236 | |
237 | # missing from install in cmake | |
cbb08a67 | 238 | install builddir/tools/mediastreamer2-msaudiocmp $RPM_BUILD_ROOT%{_bindir} |
9bee86e5 | 239 | %if %{with pcap} |
cbb08a67 | 240 | install builddir/tools/mediastreamer2-pcap_playback $RPM_BUILD_ROOT%{_bindir} |
9bee86e5 JB |
241 | %endif |
242 | for f in po/*.po ; do | |
243 | lang=$(basename "$f" .po) | |
244 | install -d $RPM_BUILD_ROOT%{_localedir}/${lang}/LC_MESSAGES | |
245 | msgfmt -v -o $RPM_BUILD_ROOT%{_localedir}/${lang}/LC_MESSAGES/%{name}.mo "$f" | |
246 | done | |
bbb0ffde | 247 | |
86721f5d | 248 | # for external plugins |
dcc81caa | 249 | install -d $RPM_BUILD_ROOT%{_libdir}/mediastreamer/plugins |
86721f5d | 250 | |
85ee47be JB |
251 | # we don't need another copy |
252 | %{__rm} -r $RPM_BUILD_ROOT%{_includedir}/OpenGL | |
61d85515 | 253 | # Remove duplicated documentation |
cbb08a67 | 254 | %{__rm} -r $RPM_BUILD_ROOT/usr/share/doc/mediastreamer2-5.3.0/html |
61d85515 | 255 | |
256 | %find_lang %{name} | |
257 | ||
bbb0ffde AM |
258 | %clean |
259 | rm -rf $RPM_BUILD_ROOT | |
260 | ||
261 | %post -p /sbin/ldconfig | |
262 | %postun -p /sbin/ldconfig | |
263 | ||
61d85515 | 264 | %files -f %{name}.lang |
bbb0ffde | 265 | %defattr(644,root,root,755) |
348172d7 | 266 | %doc CHANGELOG.md README.md |
cbb08a67 JB |
267 | %attr(755,root,root) %{_bindir}/mediastreamer2-mediastream |
268 | %attr(755,root,root) %{_bindir}/mediastreamer2-mkvstream | |
269 | %attr(755,root,root) %{_bindir}/mediastreamer2-msaudiocmp | |
270 | %if %{with pcap} | |
271 | %attr(755,root,root) %{_bindir}/mediastreamer2-pcap-playback | |
272 | %endif | |
273 | %attr(755,root,root) %{_libdir}/libmediastreamer2.so.11 | |
dcc81caa JB |
274 | %dir %{_libdir}/mediastreamer |
275 | %dir %{_libdir}/mediastreamer/plugins | |
348172d7 | 276 | %{_datadir}/mediastreamer |
bbb0ffde AM |
277 | |
278 | %files devel | |
279 | %defattr(644,root,root,755) | |
e6c8ac89 | 280 | %doc builddir/help/doc/html/*.{css,html,js,png} |
cbb08a67 | 281 | %attr(755,root,root) %{_libdir}/libmediastreamer2.so |
bbb0ffde AM |
282 | %{_includedir}/mediastreamer2 |
283 | %{_pkgconfigdir}/mediastreamer.pc | |
9bee86e5 JB |
284 | %dir %{_datadir}/Mediastreamer2 |
285 | %{_datadir}/Mediastreamer2/cmake | |
bbb0ffde | 286 | |
210be78d | 287 | %if %{with static_libs} |
bbb0ffde AM |
288 | %files static |
289 | %defattr(644,root,root,755) | |
cbb08a67 | 290 | %{_libdir}/libmediastreamer2.a |
210be78d | 291 | %endif |