File xorg-x11-Xvnc.spec of Package xorg-x11-Xvnc

#
# spec file for package xorg-x11-Xvnc
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#

# norootforbuild

%define tigervnc 1

Name:           xorg-x11-Xvnc
%if %tigervnc
Version:        7.6_1.0.1
%else
Version:        7.6_0.1
%endif
Release:        2.1
%if %tigervnc
License:        GPL-2.0
%else
#License:        MIT License (or similar)
%endif
%if %tigervnc
BuildRequires:  xorg-x11-server-sdk Mesa-devel libopenssl-devel gcc-c++ autoconf automake cmake libtool libjpeg-devel nasm fltk-devel font-util libXfont-devel
%else
Requires:       x11vnc
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Group:          System/X11/Servers/XF86_4
%if %tigervnc
Summary:        TigerVNC implementation of Xvnc
%else
Summary:        Xvnc wrapper script which makes use of Xvfb/x11vnc
%endif
%if %tigervnc
Source1:        tigervnc-1.2.80-20120905svn4996.tar.bz2
Source2:        xorg-server-1.13.0.tar.bz2
Patch:          xorg-server-xdmcp.patch
Patch1:         tigervnc-1.2.80-fix-int-to-pointer.patch
Patch2:         N_tigervnc_keyboard-layout-handling.patch
%else
Source0:        Xvnc.pl
%endif

%description
%if %tigervnc
This is the TigerVNC implementation of Xvnc.
%else
This is a wrapper script, which makes use of Xvfb/x11vnc to implement
a Xvnc server.
%endif

%prep
%if %tigervnc
%setup -T -n tigervnc-1.2.80-20120905svn4996/unix/xserver -b1 -b2
cp -r ../../../xorg-server-*/* .
patch -p1 < ../xserver113.patch
%patch1 -p1
%patch2 -p1
cd ../..
%endif

%build
%if %tigervnc
pushd ../..
cmake . -DCMAKE_BUILD_TYPE=Debug
make %{?jobs:-j %jobs}

popd
autoreconf -fi
%configure \
	--disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
	--disable-xwin --disable-xephyr --disable-kdrive --with-pic \
	--disable-static --disable-xinerama \
	--with-xkb-path="/usr/share/X11/xkb" \
	--with-xkb-output="/var/lib/xkb/compiled" \
	--enable-glx --enable-dri --enable-dri2 \
	--disable-config-dbus \
	--disable-config-hal \
	--disable-config-udev \
	--without-dtrace \
	--disable-unit-tests \
	--disable-devel-docs \
	--with-fontrootdir=/usr/share/fonts \
	--disable-selective-werror
make %{?jobs:-j %jobs}
%endif

%install
%if %tigervnc
make install DESTDIR=$RPM_BUILD_ROOT
%else
mkdir -p $RPM_BUILD_ROOT/usr/bin
install -m 755 $RPM_SOURCE_DIR/Xvnc.pl  $RPM_BUILD_ROOT/usr/bin/Xvnc
%endif
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services
cat > $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/%{name} << EOF
## Name: VNC Server
## Description: Opens ports for VNC Server
TCP="5801 5901"
EOF

%clean
rm -rf "$RPM_BUILD_ROOT"

%files
%defattr(-,root,root)
/etc/sysconfig/SuSEfirewall2.d/services/%{name}
/usr/bin/Xvnc
%if %tigervnc
%{_mandir}/man1/Xvnc.1*
%exclude %{_mandir}/man1/Xserver.1*
%exclude /usr/%{_lib}/xorg/protocol.txt
%exclude /usr/%{_lib}/xorg/modules/extensions/libvnc.la
%exclude /usr/%{_lib}/xorg/modules/extensions/libvnc.so
%exclude /var/lib/xkb/compiled/README.compiled
%exclude /usr/lib/debug/*
%exclude /usr/lib/debug/.*
%endif

%changelog
openSUSE Build Service is sponsored by