File tightvnc.spec of Package tightvnc

#
# spec file for package tightvnc (Version 1.3.10)
#
# 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


Name:           tightvnc
BuildRequires:  libjpeg-devel unzip xorg-x11-devel
Url:            http://www.tightvnc.com
License:        GPLv2+
Group:          Productivity/Networking/Remote Desktop
AutoReqProv:    on
Requires:       xorg-x11-Xvnc xinetd
Provides:       vnc
Obsoletes:      vnc
PreReq:         sed
Summary:        A virtual X-Window System server
Version:        1.3.10
Release:        1
Source0:        %name-%version.tar.bz2
Source1:        vnc_inetd_httpd
Source2:        vnc.xinetd
Source3:        vnc.reg
Source4:        tightvnc-firewall-vnc
Source5:        tightvnc-firewall-http
Patch0:         vncviewer.patch
Patch1:         vncserver.patch
Patch2:         vncpasswd.arg.patch
Patch3:         tightvnc-X_SetInputFocus.patch
Patch4:         vncconnect.patch
Patch5:         vncpasswd.patch
Patch6:         tightvnc-byteorder.patch
Patch7:         tightvnc-vncviewer-scrollbar.patch
Patch8:         tightvnc-newfbsize.patch
Patch9:         tightvnc-rfbversion.patch
Patch10:        tightvnc-fullscreen.patch
Patch11:        vncserver.noreset.patch
Patch12:        tightvnc-man.patch
Patch13:        tightvnc-altgr.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
With vnc, start a virtual X Windows System server and get access to it
from different machines with the vnc-viewer.  You can change the
machine without terminating your session.

The viewer and server are also available for Windows -- they allow
access to vnc under Windows.  You can find it under /dosutils/tightvnc
on the installation media.

%prep
%setup -q -n vnc_unixsrc
%patch0
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%patch11
%patch12
%patch13

%build
xmkmf
make World CCOPTIONS="$RPM_OPT_FLAGS"

%install
rm -rf $RPM_BUILD_ROOT
mkdir -m755 -p $RPM_BUILD_ROOT/usr/bin
mkdir -m755 -p $RPM_BUILD_ROOT/usr/share/vnc/classes
mkdir -m755 -p $RPM_BUILD_ROOT%_mandir/man1
./vncinstall $RPM_BUILD_ROOT/usr/bin $RPM_BUILD_ROOT%_mandir
install -m644 classes/* $RPM_BUILD_ROOT/usr/share/vnc/classes
mkdir -m755 -p $RPM_BUILD_ROOT/etc
install -m644 tightvncserver.conf $RPM_BUILD_ROOT/etc/
mkdir -m755 -p $RPM_BUILD_ROOT/etc/xinetd.d/
cp %{SOURCE2} $RPM_BUILD_ROOT/etc/xinetd.d/vnc
install -m755 -c %{SOURCE1} $RPM_BUILD_ROOT/usr/bin/
mkdir -m755 -p $RPM_BUILD_ROOT/etc/slp.reg.d/
install -m644 -c %{SOURCE3} $RPM_BUILD_ROOT/etc/slp.reg.d/
mkdir -m755 -p %buildroot/etc/sysconfig/SuSEfirewall2.d/services
install -m644 -c %SOURCE4 %buildroot/etc/sysconfig/SuSEfirewall2.d/services/vnc-server
install -m644 -c %SOURCE5 %buildroot/etc/sysconfig/SuSEfirewall2.d/services/vnc-httpd
# we don't ship Xvnc
rm $RPM_BUILD_ROOT%_mandir/man1/Xvnc*

%post
if [ -f /etc/xinetd.d/vnc.rpmnew -a -f /etc/xinetd.d/vnc ]; then
	awk '
$1 == "server" {
	sub(/\/usr\/X11R6/,"/usr", $0)
}
$1 == "server_args" && /:42/ {
	sub(/:42/,"", $0);
}
$1 == "server_args" && / -noreset/ {
        sub(/ -noreset/,"", $0);
}
$1 == "server_args" && /=/ {
        sub(/=/,"= -noreset", $0);
}
{
	print
}
	' < /etc/xinetd.d/vnc > /etc/xinetd.d/vnc.new.$$
	/bin/mv -b /etc/xinetd.d/vnc.new.$$ /etc/xinetd.d/vnc
fi

%files
%defattr(-,root,root)
%doc README LICENCE.TXT ChangeLog WhatsNew
%doc %_mandir/*/*
/usr/share/vnc
/usr/bin/*
%config(noreplace) /etc/tightvncserver.conf
%config(noreplace) /etc/xinetd.d/vnc
%dir /etc/slp.reg.d
%config(noreplace) /etc/slp.reg.d/*
%config(noreplace) /etc/sysconfig/SuSEfirewall2.d/services/*

%changelog
openSUSE Build Service is sponsored by