File LibVNCServer.spec of Package LibVNCServer.15607

#
# spec file for package LibVNCServer
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           LibVNCServer
Version:        0.9.9
Release:        0
Summary:        VNC Development Library
License:        GPL-2.0-or-later
Group:          Development/Libraries/X11
URL:            http://sourceforge.net/projects/libvncserver
Source0:        http://downloads.sourceforge.net/project/libvncserver/libvncserver/%{version}/%{name}-%{version}.tar.gz
Source1:        baselibs.conf
#PATCH-FIX-OPENSUSE: multilib support
Patch1:         libvncserver-0.9.1-multilib.patch
#PATCH-FIX-OPENSUSE: redefine keysyms only if needed
Patch7:         redef-keysym.patch
#PATCH-FIX-OPENSUSE: disable x11vnc build
Patch10:        LibVNCServer-0.9.9-no_x11vnc.patch
#PATCH_FIX-OPENSUSE: Use system fast byteswap routines.
Patch11:        libvncserver-byteswap.patch
Patch12:        libvncserver-ossl.patch
Patch13:        LibVNCServer-CVE-2014-6051.patch
Patch14:        LibVNCServer-CVE-2014-6052.patch
Patch15:        LibVNCServer-CVE-2014-6053.patch
Patch16:        LibVNCServer-CVE-2014-6054.patch
Patch17:        LibVNCServer-CVE-2014-6055.patch
Patch18:        LibVNCServer-ciphersuite.patch
Patch19:        LibVNCServer-CVE-2016-9941.patch
Patch20:        LibVNCServer-CVE-2016-9942.patch
Patch21:        LibVNCServer-CVE-2018-7225.patch
Patch22:        LibVNCServer-CVE-2018-15126.patch
Patch23:        LibVNCServer-CVE-2018-6307.patch
Patch24:        LibVNCServer-CVE-2018-20020.patch
Patch25:        LibVNCServer-CVE-2018-15127.patch
Patch26:        LibVNCServer-CVE-2018-20019.patch
Patch27:        LibVNCServer-CVE-2018-20023.patch
Patch28:        LibVNCServer-CVE-2018-20022.patch
Patch29:        LibVNCServer-CVE-2018-20024.patch
Patch30:        LibVNCServer-CVE-2018-20021.patch
Patch31:        LibVNCServer-CVE-2018-20749.patch
Patch32:        LibVNCServer-CVE-2018-20750.patch
Patch33:        LibVNCServer-CVE-2018-20748.patch
# CVE-2019-15681 [bsc#1155419]
Patch34:        LibVNCServer-CVE-2019-15681.patch
# CVE-2019-20788 [bsc#1170441], integer overflow and heap-based buffer overflow via a large height or width value
Patch35:        LibVNCServer-CVE-2019-20788.patch
# CVE-2019-15690 [bsc#1160471], heap buffer overflow
Patch36:        LibVNCServer-CVE-2019-15690.patch
# CVE-2017-18922 [bsc#1173477], preauth buffer overwrite
Patch37:        LibVNCServer-CVE-2017-18922.patch
# CVE-2020-14400 [bsc#1173691], Byte-aligned data is accessed through uint16_t pointers in libvncserver/translate.c.
Patch38:        LibVNCServer-CVE-2020-14400.patch
# CVE-2020-14401 [bsc#1173694], potential integer overflows in libvncserver/scale.c
Patch39:        LibVNCServer-CVE-2020-14401.patch
# CVE-2020-14397 [bsc#1173700], NULL pointer dereference in libvncserver/rfbregion.c
Patch40:        LibVNCServer-CVE-2020-14397.patch
# CVE-2020-14402 [bsc#1173701], out-of-bounds access via encodings.
Patch41:        LibVNCServer-CVE-2020-14402,14403,14404.patch
# CVE-2020-14399 [bsc#1173743], Byte-aligned data is accessed through uint32_t pointers in libvncclient/rfbproto.c.
Patch42:        LibVNCServer-CVE-2020-14399.patch
# CVE-2019-20840 [bsc#1173876], unaligned accesses in hybiReadAndDecode can lead to denial of service
Patch43:        LibVNCServer-CVE-2019-20840.patch
# CVE-2019-20839 [bsc#1173875], buffer overflow in ConnectClientToUnixSock()
Patch44:        LibVNCServer-CVE-2019-20839.patch
# CVE-2018-21247 [bsc#1173874], uninitialized memory contents are vulnerable to Information leak
Patch45:        LibVNCServer-CVE-2018-21247.patch
# CVE-2020-14398 [bsc#1173880], improperly closed TCP connection causes an infinite loop in libvncclient/sockets.c
Patch46:        LibVNCServer-CVE-2020-14398.patch

