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

#
# spec file for package xorg-x11-server (Version 7.4)
#
# 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 moblin 0

Name:           xorg-x11-server
%define dirsuffix 1.6.5
%define fglrx_driver_hack 0
### FIXME
%define vnc 1
BuildRequires:  Mesa-devel bison flex fontconfig-devel freetype2-devel ghostscript-library libdrm-devel libopenssl-devel pkgconfig xorg-x11 xorg-x11-devel xorg-x11-libICE-devel xorg-x11-libSM-devel xorg-x11-libX11-devel xorg-x11-libXau-devel xorg-x11-libXdmcp-devel xorg-x11-libXext-devel xorg-x11-libXfixes-devel xorg-x11-libXmu-devel xorg-x11-libXp-devel xorg-x11-libXpm-devel xorg-x11-libXprintUtil-devel xorg-x11-libXrender-devel xorg-x11-libXt-devel xorg-x11-libXv-devel xorg-x11-libfontenc-devel xorg-x11-libxkbfile-devel xorg-x11-proto-devel xorg-x11-xtrans-devel
### HAL/evdev support
BuildRequires:  hal-devel
%if %vnc
BuildRequires:  libjpeg-devel
%endif
Url:            http://xorg.freedesktop.org/
%define EXPERIMENTAL 0
Version:        7.4
Release:        61.<RELEASE70>
License:        GPLv2+ ; MIT License (or similar)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Group:          System/X11/Servers/XF86_4
%ifnarch s390 s390x
PreReq:         %fillup_prereq
%endif
Requires:       pkgconfig xorg-x11-fonts-core xorg-x11
%if %suse_version > 1010
%ifnarch s390 s390x
Provides:       VIDEO_ABI_VERSION = 5
Provides:       INPUT_ABI_VERSION = 4
Requires:       libpixman-1-0 >= 0.15.2
%endif
%endif
Provides:       xorg-x11-server-glx
Obsoletes:      xorg-x11-server-glx
Summary:        X.Org Server
Source:         xorg-server-%{dirsuffix}.tar.bz2
%ifnarch s390 s390x
Source1:        sysconfig.displaymanager.template
%endif
Source3:        README.updates
Source4:        xorgcfg.tar.bz2
%if %suse_version > 1010
Source5:        modprobe.nvidia
%endif
Source7:        xorg-docs-1.4.tar.bz2
Patch1:         fpic.diff
Patch2:         p_default-module-path.diff
Patch6:         pu_fixes.diff
Patch8:         p_bug96328.diff
Patch13:        p_xorg_acpi.diff
Patch14:        p_xkills_wrong_client.diff
Patch16:        p_xnest-ignore-getimage-errors.diff
Patch18:        p_ia64-console.diff
Patch23:        disable-fbblt-opt.diff
Patch27:        mouse.diff
Patch29:        xephyr.diff
Patch32:        acpi_events.diff
Patch34:        p_pci-off-by-one.diff.ia64
Patch36:        libdrm.diff
%if %vnc
### Dan Nicholson <dbn.lists@gmail.com>
#http://people.freedesktop.org/~dbn/xorg-server-xf4vnc.patch
Patch39:        xorg-server-xf4vnc.patch
Patch40:        xorg-server-xf4vnc-disable-dmxvnc.diff
Patch42:        xorg-server-xf4vnc-TranslateNone.diff
Patch43:        xorg-server-xf4vnc-abi-version.diff
Patch44:        xorg-server-xf4vnc-cutpaste.diff
Patch46:        xorg-server-xf4vnc-busyloop.diff
Patch47:        xorg-server-xf4vnc-clientTimeout.diff
Patch48:        xorg-server-xf4vnc-fix.diff
%endif
Patch41:        loadmod-bug197195.diff
Patch45:        bug-197858_dpms.diff
Patch63:        xorg-x11-server-1.2.99-unbreak-domain.patch
Patch67:        xorg-docs.diff
Patch77:        fbdevhw.diff
Patch79:        edit_data_sanity_check.diff
Patch83:        ia64linuxPciInit.diff
Patch93:        pixman.diff
Patch101:       zap_warning_xserver.diff
Patch103:       confine_to_shape.diff
Patch104:       bitmap_always_unscaled.diff
Patch106:       randr1_1-sig11.diff
Patch109:       events.diff
Patch112:       fix-dpi-values.diff
Patch113:       no-return-in-nonvoid-function.diff
Patch117:       acpi-warning.diff
Patch118:       exa-greedy.diff
Patch123:       vidmode-sig11.diff
Patch125:       0001-Xinput-Catch-missing-configlayout-when-deleting-dev.patch
Patch127:       dpms_screensaver.diff
Patch128:       pci-legacy-mem-fallback.diff
Patch129:       bug474071-fix1.diff
Patch132:       fixed-SYNC-extension-trigger-BlockHandler-test.diff
Patch140:       fbdev_fallback_fail_fix.diff
Patch142:       bug-507190_xorg-x11-server-bnc381139-randr-reprobe-on-unsuspend.diff
Patch143:       autoconfig_fallback_fbdev_first.diff
Patch144:       keyrelease-1.5.2.diff
Patch145:       driver-autoconfig.diff
Patch147:       truetype_fontpath.diff
Patch148:       commit-c941479.diff
# Moblin
Patch161:       libdri_noPanoramiXExtension_symbol.patch
Patch162:       cache-xkbcomp-output-for-fast-start-up.patch
%if %moblin
Patch163:       xserver-1.5.0-bg-none-root.patch
%endif
Patch164:       xorg-detect-psb.patch
%if %moblin
Patch168:       moblin-xserver-no-root-2.patch
%endif
Patch169:       moblin-xorg-x11-nonroot-vesa.patch
%if %moblin
Patch170:       xserver-boottime.patch
Patch171:       moblin-use_preferred_mode_for_all_outputs.diff
%endif
Patch190:       0001-Unclaim-PCI-slot-if-driver-probing-fails.patch
Patch191:       0001-Fix-sporadic-segfault-on-resume-with-intel-KMS-due-t.patch
Patch200:       bug534768-prefer_local_symbols.patch
Patch532341:    bug532341.diff
Patch202:       0001-Check-harder-for-primary-PCI-device.patch
Patch203:       0001-Fix-segfault-when-killing-X-with-ctrl-alt-backspace.patch
Patch204:       XRenderMemoryCorruption.diff
Patch205:       CVE-2010-2240-address_space_limit.patch
Patch206:       CVE-2010-2240-tree_depth_limit.patch
Patch207:       xorg-server-xdmcp.patch
Patch208:       xorg-x11-server-1.6.5-backport_bnc546062.patch
Patch209:       xorg-server-1.6.5-CVE-2011-4028.patch
Patch210:       xorg-server-1.6.5-CVE-2011-4029.patch
Patch211:       U_xf86-fix-flush-input-to-work-with-Linux-evdev-device.patch

