File compiz.spec of Package compiz

#
# spec file for package compiz
#
# Copyright (c) 2017 SUSE LINUX 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/
#


%define sover   0
Name:           compiz
Version:        0.8.14
Release:        0
Summary:        OpenGL window and compositing manager
License:        GPL-2.0+ and LGPL-2.1+ and MIT
Group:          System/GUI/Other
Url:            https://github.com/compiz-reloaded/compiz
Source:         https://github.com/compiz-reloaded/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz
Source1:        opensuse.png
Source2:        sle.png
Source3:        baselibs.conf
# PATCH-FEATURE-OPENSUSE compiz-suse-defaults.patch dimstar@opensuse.org -- Compiz default settings for openSUSE.
Patch0:         %{name}-suse-defaults.patch
# PATCH-FIX-UPSTREAM compiz-java-config-notify.diff dreveman@novell.com -- Java config notify workaround.
Patch1:         %{name}-java-config-notify.diff
# PATCH-FIX-UPSTREAM bsc#474862 dreveman@novell.com -- Allow moving focus to fs window.
Patch2:         bug-474862-allow-moving-focus-to-fs-window.diff
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gettext
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  libjpeg-devel
BuildRequires:  libtool
BuildRequires:  libxslt-tools
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(cairo) >= 1.0
BuildRequires:  pkgconfig(cairo-xlib-xrender)
BuildRequires:  pkgconfig(dbus-glib-1)
BuildRequires:  pkgconfig(fuse)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(gobject-introspection-1.0)
BuildRequires:  pkgconfig(ice)
BuildRequires:  pkgconfig(libmarco-private)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(librsvg-2.0) >= 2.14.0
BuildRequires:  pkgconfig(libstartup-notification-1.0) >= 0.7
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(libxslt)
BuildRequires:  pkgconfig(pangocairo)
BuildRequires:  pkgconfig(sm)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcomposite)
BuildRequires:  pkgconfig(xcursor)
BuildRequires:  pkgconfig(xdamage)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xfixes)
BuildRequires:  pkgconfig(xi)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xrender) >= 0.9.3
Requires:       %{name}-branding < 0.9
Requires:       %{name}-decorator < 0.9
Requires:       %{name}-plugins < 0.9
Requires:       lib%{name}config
Requires:       pciutils
Recommends:     %{name}-lang
Suggests:       compicc < 0.9
Provides:       windowmanager
# KDE is no longer supported in Compiz.
Obsoletes:      %{name}-kde < %{version}
Obsoletes:      %{name}-kde4 < %{version}
ExcludeArch:    s390 s390x
%if 0%{?suse_version} > 1320 || (0%{?sle_version} >= 120300 && 0%{?is_opensuse})
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(libwnck-3.0)
%else
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libwnck-1.0)
%endif

%description
Compiz is an OpenGL compositing manager that uses
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.

%lang_package

%package gnome
Summary:        OpenGL window and compositing manager configuration utilities
Group:          System/GUI/Other
Requires:       %{name} = %{version}
Recommends:     %{name}-plugins-main < 0.9
Suggests:       ccsm < 0.9
Supplements:    packageand(%{name}:gnome-session)
Supplements:    packageand(%{name}:mate-session-manager)
Provides:       %{name}-decorator = 0.8
Provides:       %{name}-mate = %{version}

%description gnome
This package contains GNOME/MATE based configuration utilities for
the Compiz compositing manager.

%package plugins
Summary:        OpenGL window and compositing manager default plugins
Group:          System/GUI/Other
Recommends:     %{name} = %{version}
Recommends:     %{name}-plugins-main < 0.9
Suggests:       %{name}-plugins-experimental < 0.9
Suggests:       %{name}-plugins-extra < 0.9

%description plugins
This package contains the default Compiz compositing manager
plugins.