BuildRequires:  libavahi-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  libgnutls-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libtool
BuildRequires:  lzo-devel
BuildRequires:  openssl-devel
BuildRequires:  pkgconfig
BuildRequires:  slang-devel
BuildRequires:  xorg-x11-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
VNC is a set of programs using the RFB (Remote Frame Buffer) protocol.
They are designed to "export" a frame buffer via the network. It is
already in wide use for administration, but it is not that easy to
program a server yourself. This has been changed by LibVNCServer.

X.org already has a virtual Xvnc server which you can start as an own
screen (e.g. :1) and connect to with a VNC client (e.g. vncviewer from
tightvnc). The x11vnc binary (that allows you to export the window of a
real running X11 server) has been split off into its own package on
2007-07-16.

%package -n linuxvnc
Summary:        A sample VNC server which exports /dev/vcsaN over RFB
# O/P added for 12.3
Group:          Productivity/Networking/Remote Desktop
Obsoletes:      LibVNCServer < %version-%release
Provides:       LibVNCServer = %version-%release

%description -n linuxvnc
LinuxVNC monitors a virtual console (text mode) of Linux by reading
/dev/vcsaN, and makes it available via RFB.

%package -n libvncclient0
Summary:        Library implementing a VNC client
Group:          System/Libraries
Conflicts:      LibVNCServer < %version

%description -n libvncclient0
LibVNCServer/LibVNCClient are cross-platform C libraries that allow
implementing VNC server or client functionality in your program.

%package -n libvncserver0
Summary:        Library implementing a VNC server
Group:          System/Libraries

%description -n libvncserver0
LibVNCServer/LibVNCClient are cross-platform C libraries that allow
implementing VNC server or client functionality in your program.

%package devel
Requires:       gnutls-devel
Requires:       libvncclient0 = %version
Requires:       libvncserver0 = %version
Requires:       zlib-devel
Summary:        VNC Development Library
Group:          Development/Libraries/X11

%description devel
VNC is a set of programs using the RFB (Remote Frame Buffer) protocol.
They are designed to "export" a frame buffer via the network. It is
already in wide use for administration, but it is not that easy to
program a server yourself. This has been changed by LibVNCServer.

X.org already has a virtual Xvnc server which you can start as an own
screen (e.g. :1) and connect to with a VNC client (e.g. vncviewer from
tightvnc).

The LibVNCServer-devel package contains the static libraries and header
files for LibVNCServer.

%prep
%setup -q
%patch1 -p1 -b .multilib
#%patch2 -p1 -b .system_minilzo
%patch7 -p1
%patch10 -p1 -b .no_x11vnc
# aclocal; autoheader; automake --add-missing --copy; autoconf
# ./configure --enable-maintainer-mode
# sh ./autogen.sh
%patch11
%patch12
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
# fix encoding
for file in AUTHORS ChangeLog ; do
mv ${file} ${file}.OLD && \
iconv -f ISO_8859-1 -t UTF8 ${file}.OLD > ${file} && \
touch --reference ${file}.OLD $file 
done

#nuke bundled minilzo
#rm -f common/lzodefs.h common/lzoconf.h commmon/minilzo.h common/minilzo.c

# needed by patch 2 (and to nuke rpath's)
#autoreconf

%build
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_REENTRANT" \

# Plase note that tightvn cause a problem; need to be fix
%configure --disable-static --with-pic --enable-shared --with-gnu-ld --without-tightvnc-filetransfer --disable-silent-rules

make %{?_smp_mflags}

%{__install} -d -m0755 RPM_BUILD_ROOT%{_datadir}/x11vnc/classes

%check
pushd test
# testsuite fails randomly
make test || true
popd

%install
%makeinstall
%{__rm} -f %{buildroot}%{_libdir}/*.la
%{__rm} -f %{buildroot}%{_libdir}/*.a

%post   -n libvncclient0 -p /sbin/ldconfig
%postun -n libvncclient0 -p /sbin/ldconfig
%post   -n libvncserver0 -p /sbin/ldconfig
%postun -n libvncserver0 -p /sbin/ldconfig

%files -n linuxvnc
%defattr(-,root,root)
%doc COPYING vncterm/README
%{_bindir}/linuxvnc

%files -n libvncserver0
%defattr(-,root,root)
%_libdir/libvncserver.so.0*

%files -n libvncclient0
%defattr(-,root,root)
%_libdir/libvncclient.so.0*

%files devel
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%{_bindir}/libvncserver-config
%{_includedir}/rfb/*
%dir /usr/include/rfb
%{_libdir}/libvncclient.so
%{_libdir}/libvncserver.so
%{_libdir}/pkgconfig/*.pc

%changelog