%description
This package contains the X.Org Server.



%package extra
License:        GPLv2+ ; MIT License (or similar)
Summary:        Additional Xservers (Xdmx, Xephyr, Xnest, Xvfb)
Group:          System/X11/Servers/XF86_4
Provides:       xorg-x11-Xnest xorg-x11-Xvfb xorg-x11-server:/usr/bin/Xvfb
Obsoletes:      xorg-x11-Xnest xorg-x11-Xvfb
Requires:       xorg-x11-fonts-core xorg-x11 Mesa
AutoReqProv:    on

%description extra
This package contains additional Xservers (Xdmx, Xephyr, Xnest, Xvfb).



%package sdk
License:        GPLv2+ ; MIT License (or similar)
Summary:        X.Org Server SDK
Group:          System/Libraries
Provides:       xorg-x11-sdk
Obsoletes:      xorg-x11-sdk
Requires:       xorg-x11-proto-devel xorg-x11-xtrans-devel xorg-x11-libXau-devel xorg-x11-libXdmcp-devel xorg-x11-libX11-devel xorg-x11-libXext-devel xorg-x11-libXp-devel xorg-x11-libXpm-devel xorg-x11-libXrender-devel xorg-x11-libICE-devel xorg-x11-libSM-devel xorg-x11-libXt-devel xorg-x11-libXmu-devel xorg-x11-libXfixes-devel xorg-x11-libxkbfile-devel  xorg-x11-libfontenc-devel xorg-x11-libXv-devel xorg-x11-libXprintUtil-devel xorg-x11-devel freetype2-devel fontconfig-devel libdrm-devel xorg-x11-server
AutoReqProv:    on

%description sdk
This package contains the X.Org Server SDK.



%if %vnc

%package -n xorg-x11-Xvnc
License:        GPLv2+ ; MIT License (or similar)
Summary:        VNC Server for the X Window System
Group:          System/X11/Servers/XF86_4
Requires:       xorg-x11-fonts-core xorg-x11
Provides:       vnc:/usr/X11R6/bin/Xvnc XFree86-Xvnc
Obsoletes:      XFree86-Xvnc
%ifarch ia64
Provides:       vnc-x86
Obsoletes:      vnc-x86
%endif
AutoReqProv:    on