%package devel
Summary:        Development files for Compiz
Group:          Development/Languages/C and C++
Requires:       %{name}-plugins = %{version}
Requires:       libjpeg-devel
Requires:       libxslt-tools
Requires:       pkgconfig
Requires:       pkgconfig(cairo) >= 1.0
Requires:       pkgconfig(cairo-xlib-xrender)
Requires:       pkgconfig(fuse)
Requires:       pkgconfig(gl)
Requires:       pkgconfig(glu)
Requires:       pkgconfig(ice)
Requires:       pkgconfig(libpng)
Requires:       pkgconfig(librsvg-2.0)
Requires:       pkgconfig(libstartup-notification-1.0)
Requires:       pkgconfig(libxml-2.0)
Requires:       pkgconfig(libxslt)
Requires:       pkgconfig(pangocairo)
Requires:       pkgconfig(sm)
Requires:       pkgconfig(x11)
Requires:       pkgconfig(xcomposite)
Requires:       pkgconfig(xcursor)
Requires:       pkgconfig(xdamage)
Requires:       pkgconfig(xext)
Requires:       pkgconfig(xfixes)
Requires:       pkgconfig(xinerama)
Requires:       pkgconfig(xrandr)
Requires:       pkgconfig(xrender)
Recommends:     pkgconfig(libmarco-private)
%if 0%{?suse_version} > 1320 || (0%{?sle_version} >= 120300 && 0%{?is_opensuse})
Requires:       pkgconfig(gtk+-3.0)
Requires:       pkgconfig(libwnck-3.0)
%else
Requires:       pkgconfig(gtk+-2.0)
Requires:       pkgconfig(libwnck-1.0)
%endif

%description devel
Compiz is an OpenGL compositing manager that uses
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
Summary:        OpenGL window and compositing manager
Group:          System/GUI/Other
Requires:       %{name} = %{version}
Requires(pre):  /bin/ln
Requires(pre):  /bin/rm
Supplements:    packageand(%{name}:branding-openSUSE)
Conflicts:      otherproviders(%{name}-branding)
Provides:       %{name}-branding = %{version}

%description branding-openSUSE
Compiz is an OpenGL compositing manager that uses
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-SLED
Summary:        OpenGL window and compositing manager
Group:          System/GUI/Other
Requires:       %{name} = %{version}
Requires(pre):  /bin/ln
Requires(pre):  /bin/rm
Supplements:    packageand(%{name}:branding-SLED)
Conflicts:      otherproviders(%{name}-branding)
# compiz-branding-SLE was last used in openSUSE Leap 42.1
Provides:       %{name}-branding-SLE = %{version}
Obsoletes:      %{name}-branding-SLE < %{version}
Provides:       %{name}-branding = %{version}

%description branding-SLED
Compiz is an OpenGL compositing manager that uses
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
Summary:        OpenGL window and compositing manager
Group:          System/GUI/Other
Requires:       %{name} = %{version}
Requires(pre):  /bin/ln
Requires(pre):  /bin/rm
Supplements:    packageand(%{name}:branding-upstream)
Conflicts:      otherproviders(%{name}-branding)
Provides:       %{name}-branding = %{version}

%description branding-upstream
Compiz is an OpenGL compositing manager that uses
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 -n libdecoration%{sover}
Summary:        Compiz window decoration library
Group:          System/Libraries

%description -n libdecoration%{sover}
The window decoration library is responsible for drawing the
window borders and title bar of windows managed by Compiz. It is
used by window decorators like gtk-window-decorator.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
cp -f %{SOURCE1} opensuse.png
cp -f %{SOURCE2} sle.png

%if 0%{?suse_version} <= 1320 && !(0%{?sle_version} > 120100 && 0%{?is_opensuse})
# Workaround /usr/@DATADIRNAME@/locale/.
rm -r m4/
%endif

%build
NOCONFIGURE=1 ./autogen.sh
%configure \
  --disable-static \
  --enable-marco   \
%if 0%{?suse_version} > 1320 || (0%{?sle_version} >= 120300 && 0%{?is_opensuse})
  --with-gtk=3.0   \
%else
  --with-gtk=2.0   \
%endif
  --with-default-plugins=core,ccp,decoration,dbus,commands,ezoom,fade,minimize,mousepoll,move,place,png,regex,resize,session,snap,switcher,vpswitch,wall,workarounds,matecompat
make %{?_smp_mflags} V=1

%install
%make_install

install -Dpm 0644 opensuse.png %{buildroot}%{_datadir}/%{name}/opensuse.png
install -Dpm 0644 sle.png %{buildroot}%{_datadir}/%{name}/sle.png

find %{buildroot} -type f -name "*.la" -delete -print
%find_lang %{name}

%post
/sbin/ldconfig
%desktop_database_post
%icon_theme_cache_post

%postun
/sbin/ldconfig
%desktop_database_postun
%icon_theme_cache_postun

%post branding-openSUSE
ln -sf opensuse.png %{_datadir}/%{name}/cube-image.png

%postun branding-openSUSE
if [ -f %{_datadir}/%{name}/cube-image.png ]; then
    rm -f %{_datadir}/%{name}/cube-image.png || :
