Summary:        Library to make writing a vnc server easy
Name:           libvncserver
Version:        0.9.13
Release:        1%{?_dist_release}
Group:          System Environment/Libraries
Vendor:         Project Vine
Distribution:   Vine Linux

# NOTE: --with-tightvnc-filetransfer => GPLv2
License:        GPLv2+
URL:            https://libvnc.github.io/
Source0:        https://github.com/LibVNC/libvncserver/archive/LibVNCServer-%{version}.tar.gz

BuildRoot:      %{_tmppath}/%{name}-%{version}-root
BuildRequires:  cmake
BuildRequires:  pkgconfig(gnutls)
BuildRequires:  pkgconfig(sdl2)
#BuildRequires:  pkgconfig(libsystemd)
BuildRequires:  pkgconfig(avahi-client)
BuildRequires:  pkgconfig(ice)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xdamage)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xfixes)
BuildRequires:  pkgconfig(xi)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xtst)
BuildRequires:  gettext-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  lzo-devel
BuildRequires:  lzo-minilzo
BuildRequires:  openssl-devel
BuildRequires:  zlib-devel
# upstream name
Obsoletes:      LibVNCServer < %{version}-%{release}
Provides:       LibVNCServer = %{version}-%{release}

%description
LibVNCServer makes writing a VNC server (or more correctly, a program
exporting a framebuffer via the Remote Frame Buffer protocol) easy.

It hides the programmer from the tedious task of managing clients and
compression schemata.


%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
# libvncserver-config deps
Requires: coreutils
# upstream name
#Obsoletes: LibVNCServer-devel < %{version}-%{release}
Provides:  LibVNCServer-devel = %{version}-%{release}

%description devel
%{summary}.


%prep
%setup -q -n %{name}-LibVNCServer-%{version}

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

# fix encoding
mv AUTHORS AUTHORS.OLD && \
iconv -f ISO_8859-1 -t UTF8 AUTHORS.OLD > AUTHORS && \
touch --reference AUTHORS.OLD AUTHORS


%build
mkdir -p build
pushd build
%cmake ..
popd

%make_build -C build


%install
rm -rf %{buildroot}
%make_install -C build


%clean
rm -rf %{buildroot}


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%license COPYING
%doc AUTHORS ChangeLog NEWS.md README.md TODO.md
%{_libdir}/libvncclient.so.*
%{_libdir}/libvncserver.so.*

%files devel
%defattr(-,root,root,-)
#{_bindir}/*-config
%{_includedir}/rfb/
%{_libdir}/libvncclient.so
%{_libdir}/libvncserver.so
%{_libdir}/pkgconfig/libvncclient.pc
%{_libdir}/pkgconfig/libvncserver.pc


%changelog
* Fri Jun 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.9.13-1
- new upstream release.
- dropped Patch0, 1 and 3: fixed in upstream.
- dropped Patch2.

* Sat Jul 06 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.9-1
- update to 0.9.9
- remove Patch50 (libvncserver-LINUX.patch)
- remove Patch100 (libvncserver-0.9.1-close_server_socket.patch)
- add patches from fedora
  - Patch0 (LibVNCServer-0.9.9-no_x11vnc.patch)
  - Patch3 (LibVNCServer-0.9.9-pkgconfig.patch)
- update Patch1 (LibVNCServer-0.9.9-system_minilzo.patch) from fedora

* Sun Aug 30 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.9.7-4
- Initial build for Vine Linux

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Sat May 23 2009 Rex Dieter <rdieter@fedoraproject.org> - 0.9.7-3
- Socket is not closed when disconnecting from server (#501895)

* Mon May 04 2009 Rex Dieter <rdieter@fedoraproject.org> - 0.9.7-2
- fix detection of LINUX platform/define

* Mon May 04 2009 Rex Dieter <rdieter@fedoraproject.org> - 0.9.7-1
- LibVNCServer-0.9.7

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Apr 10 2008 Manuel Wolfshant <wolfy@fedoraproject.org> 0.9.1-3
- do not use bundled copy of minilzo (#439979)

* Sun Jan 27 2008 Rex Dieter <rdieter@fedoraproject.org> 0.9.1-2
- hack libtool to omit unused shlib dependencies
- fix AUTHORS encoding
- fix src perms

* Mon Jan 21 2008 Rex Dieter <rdieter@fedoraproject.org> 0.9.1-1
- 0.9.1
