File compiz.spec of Package 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:  freeglut-devel
BuildRequires:  fuse-devel
BuildRequires:  gcc-c++
BuildRequires:  gconf2-devel
BuildRequires:  libgnome-desktop-2-devel
BuildRequires:  gtk2-devel
#BuildRequires:	gtk-devel
BuildRequires:  intltool
BuildRequires:  librsvg-devel
BuildRequires:  libwnck-devel
BuildRequires:  libxslt-devel
BuildRequires:  metacity
BuildRequires:	pkg-config
BuildRequires:  pango-devel
BuildRequires:  perl-XML-Parser
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
%if "%_repository" == "SUSE_Linux_10.1" || "%_repository" == "SLE_10"
BuildRequires:  xorg-x11-compat70-devel
%endif
BuildRequires:  metacity-devel
BuildRequires:  gnome-control-center-devel
BuildRequires:  kde4-kwin
BuildRequires:	kwin
BuildRequires:  kdebase4-workspace-devel
BuildRequires:  libkde4-devel
BuildRequires:  libgnome-window-settings-devel
BuildRequires:  libgnomeui-devel
BuildRequires:	kdebase4-workspace-devel
License:        GPLv2+ ; MIT License (or similar)
Url:            http://www.compiz.org
Group:          System/GUI/Other
PreReq:         %fillup_prereq
Version:        0.8.6
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
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
%gconf_schemas_prereq
%define want_kde3 0
%if 0%want_kde3
%define kde_prefix %(kde-config --prefix)
%endif

%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.

%package gnome
License:        GPLv2+ ; MIT License (or similar)
Summary:        OpenGL window and compositing manager configuration utilities
Group:          System/GUI/GNOME
Requires:       %name = %version
Requires:       3ddiag
Requires:       freeglut
Requires:       gnome-desktop2
Requires:       pciutils
Requires:       metacity >= 2.15.1
Requires:       gnome-control-center
Provides:       compiz-decorator = %version

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

%if 0%want_kde3
%package kde
License:        GPLv2+ ; MIT License (or similar)
Summary:        OpenGL window and compositing managerdecorator
Group:          System/GUI/KDE
Requires:       %name = %version
Provides:       compiz-decorator = %version

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


%package kde4
License:        GPLv2+ ; LGPLv2.1+ ; MIT License (or similar)
Summary:        OpenGL window and compositing managerdecorator for kde4
Group:          System/GUI/KDE
Requires:       %name = %version
Requires:       kde4-kwin
Recommends:     simple-ccsm-kde4
Provides:       compiz-decorator = %version

%description kde4
This package contains the KDE4 window decorator for the Compiz
compositing manager.

%package devel
License:        GPLv2+ ; LGPLv2.1+ ; MIT License (or similar)
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:       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
Requires:       gnome-control-center-devel


%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:        GPLv2+ ; LGPLv2.1+ ; MIT License (or similar)
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:        GPLv2+ ; LGPLv2.1+ ; MIT License (or similar)
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:        GPLv2+ ; LGPLv2.1+ ; MIT License (or similar)
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
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%if 0%{suse_version} <= 1110
# Reverse back to old GTK symbols.
%patch5 -p1 -R
%endif
%patch6 -p1

%build
%configure \
        --disable-static \
        --with-pic \
        --sysconfdir=%gnome_etc \
        --disable-schemas-install \
	--disable-gtk \
%if 0%want_kde3
	--enable-kde \
%else
	--disable-kde \
%endif
	--enable-metacity \
        QTLIB=%{_prefix}/lib/qt3/%{_lib}

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
#%{_datadir}/applications/compiz.desktop

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

%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*
#%gnome_prefix//share/gnome/wm-properties/compiz-wm.desktop
%if "%gnome_prefix" != "/usr"
%gnome_etc/gconf/schemas/*.schemas
%endif
#%dir %gnome_prefix/share/gnome-control-center/keybindings/
#%gnome_prefix/share/gnome-control-center/keybindings/*

%if 0%want_kde3
%files kde
%defattr(-, root, root)
%{_bindir}/kde-window-decorator
%{_libdir}/compiz/libkconfig.so
%kde_prefix/share/config/compizrc
%kde_prefix/share/config.kcfg/compiz-*
%endif

%files kde4
%defattr(-, root, root)
%{_bindir}/kde4-window-decorator

%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