%description -n xorg-x11-Xvnc
An X Window System server for Virtual Network Computing (VNC).



%endif

%prep
%setup -q -n xorg-server-%{dirsuffix} -a4 -a7
%patch1
%patch2
%patch6
%patch8 -p0
%patch13
%patch14
%patch16 -p2
pushd hw/xfree86/os-support
%patch18
popd
%patch23
%patch27
%patch29
### Bug 197572: X.Org PCI/IA64 patches
%patch32 -p1
### FIXME
#%patch34 -p0
%patch36 -p0
%if %vnc
%patch39 -p1
%patch40 -p0
%patch42 -p1
%patch43 -p0
%patch44
%patch46 -p1
%patch47 -p1
%patch48 -p1
chmod 755 hw/vnc/symlink-vnc.sh
%endif
%patch41 -p1
%patch45 -p0
### FIXME
#%patch63 -p1
pushd xorg-docs-*
%patch67
popd
%patch77
%patch79 -p1
### FIXME
#%patch83
%patch93
%patch101 -p1
%patch103
%patch104 -p1
%patch106 -p1
%patch109 -p1
%patch112 -p0
%patch113 -p0
%patch117
%patch118 -p1
%patch123 -p0
%patch125 -p1
%patch127 -p1
%patch128
pushd hw/xfree86/os-support/bus
%patch129 -p0
popd
%patch132 -p1
%patch140 -p1
%patch142 -p1
%patch143 -p0
%patch144 -p1
%patch145 -p0
%patch147 -p0
### Bug #528397
#%patch148 -p1 -R
%patch161 -p1
%patch162 -p1
%if %moblin
%patch163 -p1
%endif
%patch164 -p1
%if %moblin
%patch168 -p1
%endif
%patch169 -p1
%if %moblin
%patch170 -p1
%patch171 -p1
%endif
#
%patch190 -p1
%patch191 -p1
%patch200 -p1
%patch532341 -p1
%patch202 -p1
%patch203 -p1
%patch204 -p1
%patch205 -p1
%patch206 -p1
%patch207 -p1
%patch208
%patch209
%patch210
%patch211 -p1

%build
pushd xorg-docs-*
autoreconf -fi
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%configure
make
popd
autoreconf -fi
# DRI2 disabled for Xserver 1.5 as libdrm 2.3.1 doesn't have the
# drmBO functionality.
./configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
%if %fglrx_driver_hack
            --with-release-major=7 \
            --with-release-minor=2 \
            --with-release-patch=0 \
            --with-release-snap=0 \
            --with-release-date="%(date)" \
            --with-release-version=7.2.0.0 \
%endif
%if %vnc
            --enable-vnc \
            --disable-xcliplist \
%endif
            --prefix=/usr \
	    --sysconfdir=/etc \
            --libdir=%{_libdir} \
            --mandir=%{_mandir} \
            --enable-builddocs \
            --enable-install-libxf86config \
%ifarch %EXPERIMENTAL
            --enable-glx-tls \
            --enable-multibuffer \
%endif
%ifarch s390 s390x
            --disable-aiglx \
%else
            --enable-aiglx \
%endif
            --enable-lbx \
            --enable-xdmcp \
            --enable-xdm-auth-1 \
            --enable-dri \
            --enable-dri2 \
%ifarch s390 s390x
            --disable-xorg \
%else
            --enable-xorg \
%endif
            --disable-dmx \
            --enable-xnest \
            --enable-kdrive \
            --enable-xephyr \
            --disable-xsdl \
            --enable-xprint \
            --disable-kbd_mode \
            --disable-xprint \
            --enable-record \
            --enable-xcsecurity \
            --with-log-dir="/var/log" \
            --with-os-name="openSUSE" \
            --with-os-vendor="SUSE LINUX" \
            --with-fontdir="/usr/share/fonts" \
            --with-xkb-path="/usr/share/X11/xkb" \
            --with-xkb-output="/var/lib/xkb/compiled"
#make %{?jobs:-j %jobs}
make
make -C hw/kdrive %{?jobs:-j %jobs}

%install
make -C xorg-docs-* install DESTDIR=$RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
make -C hw/kdrive install DESTDIR=$RPM_BUILD_ROOT
%ifnarch s390 s390x
# remove .la files
find $RPM_BUILD_ROOT/usr/%{_lib}/xorg/modules/ -name "*.la" | \
  xargs rm
install -m 644 hw/xfree86/parser/{xf86Parser.h,xf86Optrec.h} \
  $RPM_BUILD_ROOT/usr/include/xorg
