2 # - BV16 (https://gitlab.linphone.org/BC/public/external/bv16-floatingpoint or BroadVoice16OpenSource.v1.2.zip from Broadcom)
6 %bcond_with pcap # audio playing from PCAP files
7 %bcond_without static_libs # static library
9 %bcond_without srtp # SRTP (secure RTP) support
10 %bcond_without zrtp # support for RFC 6189: Media Path Key Agreement for Unicast Secure RTP
12 %bcond_without alsa # ALSA sound I/O support
13 %bcond_with arts # aRts sound I/O support
14 %bcond_with oss # OSS support (deprecated)
15 %bcond_with portaudio # PortAudio sound I/O support
16 %bcond_without pulseaudio # PulseAudio sound I/O support
18 %bcond_without bcg729 # support for G279AnnexB in RTC3389 implementation of Comfort Noise Payload
19 %bcond_without spandsp # G726 codec support via spandsp
21 %bcond_without opengl # X11+OpenGL rendering support
22 %bcond_with sdl # SDL support (not supported in cmake build)
24 %bcond_without matroska # Matroska support via libebml2/libmatroska2
25 %bcond_without zxing # QRcode support via zxing-cpp
27 Summary: Audio/Video real-time streaming
28 Summary(pl.UTF-8): Przesyłanie strumieni audio/video w czasie rzeczywistym
34 #Source0Download: https://gitlab.linphone.org/BC/public/mediastreamer2/tags
35 Source0: https://gitlab.linphone.org/BC/public/mediastreamer2/-/archive/%{version}/mediastreamer2-%{version}.tar.bz2
36 # Source0-md5: 3cdcfb0a1e3bd1b2774ca1da6316dae6
38 Patch1: %{name}-cmake-link.patch
39 Patch2: libupnp-1.14.patch
40 Patch3: %{name}-cmake-datadir.patch
41 Patch4: %{name}-cmake-install-pkgconfig.patch
42 URL: http://www.linphone.org/technical-corner/mediastreamer2/overview
43 %{?with_opengl:BuildRequires: OpenGL-GLX-devel}
44 %{?with_sdl:BuildRequires: SDL-devel >= 1.2.0}
45 %{?with_alsa:BuildRequires: alsa-lib-devel}
46 %{?with_arts:BuildRequires: artsc-devel}
47 %{?with_bcg729:BuildRequires: bcg729-devel >= 1.0.1}
48 BuildRequires: bctoolbox-devel >= 0.4.0
49 %{?with_zrtp:BuildRequires: bzrtp-devel >= 4.5.15-1}
50 BuildRequires: cmake >= 3.1
51 BuildRequires: doxygen
52 # libavcodec >= 51.0.0, libswscale >= 0.7.0
53 BuildRequires: ffmpeg-devel
54 BuildRequires: gettext-tools
55 %{?with_opengl:BuildRequires: glew-devel >= 1.5}
56 BuildRequires: intltool >= 0.40
57 BuildRequires: libgsm-devel
58 BuildRequires: libjpeg-turbo-devel
59 %{?with_pcap:BuildRequires: libpcap-devel}
60 BuildRequires: libstdc++-devel >= 6:5
61 BuildRequires: libtheora-devel >= 1.0-0.alpha7
62 # upnp not included in cmake
63 #BuildRequires: libupnp-devel >= 1.8
64 BuildRequires: libv4l-devel
65 BuildRequires: libvpx-devel >= 0.9.6
66 %{?with_matroska:BuildRequires: matroska-foundation-devel}
67 BuildRequires: opus-devel >= 0.9.0
68 BuildRequires: ortp-devel >= 4.5.15-1
69 BuildRequires: pkgconfig
70 %{?with_portaudio:BuildRequires: portaudio-devel}
71 %{?with_pulseaudio:BuildRequires: pulseaudio-devel >= 0.9.21}
72 BuildRequires: python3 >= 1:3
73 BuildRequires: sed >= 4.0
74 %{?with_spandsp:BuildRequires: spandsp-devel >= 0.0.6}
75 BuildRequires: speex-devel >= 1:1.2-beta3
76 BuildRequires: speexdsp-devel >= 1.2-beta3
77 %{?with_srtp:BuildRequires: libsrtp2-devel}
78 BuildRequires: xorg-lib-libX11-devel
79 BuildRequires: xorg-lib-libXv-devel
80 %{?with_zxing:BuildRequires: zxing-cpp-devel}
81 %{?with_bcg729:Requires: bcg729 >= 1.0.1}
82 Requires: bctoolbox >= 0.4.0
83 %{?with_zrtp:Requires: bzrtp >= 4.5}
84 %{?with_opengl:Requires: glew >= 1.5}
85 Requires: libtheora >= 1.0-0.alpha7
86 Requires: libvpx >= 0.9.6
87 Requires: opus >= 0.9.0
89 %{?with_pulseaudio:Requires: pulseaudio-libs >= 0.9.21}
90 Requires: spandsp >= 0.0.6
91 Requires: speex >= 1:1.2-beta3
92 Requires: speexdsp >= 1.2-beta3
93 Obsoletes: mediastreamer-plugin-msbcg729 < 1.1
94 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97 Mediastreamer2 is a GPL licensed library to make audio and video
98 real-time streaming and processing. Written in pure C, it is based
99 upon the oRTP library.
101 %description -l pl.UTF-8
102 Mediastreamer2 to udostępniona na licencji GPL biblioteka do
103 przesyłania i przetwarzania strumieni audio/video w czasie
104 rzeczywistym. Jest napisana w czystym C, oparta na bibliotece oRTP.
107 Summary: Header files and development documentation for mediastreamer libraries
108 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do bibliotek mediastreamer
109 Group: Development/Libraries
110 Requires: %{name} = %{version}-%{release}
111 %{?with_opengl:Requires: OpenGL-devel}
112 %{?with_alsa:Requires: alsa-lib-devel}
113 %{?with_bcg729:Requires: bcg729-devel >= 1.0.1}
114 Requires: bctoolbox-devel >= 0.4.0
115 %{?with_zrtp:Requires: bzrtp-devel >= 4.5.15-1}
116 Requires: ffmpeg-devel
117 %{?with_opengl:Requires: glew-devel >= 1.5}
118 Requires: libtheora-devel >= 1.0-0.alpha7
119 #Requires: libupnp-devel
120 Requires: libv4l-devel
121 Requires: libvpx-devel >= 0.9.6
122 %{?with_matroska:Requires: matroska-foundation-devel}
123 Requires: opus-devel >= 0.9.0
124 Requires: ortp-devel >= 4.5.15-1
125 %{?with_portaudio:Requires: portaudio-devel}
126 %{?with_pulseaudio:Requires: pulseaudio-devel >= 0.9.21}
127 Requires: spandsp-devel >= 0.0.6
128 Requires: speex-devel >= 1:1.2-beta3
129 Requires: speexdsp-devel >= 1.2-beta3
130 %{?with_srtp:Requires: libsrtp2-devel}
131 Requires: xorg-lib-libX11-devel
132 Requires: xorg-lib-libXv-devel
135 Header files and development documentation for mediastreamer
138 %description devel -l pl.UTF-8
139 Pliki nagłówkowe i dokumentacja do bibliotek mediastreamer.
142 Summary: Static mediastreamer libraries
143 Summary(pl.UTF-8): Statyczne biblioteki mediastreamer
144 Group: Development/Libraries
145 Requires: %{name}-devel = %{version}-%{release}
148 Static mediastreamer libraries.
150 %description static -l pl.UTF-8
151 Statyczne biblioteki mediastreamer.
154 %setup -q -n mediastreamer2-%{version}
161 #[ ! -e gitversion.h ] && echo '#define MS2_GIT_VERSION "%{version}"' > src/gitversion.h
163 # cmake checks for python3, so don't require python 2 as well
164 %{__sed} -i -e '1s,/usr/bin/python$,%{__python3},' tools/xxd.py
169 # NLS missing in cmake
170 CPPFLAGS="%{rpmcppflags} -DENABLE_NLS=1 -DGETTEXT_PACKAGE=\"mediastreamer\" -DLOCALEDIR=\"%{_localedir}\""
171 # note: NON_FREE_CODECS refer to H263, H264, MPEG4 via libavcodec
173 -DCMAKE_INSTALL_INCLUDEDIR=include \
174 -DCMAKE_INSTALL_LIBDIR=%{_lib} \
175 %{!?with_alsa:-DENABLE_ALSA=OFF} \
176 %{?with_arts:-DENABLE_ARTSC=ON} \
177 %{?with_spandsp:-DENABLE_G726=ON} \
178 %{!?with_bcg729:-DENABLE_G729=OFF} \
179 %{?with_bcg729:-DENABLE_G729B_CNG=ON} \
180 %{!?with_opengl:-DENABLE_GL=OFF} \
181 %{!?with_opengl:-DENABLE_GLX=OFF} \
182 %{!?with_matroska:-DENABLE_MKV=OFF} \
183 -DENABLE_NON_FREE_CODECS=ON \
184 %{?with_oss:-DENABLE_OSS=ON} \
185 %{?with_pcap:-DENABLE_PCAP=ON} \
186 %{?with_portaudio:-DENABLE_PORTAUDIO=ON} \
187 %{?with_pulseaudio:-DENABLE_PULSEAUDIO=ON} \
188 %{!?with_zxing:-DENABLE_QRCODE=OFF} \
189 %{?with_sdl:-DENABLE_SDL=ON} \
190 %{!?with_srtp:-DENABLE_SRTP=OFF} \
191 %{!?with_static_libs:-DENABLE_STATIC=OFF} \
192 -DENABLE_UNIT_TESTS=OFF \
193 %{!?with_zrtp:-DENABLE_ZRTP=OFF}
198 rm -rf $RPM_BUILD_ROOT
200 %{__make} -C build install \
201 DESTDIR=$RPM_BUILD_ROOT
203 # disable completeness check incompatible with split packaging
204 %{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_datadir}/Mediastreamer2/cmake/Mediastreamer2Targets.cmake
206 # missing from install in cmake
207 install build/tools/msaudiocmp $RPM_BUILD_ROOT%{_bindir}
209 install build/tools/pcap_playback $RPM_BUILD_ROOT%{_bindir}
211 for f in po/*.po ; do
212 lang=$(basename "$f" .po)
213 install -d $RPM_BUILD_ROOT%{_localedir}/${lang}/LC_MESSAGES
214 msgfmt -v -o $RPM_BUILD_ROOT%{_localedir}/${lang}/LC_MESSAGES/%{name}.mo "$f"
217 # for external plugins
218 install -d $RPM_BUILD_ROOT%{_libdir}/mediastreamer/plugins
220 # Remove duplicated documentation
221 %{__rm} -r $RPM_BUILD_ROOT/usr/share/doc/mediastreamer2-4.5.0/html
226 rm -rf $RPM_BUILD_ROOT
228 %post -p /sbin/ldconfig
229 %postun -p /sbin/ldconfig
231 %files -f %{name}.lang
232 %defattr(644,root,root,755)
233 %doc CHANGELOG.md README.md
234 %attr(755,root,root) %{_bindir}/mediastream
235 %attr(755,root,root) %{_bindir}/mkvstream
236 %attr(755,root,root) %{_bindir}/msaudiocmp
237 %{?with_pcap:%attr(755,root,root) %{_bindir}/pcap_playback}
238 %attr(755,root,root) %{_libdir}/libmediastreamer.so.11
239 %dir %{_libdir}/mediastreamer
240 %dir %{_libdir}/mediastreamer/plugins
241 %{_datadir}/mediastreamer
244 %defattr(644,root,root,755)
245 %doc build/help/doc/html/*.{css,html,js,png}
246 %attr(755,root,root) %{_libdir}/libmediastreamer.so
247 %{_includedir}/mediastreamer2
248 %{_pkgconfigdir}/mediastreamer.pc
249 %dir %{_datadir}/Mediastreamer2
250 %{_datadir}/Mediastreamer2/cmake
252 %if %{with static_libs}
254 %defattr(644,root,root,755)
255 %{_libdir}/libmediastreamer.a