From acdabdb6573aec8c08dc1c421f325dbcc95b7ec7 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Thu, 26 Sep 2013 19:53:53 +0200 Subject: [PATCH] - updated to 1.0.2 - added ffmpeg patch (fixes build with ffmpeg 2+) - PLDified and completed packaging - some subpackages for plugins with external dependencies --- freerdp-ffmpeg.patch | 72 ++++++++++++ freerdp.spec | 272 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 301 insertions(+), 43 deletions(-) create mode 100644 freerdp-ffmpeg.patch diff --git a/freerdp-ffmpeg.patch b/freerdp-ffmpeg.patch new file mode 100644 index 0000000..ebf0c2d --- /dev/null +++ b/freerdp-ffmpeg.patch @@ -0,0 +1,72 @@ +--- freerdp-1.0.2/channels/drdynvc/tsmf/ffmpeg/tsmf_ffmpeg.c.orig 2013-01-02 22:46:59.000000000 +0100 ++++ freerdp-1.0.2/channels/drdynvc/tsmf/ffmpeg/tsmf_ffmpeg.c 2013-09-26 18:29:52.693695785 +0200 +@@ -39,7 +39,7 @@ + ITSMFDecoder iface; + + int media_type; +- enum CodecID codec_id; ++ enum AVCodecID codec_id; + AVCodecContext* codec_context; + AVCodec* codec; + AVFrame* frame; +@@ -54,7 +54,7 @@ + { + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + +- mdecoder->codec_context = avcodec_alloc_context(); ++ mdecoder->codec_context = avcodec_alloc_context3(NULL); + if (!mdecoder->codec_context) + { + DEBUG_WARN("avcodec_alloc_context failed."); +@@ -88,16 +88,6 @@ + mdecoder->codec_context->channels = media_type->Channels; + mdecoder->codec_context->block_align = media_type->BlockAlign; + +-#ifdef AV_CPU_FLAG_SSE2 +- mdecoder->codec_context->dsp_mask = AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_MMX2; +-#else +-#if LIBAVCODEC_VERSION_MAJOR < 53 +- mdecoder->codec_context->dsp_mask = FF_MM_SSE2 | FF_MM_MMXEXT; +-#else +- mdecoder->codec_context->dsp_mask = FF_MM_SSE2 | FF_MM_MMX2; +-#endif +-#endif +- + return true; + } + +@@ -174,7 +164,7 @@ + { + TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder; + +- if (avcodec_open(mdecoder->codec_context, mdecoder->codec) < 0) ++ if (avcodec_open2(mdecoder->codec_context, mdecoder->codec, NULL) < 0) + { + DEBUG_WARN("avcodec_open failed."); + return false; +@@ -337,7 +327,7 @@ + #endif + + if (mdecoder->decoded_size_max == 0) +- mdecoder->decoded_size_max = AVCODEC_MAX_AUDIO_FRAME_SIZE + 16; ++ mdecoder->decoded_size_max = 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */ + 16; + mdecoder->decoded_data = xzalloc(mdecoder->decoded_size_max); + /* align the memory for SSE2 needs */ + dst = (uint8*) (((uintptr_t)mdecoder->decoded_data + 15) & ~ 0x0F); +@@ -348,7 +338,7 @@ + while (src_size > 0) + { + /* Ensure enough space for decoding */ +- if (mdecoder->decoded_size_max - mdecoder->decoded_size < AVCODEC_MAX_AUDIO_FRAME_SIZE) ++ if (mdecoder->decoded_size_max - mdecoder->decoded_size < 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */) + { + mdecoder->decoded_size_max = mdecoder->decoded_size_max * 2 + 16; + mdecoder->decoded_data = xrealloc(mdecoder->decoded_data, mdecoder->decoded_size_max); +@@ -499,7 +489,6 @@ + + if (!initialized) + { +- avcodec_init(); + avcodec_register_all(); + initialized = true; + } diff --git a/freerdp.spec b/freerdp.spec index cfffc59..0711299 100644 --- a/freerdp.spec +++ b/freerdp.spec @@ -1,46 +1,94 @@ -# Conditional build: # -%bcond_with pcsc # SmartCard support via PCSC-lite library +# Conditional build: +%bcond_without alsa # ALSA sound support +%bcond_without cups # CUPS printing support +%bcond_without directfb # DirectFB client +%bcond_without ffmpeg # FFmpeg audio/video decoding support +%bcond_without pcsc # SmartCard support via PCSC-lite library +%bcond_without pulseaudio # Pulseaudio sound support +%bcond_without x11 # X11 client +%bcond_with sse2 # SSE2 instructions +%ifarch %{x8664} pentium4 +%define with_sse2 1 +%endif Summary: Remote Desktop Protocol client +Summary(pl.UTF-8): Klient protokołu RDP Name: freerdp -Version: 1.0.1 -Release: 0.1 -License: ASL 2.0 +Version: 1.0.2 +Release: 1 +License: Apache v2.0 Group: Applications/Communications +Source0: http://pub.freerdp.com/releases/%{name}-%{version}.tar.gz +# Source0-md5: 08f0e07d8d77e142f7dc39e4033a458d +Patch0: %{name}-ffmpeg.patch URL: http://www.freerdp.com/ -Source0: https://github.com/downloads/FreeRDP/FreeRDP/%{name}-%{version}.tar.gz -BuildRequires: cmake -BuildRequires: cups-devel +%{?with_directfb:BuildRequires: DirectFB-devel} +%{?with_alsa:BuildRequires: alsa-lib-devel} +BuildRequires: cmake >= 2.6 +%{?with_cups:BuildRequires: cups-devel} BuildRequires: desktop-file-utils +%{?with_ffmpeg:BuildRequires: ffmpeg-devel} BuildRequires: openssl-devel %{?with_pcsc:BuildRequires: pcsc-lite-devel} -BuildRequires: pulseaudio-devel +BuildRequires: pkgconfig +%{?with_pulseaudio:BuildRequires: pulseaudio-devel} BuildRequires: xmlto BuildRequires: xorg-lib-libX11-devel BuildRequires: xorg-lib-libXcursor-devel BuildRequires: xorg-lib-libXdamage-devel BuildRequires: xorg-lib-libXext-devel +BuildRequires: xorg-lib-libXfixes-devel BuildRequires: xorg-lib-libXinerama-devel +BuildRequires: xorg-lib-libXtst-devel BuildRequires: xorg-lib-libXv-devel BuildRequires: xorg-lib-libxkbfile +BuildRequires: zlib-devel Requires: %{name}-libs = %{version}-%{release} Requires: %{name}-plugins = %{version}-%{release} +Requires: hicolor-icon-theme Provides: xfreerdp = %{version}-%{release} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description -The xfreerdp Remote Desktop Protocol (RDP) client from the FreeRDP +xfreerdp is Remote Desktop Protocol (RDP) client from the FreeRDP project. xfreerdp can connect to RDP servers such as Microsoft Windows machines, xrdp and VirtualBox. +%description -l pl.UTF-8 +xfreerdp to klient protokołu RDP (Remote Desktop Protocol) z projektu +FreeRDP. + +xfreerdp może łączyć się z serwerami RDP, takimi jak maszyny z +Microsoft Windows, xrdp oraz VirtualBox. + +%package dfb +Summary: DirectFB based Remote Desktop Protocol klient +Summary(pl.UTF-8): Klient protokołu RDP oparty na DirectFB +Group: Applications/Communications +Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-plugins = %{version}-%{release} + +%description dfb +DirectFB based Remote Desktop Protocol klient. + +dfreerdp can connect to RDP servers such as Microsoft Windows +machines, xrdp and VirtualBox. + +%description -l pl.UTF-8 +Klient protokołu RDP oparty na DirectFB. + +dfreerdp może łączyć się z serwerami RDP, takimi jak maszyny z +Microsoft Windows, xrdp oraz VirtualBox. + %package libs Summary: Core libraries implementing the RDP protocol -Group: Applications/Communications +Summary(pl.UTF-8): Główne biblioteki implementujące protokół RDP +Group: Libraries -%description libs +%description libs libfreerdp-core can be embedded in applications. libfreerdp-channels and libfreerdp-kbd might be convenient to use in X @@ -48,27 +96,97 @@ applications together with libfreerdp-core. libfreerdp-core can be extended with plugins handling RDP channels. +%description libs -l pl.UTF-8 +libfreerdp-core może być osadzane w aplikacjach. + +libfreerdp-channels oraz libfreerdp-kbd mogą być wygodne przy użyciu +wraz z libfreerdp-core w aplikacjach X. + +libfreerdp-core można rozszerzać przy użyciu wtyczek obsługujących +kanały RDP. + +%package devel +Summary: Development files for FreeRDP libraries +Summary(pl.UTF-8): Pliki programistyczne bibliotek FreeRDP +Group: Development/Libraries +Requires: %{name}-libs = %{version}-%{release} + +%description devel +This package contains the header files for developing applications +that use FreeRDP libraries. + +%description devel -l pl.UTF-8 +Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji +wykorzystujących biblioteki FreeRDP. + %package plugins Summary: Plugins for handling the standard RDP channels +Summary(pl.UTF-8): Wtyczki do obsługi standardowych kanałów RDP Group: Applications/Communications Requires: %{name}-libs = %{version}-%{release} -%description plugins +%description plugins A set of plugins to the channel manager implementing the standard virtual channels extending RDP core functionality. For instance, sounds, clipboard sync, disk/printer redirection, etc. -%package devel -Summary: Development files for %{name} -Group: Development/Libraries -Requires: %{name}-libs = %{version}-%{release} +%description plugins -l pl.UTF-8 +Zestaw wtyczek zarządcy kanałów, implementujących standardowe +kanały wirtualne rozszerzające podstawową funkcjonalność RDP - +na przykład dźwięk, synchronizację schowka, przekierowanie +dysku/drukarki. + +%package plugins-alsa +Summary: ALSA plugins for handling RDP audio +Summary(pl.UTF-8): Wtyczki ALSA do obsługi dźwięku RDP +Group: Libraries +Requires: %{name}-plugins = %{version}-%{release} + +%description plugins-alsa +ALSA plugins for handling RDP audio. -%description devel -The %{name}-devel package contains libraries and header files for -developing applications that use %{name}-libs. +%description plugins-alsa -l pl.UTF-8 +Wtyczki ALSA do obsługi dźwięku RDP. + +%package plugins-ffmpeg +Summary: FFmpeg plugin for decoding RDP audio/video +Summary(pl.UTF-8): Wtyczka FFmpeg do dekodowania dźwięku/obrazu RDP +Group: Libraries +Requires: %{name}-plugins = %{version}-%{release} + +%description plugins-ffmpeg +FFmpeg plugin for decoding RDP audio/video. + +%description plugins-ffmpeg -l pl.UTF-8 +Wtyczka FFmpeg do dekodowania dźwięku/obrazu RDP. + +%package plugins-pcsc +Summary: PC/SC plugin for RDP smartcard support +Summary(pl.UTF-8): Wtyczka PC/SC do obsługi kart procesorowych w RDP +Group: Libraries +Requires: %{name}-plugins = %{version}-%{release} + +%description plugins-pcsc +PC/SC plugin for RDP smartcard support. + +%description plugins-pcsc -l pl.UTF-8 +Wtyczka PC/SC do obsługi kart procesorowych w RDP. + +%package plugins-pulse +Summary: PulseAudio plugins for handling RDP audio +Summary(pl.UTF-8): Wtyczki PulseAudio do obsługi dźwięku RDP +Group: Libraries +Requires: %{name}-plugins = %{version}-%{release} + +%description plugins-pulse +PulseAudio plugins for handling RDP audio. + +%description plugins-pulse -l pl.UTF-8 +Wtyczki PulseAudio do obsługi dźwięku RDP. %prep %setup -q +%patch0 -p1 cat << EOF > xfreerdp.desktop [Desktop Entry] @@ -76,6 +194,7 @@ Type=Application Name=X FreeRDP NoDisplay=true Comment=Connect to RDP server and display remote desktop +Comment[pl]=Połączenie z serwerem RDP i wyświetlanie zdalnego pulpitu Icon=%{name} Exec=%{_bindir}/xfreerdp Terminal=false @@ -85,23 +204,23 @@ EOF %build install -d build cd build -%cmake \ - -DWITH_CUPS=ON \ +%cmake .. \ + -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \ + %{!?with_alsa:-DWITH_ALSA=OFF} \ + -DWITH_CUNIT=OFF \ + %{!?with_cups:-DWITH_CUPS=OFF} \ + %{?with_directfb:-DWITH_DIRECTFB=ON} \ + %{!?with_ffmpeg:-DWITH_FFMPEG=OFF} \ %{?with_pcsc:-DWITH_PCSC=ON} \ - -DWITH_PULSEAUDIO=ON \ + %{?with_pulseaudio:-DWITH_PULSEAUDIO=ON} \ + -DWITH_SERVER=ON \ + %{!?with_sse2:-DWITH_SSE2=OFF} \ -DWITH_X11=ON \ -DWITH_XCURSOR=ON \ -DWITH_XEXT=ON \ -DWITH_XINERAMA=ON \ -DWITH_XKBFILE=ON \ - -DWITH_XV=ON \ - -DWITH_ALSA=OFF \ - -DWITH_CUNIT=OFF \ - -DWITH_DIRECTFB=OFF \ - -DWITH_FFMPEG=OFF \ - -DWITH_SSE2=OFF \ - -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \ - .. + -DWITH_XV=ON %{__make} @@ -121,8 +240,10 @@ install -p -D resources/FreeRDP_Icon_256px.png $RPM_BUILD_ROOT%{_datadir}/icons/ rm -rf $RPM_BUILD_ROOT %post -# This is no gtk application, but try to integrate nicely with GNOME if it is available -gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +%update_icon_cache hicolor + +%postun +%update_icon_cache hicolor %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig @@ -130,22 +251,87 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/xfreerdp -%{_mandir}/man1/xfreerdp.* +%{_mandir}/man1/xfreerdp.1* %{_desktopdir}/xfreerdp.desktop -%{_iconsdir}/hicolor/256x256/apps/%{name}.png +%{_iconsdir}/hicolor/256x256/apps/freerdp.png + +%files dfb +%defattr(644,root,root,755) +%attr(755,root,root) %{_bindir}/dfreerdp %files libs %defattr(644,root,root,755) -%doc LICENSE README ChangeLog -%{_libdir}/lib%{name}-*.so.* -%dir %{_libdir}/%{name}/ +%doc ChangeLog README +%attr(755,root,root) %{_libdir}/libfreerdp-cache.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libfreerdp-cache.so.1.0 +%attr(755,root,root) %{_libdir}/libfreerdp-channels.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libfreerdp-channels.so.1.0 +%attr(755,root,root) %{_libdir}/libfreerdp-codec.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libfreerdp-codec.so.1.0 +%attr(755,root,root) %{_libdir}/libfreerdp-core.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libfreerdp-core.so.1.0 +%attr(755,root,root) %{_libdir}/libfreerdp-gdi.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libfreerdp-gdi.so.1.0 +%attr(755,root,root) %{_libdir}/libfreerdp-kbd.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libfreerdp-kbd.so.1.0 +%attr(755,root,root) %{_libdir}/libfreerdp-rail.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libfreerdp-rail.so.1.0 +%attr(755,root,root) %{_libdir}/libfreerdp-utils.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libfreerdp-utils.so.1.0 +%dir %{_libdir}/%{name} + +%files devel +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libfreerdp-cache.so +%attr(755,root,root) %{_libdir}/libfreerdp-channels.so +%attr(755,root,root) %{_libdir}/libfreerdp-codec.so +%attr(755,root,root) %{_libdir}/libfreerdp-core.so +%attr(755,root,root) %{_libdir}/libfreerdp-gdi.so +%attr(755,root,root) %{_libdir}/libfreerdp-kbd.so +%attr(755,root,root) %{_libdir}/libfreerdp-rail.so +%attr(755,root,root) %{_libdir}/libfreerdp-utils.so +%{_includedir}/freerdp +%{_pkgconfigdir}/freerdp.pc %files plugins %defattr(644,root,root,755) -%{_libdir}/%{name}/* +%attr(755,root,root) %{_libdir}/%{name}/audin.so +%attr(755,root,root) %{_libdir}/%{name}/cliprdr.so +%attr(755,root,root) %{_libdir}/%{name}/disk.so +%attr(755,root,root) %{_libdir}/%{name}/drdynvc.so +%attr(755,root,root) %{_libdir}/%{name}/parallel.so +%attr(755,root,root) %{_libdir}/%{name}/printer.so +%attr(755,root,root) %{_libdir}/%{name}/rail.so +%attr(755,root,root) %{_libdir}/%{name}/rdpdbg.so +%attr(755,root,root) %{_libdir}/%{name}/rdpdr.so +%attr(755,root,root) %{_libdir}/%{name}/rdpsnd.so +%attr(755,root,root) %{_libdir}/%{name}/serial.so +%attr(755,root,root) %{_libdir}/%{name}/tsmf.so -%files devel +%if %{with alsa} +%files plugins-alsa +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/%{name}/audin_alsa.so +%attr(755,root,root) %{_libdir}/%{name}/rdpsnd_alsa.so +%attr(755,root,root) %{_libdir}/%{name}/tsmf_alsa.so +%endif + +%if %{with ffmpeg} +%files plugins-ffmpeg +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/%{name}/tsmf_ffmpeg.so +%endif + +%if %{with pcsc} +%files plugins-pcsc +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/%{name}/scard.so +%endif + +%if %{with pulseaudio} +%files plugins-pulse %defattr(644,root,root,755) -%{_includedir}/%{name}/ -%{_libdir}/lib%{name}-*.so -%{_pkgconfigdir}/%{name}.pc +%attr(755,root,root) %{_libdir}/%{name}/audin_pulse.so +%attr(755,root,root) %{_libdir}/%{name}/rdpsnd_pulse.so +%attr(755,root,root) %{_libdir}/%{name}/tsmf_pulse.so +%endif -- 2.44.0