# add compatibility symlinks for SUSE <= 10.1
%if %suse_version <= 1010
mkdir -p $RPM_BUILD_ROOT/usr/X11R6/bin
ln -snf ../../bin/X $RPM_BUILD_ROOT/usr/X11R6/bin/X
ln -snf ../../bin/Xorg $RPM_BUILD_ROOT/usr/X11R6/bin/Xorg
%endif
chmod u+s $RPM_BUILD_ROOT/usr/bin/Xorg
mkdir -p $RPM_BUILD_ROOT/var/lib/X11
ln -snf ../../../usr/bin/Xorg $RPM_BUILD_ROOT/var/lib/X11/X
ln -snf ../../var/lib/X11/X $RPM_BUILD_ROOT/usr/bin/X
mkdir -p $RPM_BUILD_ROOT/usr/%{_lib}/xorg/modules/updates/{fonts,input,linux,drivers,multimedia,extensions}
install -m 644 $RPM_SOURCE_DIR/README.updates $RPM_BUILD_ROOT/usr/%{_lib}/xorg/modules/updates
%if %suse_version <= 1010
mkdir -p $RPM_BUILD_ROOT/etc/permissions.d
cat > $RPM_BUILD_ROOT/etc/permissions.d/xorg-x11-server.easy << EOF
/usr/bin/Xorg		root:root	4711
EOF
cat > $RPM_BUILD_ROOT/etc/permissions.d/xorg-x11-server.paranoid << EOF
/usr/bin/Xorg		root:root	0711
EOF
cat > $RPM_BUILD_ROOT/etc/permissions.d/xorg-x11-server.secure << EOF
/usr/bin/Xorg		root:root	0711
EOF
%endif
%else
rm -f $RPM_BUILD_ROOT/usr/share/aclocal/*.m4
%endif
%if %suse_version > 1010
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
install -m 644 $RPM_SOURCE_DIR/modprobe.nvidia $RPM_BUILD_ROOT/etc/modprobe.d/50-nvidia.conf
%endif
%if %vnc
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
%endif
%ifarch s390 s390x
rm $RPM_BUILD_ROOT/usr/%{_lib}/pkgconfig/*.pc
make -C hw/xfree86/parser
mkdir -p $RPM_BUILD_ROOT/usr/include/xorg \
         $RPM_BUILD_ROOT//usr/%{_lib}
install -m 644 hw/xfree86/parser/{xf86Parser.h,xf86Optrec.h} \
         $RPM_BUILD_ROOT/usr/include/xorg
install -m 644 hw/xfree86/parser/libxf86config.a \
         $RPM_BUILD_ROOT//usr/%{_lib}
%endif
%ifnarch s390 s390x
mkdir -p %buildroot/var/adm/fillup-templates
install -m 644 %_sourcedir/sysconfig.displaymanager.template \
  %buildroot/var/adm/fillup-templates/sysconfig.displaymanager-%name
%endif

%clean
rm -rf "$RPM_BUILD_ROOT"
%ifnarch s390 s390x
%verifyscript
%verify_permissions -e /usr/bin/Xorg
%endif

%pre
test -L usr/lib/X11 && rm usr/lib/X11
rm -rf etc/X11/xserver/
exit 0

%post
%ifnarch s390 s390x
%{fillup_only -an displaymanager}
%run_permissions
rm -f var/log/XFree86.*.log*
# SaX2 writes xorg.conf since SuSE 9.3
# - create backup of XF86Config
# - copy XF86Config to xorg.conf
# - set XF86Config symlink to xorg.conf
pushd etc/X11 &> /dev/null
  # get rid of symlinks
  for file in xorg.conf XF86Config; do
    if [ -L $file ]; then
      symlink=$file
      while test -L $symlink; do
        tmp=$(readlink $symlink)
        rm -f $symlink
        symlink=$tmp
      done
      mv $symlink $file
    fi
  done
  if [ ! -f xorg.conf -a -f XF86Config ]; then
    cp XF86Config xorg.conf
  fi
  if [ -f xorg.conf ]; then
    #test -f XF86Config && old XF86Config
    ln -snf xorg.conf XF86Config
  fi
popd &> /dev/null
if [ -f etc/X11/xorg.conf ]; then
  # SuSE 10.1 --> SuSE 10.2: X11 fonts have moved to /usr/share/fonts
  # SuSE 10.1 --> SuSE 10.2: radeonold --> radeon
  # openSUSE 11.0 --> openSUSE 11.1: i810 --> intel (Bug #448458)
 if grep -q -e /usr/X11R6/lib/X11/fonts/	\
            -e /usr/X11/lib/X11/fonts/		\
            -e /usr/lib/X11/fonts/		\
            etc/X11/xorg.conf; then
  sed -i.post_xorg-x11-server \
         -e 's+/usr/X11R6/lib/X11/fonts/+/usr/share/fonts/+g' \
         -e 's+/usr/X11/lib/X11/fonts/+/usr/share/fonts/+g' \
         -e 's+/usr/lib/X11/fonts/+/usr/share/fonts/+g' \
      etc/X11/xorg.conf
 fi
 if grep -q \"radeonold\" etc/X11/xorg.conf; then
  # only switch to radeon if radeonold is no longer available (Bug #355009)
  if test ! -f /usr/%{_lib}/xorg/modules/drivers/radeonold_drv.so; then
    sed -i.post_xorg-x11-server -e 's/\"radeonold\"/\"radeon\"/g' \
      etc/X11/xorg.conf
  fi
 fi
 if grep -q \"i810\" etc/X11/xorg.conf; then
   sed -i.post_xorg-x11-server -e 's/\"i810\"/\"intel\"/g' \
     etc/X11/xorg.conf
 fi
 # Document how to restore previous input driver behaviour in xorg.conf files created
 # on openSUSE <= 11.1
 if ! grep -q "will be disabled unless 'Option \"AutoAddDevices\" \"off\"'" etc/X11/xorg.conf; then
  if ! grep -q "\"AutoAddDevices\" \"off\"" etc/X11/xorg.conf; then
   sed -i '
/Section "ServerFlags"/{
h
g
a\
  # Uncomment the following option to reenable kbd/mouse driver input sections. \
  # Otherwise evdev driver is used. \
  #Option       "AutoAddDevices" "off"
}
'  etc/X11/xorg.conf
  fi
 fi
fi
%endif
# Installation of init script seems to be disabled by default
# Create symbolic run level links for xprint start script
if false; then
  %{fillup_and_insserv -p xprint}
fi
exit 0

%preun
# Installation of init script seems to be disabled by default
if false; then
  %stop_on_removal xprint
fi
exit 0

%postun
# installation of init script seems to be disabled by default
# Rearrange run level symlinks after removing the xprint init script
if false; then
  %{insserv_cleanup}
fi
exit 0

%pre sdk
test -L usr/include/X11 && rm usr/include/X11
exit 0

%files
%defattr(-,root,root)
%if %suse_version > 1010
%dir /etc/modprobe.d
/etc/modprobe.d/50-nvidia.conf
%endif
%ifarch ppc64 x86_64
%dir /usr/%{_lib}/X11
%endif
%dir /usr/%{_lib}/xorg
%ifnarch s390 s390x
%dir /var/lib/X11
%endif
%dir /var/lib/xkb
%dir /var/lib/xkb/compiled
%ifnarch s390 s390x
%if %suse_version <= 1010
/etc/permissions.d/%name.*
%endif
%if %suse_version <= 1010
/usr/X11R6/bin/X
/usr/X11R6/bin/Xorg
%endif
/usr/bin/X
%endif
%ifnarch s390 s390x
%verify(not mode) /usr/bin/Xorg
%endif
%ifnarch s390 s390x
/usr/bin/cvt
%endif
%ifnarch s390 s390x
/usr/bin/gtf
%endif
%ifnarch s390 s390x
/usr/%{_lib}/X11/*
/usr/%{_lib}/xorg/modules/
%{_mandir}/man4/*
%endif
/usr/%{_lib}/xorg/protocol.txt
%{_mandir}/man1/*
%exclude %{_mandir}/man1/Xnest.1*
%exclude %{_mandir}/man1/Xvfb.1*
%ifnarch s390 s390x
%{_mandir}/man5/*
%endif
%{_mandir}/man7/*
%ifnarch s390 s390x
/var/lib/X11/X
%endif
/var/lib/xkb/compiled/README.compiled
%ifnarch s390 s390x
/var/adm/fillup-templates/sysconfig.displaymanager-%name
%endif

%files extra
%defattr(-,root,root)
/usr/bin/Xephyr
/usr/bin/Xnest
/usr/bin/Xvfb
%{_mandir}/man1/Xnest.1*
%{_mandir}/man1/Xvfb.1*

%files sdk
%defattr(-,root,root)
/usr/include/xorg/
/usr/%{_lib}/*.a
%ifnarch s390 s390x
/usr/%{_lib}/pkgconfig/*.pc
/usr/share/aclocal/*.m4
%endif
%if %vnc

%files -n xorg-x11-Xvnc
%defattr(-, root, root)
/etc/sysconfig/SuSEfirewall2.d/services/%{name}
/usr/bin/Xvnc
%endif

%changelog
openSUSE Build Service is sponsored by