File compiz.spec of Package kde3-compiz

#
# spec file for package compiz (Version 0.8.6)
#
# 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/
#



Name:           compiz
BuildRequires:  Mesa-devel
BuildRequires:  libdbus-1-qt3-0-devel
BuildRequires:  freeglut-devel
BuildRequires:  fuse-devel
BuildRequires:  gcc-c++
%if 0%{?suse_version} <= 1500 
BuildRequires:  gconf2-devel
%endif
%if 0%{suse_version} <= 01140
BuildRequires:  gnome-desktop-devel
BuildRequires:  metacity
BuildRequires:  metacity-devel
%if 0%{suse_version} > 01030
BuildRequires:  gnome-control-center-devel
%endif
%endif
BuildRequires:  gtk2-devel
BuildRequires:  intltool
BuildRequires:  kdebase3-devel
BuildRequires:  kdelibs3-devel
BuildRequires:  librsvg-devel
BuildRequires:  libwnck-devel
BuildRequires:  libxslt-devel
BuildRequires:  pango-devel
BuildRequires:  perl-XML-Parser
BuildRequires:  update-desktop-files

####
#
# KDE4 Extension disabled for openSUSE 11.2, due to incompatibility
# with KDE 4.3 that makes the kde4-decorator crash. This has been
# fixed already in Compiz 0.8.2, which is too far from 
# our package for a proper / tested backport at this time.
# Disabled by dimstar@opensuse.org
#
%if 0%{suse_version} >= 01120
%if 0%{suse_version} <= 01140
BuildRequires:  libgnome-window-settings-devel
BuildRequires:  libgnomeui-devel
%endif
%endif
License:        GPL-2.0 and MIT 
Url:            http://www.compiz.org
Group:          System/GUI/Other
PreReq:         %fillup_prereq
%if 0%{suse_version} <= 01100
Enhances:       xgl >= git_070104
%endif
Version:        0.8.8
Release:        3
Summary:        OpenGL window and compositing manager
# To be nuked: MesaLib, patch60 $mesagl
Source:         compiz-%version.tar.bz2
Source1:        opensuse.png
Source2:        sle.png
Source3:        compiz-decorator
# PATCH-FIX-UPSTREAM compiz-java-config-notify.diff dreveman@novell.com -- Java config notify workaround
Patch0:         compiz-java-config-notify.diff
# PATCH-FEATURE-OPENSUSE dimstar@opensuse.org -- Compiz default settings for openSUSE
Patch1:         compiz-default-settings.diff
# PATCH-FIX-UPSTREAM bnc#449168 dreveman@novell.com - Avoid independent output painting
Patch2:         bug-449168-avoid-independent-output-painting.diff
# PATCH-FIX-UPSTREAM bnc#474862 dreveman@novell.com -- Allow moving focus to fs window
Patch3:         bug-474862-allow-moving-focus-to-fs-window.diff
# PATCH-FIX-UPSTREAM kde-auto-comp.diff dreveman@novell.com -- unknown
Patch4:         kde-auto-comp.diff
# PATCH-FIX-UPSTREAM compiz-gtk_widget_visible.patch dimstar@opensuse.org -- Patch reverting to gtk_vidget_visible for openSUSE < 11.2 (too old gtk).
Patch5:         compiz-gtk_widget_visible.patch
# PATCH-FIX-UPSTREAM compiz-unmanaged-window-position.patch dimstar@opensuse.org -- Fix gravity of unmanaged windows (clock applet for example)
# Patch6:         compiz-unmanaged-window-position.patch
Patch7:         boolref.diff
Requires:       compiz-branding = %{version}
Requires:       compiz-decorator = %{version}
Provides:       windowmanager
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64 ppc ppc64 ia64
%define gnome_prefix %(pkg-config --variable=prefix gnome-desktop-2.0)
%if "%gnome_prefix" == "/usr"
%define gnome_etc /etc
%else
%define gnome_etc /etc%gnome_prefix
%endif
%define kde_prefix %(kde-config --prefix)

%description
Compiz is an OpenGL compositing manager that use
GLX_EXT_texture_from_drawable for binding redirected top-level windows
to texture objects. It has a flexible plug-in system and it is designed
to run well on most graphics hardware.

%if 0%{suse_version} < 01140
%package gnome
License:        GPL-2.0 and MIT
Summary:        OpenGL window and compositing manager configuration utilities
Group:          System/GUI/GNOME
Requires:       %name = %version
Requires:       3ddiag
Requires:       freeglut
Requires:       gnome-desktop
Requires:       pciutils
%if 0%{suse_version} <= 01100
Requires:       xgl-hardware-list >= 060526
%endif
Requires:       metacity >= 2.15.1
%if 0%{suse_version} > 01030
Requires:       gnome-control-center
%endif
%if 0%{suse_version} <= 01030
Requires:       control-center2
%endif
Provides:       compiz-decorator = %version