fi

%post branding-SLED
ln -sf sle.png %{_datadir}/%{name}/cube-image.png

%postun branding-SLED
if [ -f %{_datadir}/%{name}/cube-image.png ]; then
    rm -f %{_datadir}/%{name}/cube-image.png || :
fi

%post branding-upstream
ln -sf freedesktop.png %{_datadir}/%{name}/cube-image.png

%postun branding-upstream
if [ -f %{_datadir}/%{name}/cube-image.png ]; then
    rm -f %{_datadir}/%{name}/cube-image.png || :
fi

%post gnome
%glib2_gsettings_schema_post

%postun gnome
%glib2_gsettings_schema_postun

%post -n libdecoration%{sover} -p /sbin/ldconfig

%postun -n libdecoration%{sover} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING* NEWS README.md
%{_bindir}/%{name}
%{_bindir}/%{name}-decorator
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/*.*
%dir %{_libdir}/%{name}/
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/core.xml
%{_datadir}/%{name}/icon.png

%files lang -f %{name}.lang
%defattr(-,root,root)

%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libdecoration.so

%files plugins
%defattr(-,root,root)
%dir %{_libdir}/%{name}/
%dir %{_datadir}/%{name}/
%{_libdir}/%{name}/*annotate.*
%{_datadir}/%{name}/*annotate.*
%{_libdir}/%{name}/*blur.*
%{_datadir}/%{name}/*blur.*
%{_libdir}/%{name}/*clone.*
%{_datadir}/%{name}/*clone.*
%{_libdir}/%{name}/*commands.*
%{_datadir}/%{name}/*commands.*
%{_libdir}/%{name}/*cube.*
%{_datadir}/%{name}/*cube.*
%{_libdir}/%{name}/*dbus.*
%{_datadir}/%{name}/*dbus.*
%{_libdir}/%{name}/*decoration.*
%{_datadir}/%{name}/*decoration.*
%{_libdir}/%{name}/*fade.*
%{_datadir}/%{name}/*fade.*
%{_libdir}/%{name}/*fs.*
%{_datadir}/%{name}/*fs.*
%{_libdir}/%{name}/*glib.*
%{_datadir}/%{name}/*glib.*
%{_libdir}/%{name}/*ini.*
%{_datadir}/%{name}/*ini.*
%{_libdir}/%{name}/*inotify.*
%{_datadir}/%{name}/*inotify.*
%{_libdir}/%{name}/*matecompat.*
%{_datadir}/%{name}/*matecompat.*
%{_libdir}/%{name}/*minimize.*
%{_datadir}/%{name}/*minimize.*
%{_libdir}/%{name}/*move.*
%{_datadir}/%{name}/*move.*
%{_libdir}/%{name}/*obs.*
%{_datadir}/%{name}/*obs.*
%{_libdir}/%{name}/*place.*
%{_datadir}/%{name}/*place.*
%{_libdir}/%{name}/*png.*
%{_datadir}/%{name}/*png.*
%{_libdir}/%{name}/*regex.*
%{_datadir}/%{name}/*regex.*
%{_libdir}/%{name}/*resize.*
%{_datadir}/%{name}/*resize.*
%{_libdir}/%{name}/*rotate.*
%{_datadir}/%{name}/*rotate.*
%{_libdir}/%{name}/*scale.*
%{_datadir}/%{name}/*scale.*
%{_libdir}/%{name}/*screenshot.*
%{_datadir}/%{name}/*screenshot.*
%{_libdir}/%{name}/*svg.*
%{_datadir}/%{name}/*svg.*
%{_libdir}/%{name}/*switcher.*
%{_datadir}/%{name}/*switcher.*
%{_libdir}/%{name}/*wall.*
%{_datadir}/%{name}/*wall.*
%{_libdir}/%{name}/*water.*
%{_datadir}/%{name}/*water.*
%{_libdir}/%{name}/*wobbly.*
%{_datadir}/%{name}/*wobbly.*
%{_libdir}/%{name}/*zoom.*
%{_datadir}/%{name}/*zoom.*

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

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

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

%files gnome
%defattr(-,root,root)
%{_bindir}/gtk-window-decorator
%{_datadir}/glib-2.0/schemas/*gwd.gschema.xml

%files -n libdecoration%{sover}
%defattr(-,root,root)
%{_libdir}/libdecoration.so.%{sover}*

%changelog
openSUSE Build Service is sponsored by