%description gnome
This package contains Gnome based configuration utilities for the
Compiz compositing manager.
%endif

%package kde3
License:        GPL-2.0 and MIT
Summary:        OpenGL window and compositing managerdecorator
Group:          System/GUI/KDE
Requires:       %name = %version
Provides:       compiz-decorator = %version

%description kde3
This package contains the KDE window decorator for the Compiz
compositing manager.


%package devel
License:        GPL-2.0 and LGPL-2.1 and MIT
Summary:        OpenGL window and compositing manager
Group:          System/GUI/Other
Requires:       %name = %version
Requires:       Mesa-devel
Requires:       freeglut-devel
Requires:       fuse-devel
Requires:       gcc-c++
Requires:       gconf2-devel
Requires:       gtk2-devel
Requires:       intltool
Requires:       kdebase3-devel
Requires:       kdelibs3-devel
Requires:       librsvg-devel
Requires:       libwnck-devel
Requires:       libxml2-devel
Requires:       libxslt-devel
Requires:       metacity-devel
Requires:       pango-devel
Requires:       perl-XML-Parser
Requires:       startup-notification-devel
Requires:       update-desktop-files
Requires:       xorg-x11-devel
%if 0%{suse_version} > 01030
Requires:       gnome-control-center-devel
%endif
%if 0%{suse_version} <= 01030
Requires:       control-center2-devel
%endif

%description devel
Compiz is an OpenGL compositing manager that use
GLX_EXT_texture_from_drawable for binding redirected top-level windows
to texture objects. It has a flexible plug-in system and it is designed
to run well on most graphics hardware.

%package branding-openSUSE
License:        GPL-2.0 and LGPL-2.1 and MIT
Summary:        OpenGL window and compositing manager
Group:          System/GUI/Other
PreReq:         /bin/ln
PreReq:         /bin/rm
Requires:       %name = %version
Supplements:    packageand(branding-openSUSE:compiz)
Provides:       compiz-branding = %version

%description branding-openSUSE
Compiz is an OpenGL compositing manager that use
GLX_EXT_texture_from_drawable for binding redirected top-level windows
to texture objects. It has a flexible plug-in system and it is designed
to run well on most graphics hardware.

%package branding-SLE
License:        GPL-2.0 and LGPL-2.1 and MIT
Summary:        OpenGL window and compositing manager
Group:          System/GUI/Other
PreReq:         /bin/ln
PreReq:         /bin/rm
Requires:       %name = %version
Supplements:    packageand(branding-SLED:compiz)
Provides:       compiz-branding = %version

%description branding-SLE
Compiz is an OpenGL compositing manager that use
GLX_EXT_texture_from_drawable for binding redirected top-level windows
to texture objects. It has a flexible plug-in system and it is designed
to run well on most graphics hardware.

%package branding-upstream
License:        GPL-2.0 and LGPL-2.1 and MIT
Summary:        OpenGL window and compositing manager
Group:          System/GUI/Other
PreReq:         /bin/ln
PreReq:         /bin/rm
Requires:       %name = %version
Supplements:    packageand(branding-upstream:compiz)
Provides:       compiz-branding = %version

%description branding-upstream
Compiz is an OpenGL compositing manager that use
GLX_EXT_texture_from_drawable for binding redirected top-level windows
to texture objects. It has a flexible plug-in system and it is designed
to run well on most graphics hardware.

%prep
%setup -q
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%if 0%{suse_version} <= 1110
# Reverse back to old GTK symbols.
%patch -P 5 -p1 -R
%endif
#patch6 -p1
%patch -P 7 -p1
#sed -i 1i\ '#include <X11/Xdefs.h>' include/decoration.h 

%build

%configure \
        --disable-static \
        --with-pic \
        --sysconfdir=%gnome_etc \
        --disable-schemas-install \
        QTLIB=%{_prefix}/lib/qt3/%{_lib} \
%if 0%{suse_version} >= 01140
        --disable-gnome --disable-gtk
%endif

make %{?jobs:-j%jobs}

%install
%makeinstall
find %{buildroot} -type f -name '*.la' -delete -print
#remove locale data as it is not required anymore, translations are merged in .xml and .schemas
rm -r %{buildroot}%{_datadir}/locale
install -m 444 %_sourcedir/opensuse.png %{buildroot}%{_datadir}/compiz/
install -m 444 %_sourcedir/sle.png %{buildroot}%{_datadir}/compiz/
install -m 755 %_sourcedir/compiz-decorator %{buildroot}%{_bindir}/
%find_gconf_schemas
touch %name.schemas_pre %name.schemas_preun %name.schemas_posttrans %name.schemas_list

%pre -f %name.schemas_pre

%preun -f %name.schemas_preun

%post -p /sbin/ldconfig

%post -n compiz-branding-openSUSE
/bin/ln -sf /usr/share/compiz/opensuse.png /usr/share/compiz/cube-image.png

%post -n compiz-branding-SLE
/bin/ln -sf /usr/share/compiz/sle.png /usr/share/compiz/cube-image.png

%post -n compiz-branding-upstream
/bin/ln -sf /usr/share/compiz/freedesktop.png /usr/share/compiz/cube-image.png

%postun -p /sbin/ldconfig

%postun -n  compiz-branding-openSUSE
if [ -f /usr/share/compiz/cube-image.png ]; then
    rm /usr/share/compiz/cube-image.png || true
fi

%postun -n compiz-branding-SLE
if [ -f /usr/share/compiz/cube-image.png ]; then
    rm /usr/share/compiz/cube-image.png || true
fi

%postun -n compiz-branding-upstream
if [ -f /usr/share/compiz/cube-image.png ]; then
    rm /usr/share/compiz/cube-image.png || true
fi

%posttrans -f %name.schemas_posttrans

%clean
%__rm -rf %{buildroot}

%files -f %name.schemas_list
%defattr(-, root, root)
%{_bindir}/compiz
%{_bindir}/compiz-decorator
%{_libdir}/libdecoration.so.*
%dir %{_libdir}/compiz
%{_libdir}/compiz/libannotate.so
%{_libdir}/compiz/libblur.so
%{_libdir}/compiz/libclone.so
%{_libdir}/compiz/libcommands.so
%{_libdir}/compiz/libcube.so
%{_libdir}/compiz/libdbus.so
%{_libdir}/compiz/libdecoration.so
%{_libdir}/compiz/libfade.so
%{_libdir}/compiz/libfs.so
%{_libdir}/compiz/libini.so
%{_libdir}/compiz/libinotify.so
%{_libdir}/compiz/libminimize.so
%{_libdir}/compiz/libmove.so
%{_libdir}/compiz/libobs.so
%{_libdir}/compiz/libplace.so
%{_libdir}/compiz/libpng.so
%{_libdir}/compiz/libregex.so
%{_libdir}/compiz/libresize.so
%{_libdir}/compiz/librotate.so
%{_libdir}/compiz/libscale.so
%{_libdir}/compiz/libscreenshot.so
%{_libdir}/compiz/libswitcher.so
%{_libdir}/compiz/libvideo.so
%{_libdir}/compiz/libwater.so
%{_libdir}/compiz/libwobbly.so
%{_libdir}/compiz/libzoom.so
%dir %{_datadir}/compiz
%{_datadir}/compiz/icon.png
%{_datadir}/compiz/*.xml
%if 0%{suse_version} < 01140
%{_datadir}/applications/compiz.desktop
%endif

%files devel
%defattr(-, root, root)
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libdecoration.so
%dir %{_includedir}/compiz
%{_includedir}/compiz/*.h
%{_datadir}/compiz/*.xslt

%if 0%{suse_version} < 01140
%files gnome
%defattr(-, root, root)
%{_bindir}/gtk-window-decorator
%{_libdir}/compiz/libglib.so
%{_libdir}/compiz/libgconf.so
%{_libdir}/compiz/libgnomecompat.so
%{_libdir}/compiz/libsvg.so
%gnome_prefix/%{_lib}/window-manager-settings/libcompiz*
#%if 0%{suse_version} > 01100
#%dir %gnome_prefix/share/gnome/wm-properties
#%endif
%gnome_prefix//share/gnome/wm-properties/compiz-wm.desktop
%if "%gnome_prefix" != "/usr"
%gnome_etc/gconf/schemas/*.schemas
%endif
%if 0%{suse_version} >= 01021
%dir %gnome_prefix/share/gnome-control-center/keybindings/
%gnome_prefix/share/gnome-control-center/keybindings/*
%endif
%endif

%files kde3
%defattr(-, root, root)
%{_bindir}/kde-window-decorator
%{_libdir}/compiz/libkconfig.so
%kde_prefix/share/config/compizrc
%kde_prefix/share/config.kcfg/compiz-*
%if 0%{suse_version} > 01130
%exclude %{_libdir}/compiz/libglib.so
%exclude %{_libdir}/compiz/libgconf.so
%exclude %{_libdir}/compiz/libgnomecompat.so
%exclude %{_libdir}/compiz/libsvg.so
%if %suse_version < 1500
%exclude /usr/lib/debug
%endif
%endif

%files branding-openSUSE
%defattr(-, root, root)
%{_datadir}/compiz/opensuse.png

%files branding-SLE
%defattr(-, root, root)
%{_datadir}/compiz/sle.png

%files branding-upstream
%defattr(-, root, root)
%{_datadir}/compiz/freedesktop.png

%changelog
openSUSE Build Service is sponsored by