%bcond_with systemd

Summary:        Window and compositing manager based on Clutter
Name:           mutter
Version:        40.0
Release:        1%{?_dist_release}%{?with_systemd:.systemd}
Group:          deskotp-gnome
Vendor:         Project Vine
Distribution:   Vine Linux

License:        GPLv2+
URL:            http://git.gnome.org/browse/mutter
%global         shortver %(echo %{version} | cut -d . -f 1)
Source0:        https://download.gnome.org/sources/%{name}/%{shortver}/%{name}-%{version}.tar.xz

Patch100:       mutter-3.18.1-roundf.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root

BuildRequires:	meson
BuildRequires:	pkgconfig
BuildRequires:	intltool
BuildRequires:	gtk3-devel
BuildRequires:	clutter-devel
BuildRequires:	mesa-libgbm-devel >= 10.3
BuildRequires:	mesa-libGLES-devel
BuildRequires:	libSM-devel
BuildRequires:	libxkbfile-devel
BuildRequires:	xkeyboard-config
BuildRequires:	libxkbcommon-devel
BuildRequires:	python-devel
BuildRequires:	gnome-desktop3-devel
BuildRequires:	gobject-introspection-devel
BuildRequires:	startup-notification-devel
BuildRequires:	libcanberra-gtk3-devel
BuildRequires:	upower-devel >= 0.9.11
BuildRequires:	desktop-file-utils
BuildRequires:	zenity
BuildRequires:	gsettings-desktop-schemas-devel >= 3.4.0
BuildRequires:	libXtst-devel
BuildRequires:	libgudev-devel
BuildRequires:	graphene-devel
BuildRequires:	gnome-settings-daemon-devel
BuildRequires:	libwacom-devel
BuildRequires:	pipewire-devel
BuildRequires:	xorg-x11-server-Xorg
%if %{with systemd}
BuildRequires:	systemd-devel
%else
BuildRequires:	elogind-devel
%endif
BuildRequires:	pkgconfig(wayland-server)
BuildRequires:	pkgconfig(wayland-eglstream)
BuildRequires:	pkgconfig(xwayland)
BuildRequires:	pkgconfig(wayland-protocols)

Requires:		%{name}-libs = %{version}-%{release}
Requires(postun,posttrans):	desktop-file-utils

%description
Mutter is a minimal X window manager aimed at nontechnical users and is designed to integrate well with the GNOME desktop. Mutter lacks some features that may be expected by traditional UNIX or other technical users; these users may want to investigate other available window managers for use with GNOME or standalone.


%package        devel
Summary:        Development files of the mutter library.
Group:          programming

Requires:       %{name}-libs = %{version}-%{release}
Requires:       pkgconfig
Requires:       gtk3-devel
Requires:       clutter-devel
Requires:       libX11-devel

%description    devel
Development files of the mutter library.


%package        libs
Summary:        Libraries for %{name}
Summary(ja):    %{name} の共有ライブラリ
Group:          system

%description    libs
The %{name}-libs package contains the runtime shared libraries for
%{name}.


%debug_package


%prep
%setup -q
%patch100 -p1 

%build
export CFLAGS="$RPM_OPT_FLAGS -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=format"
#intltoolize --force --copy
%meson \
	-Dprofiler=false \
	-Dtests=false \
	-Dinstalled_tests=false \
	-Degl_device=true \
	-Dwayland_eglstream=true
%meson_build


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%meson_install

%find_lang %{name}


%post 
touch --no-create %{_datadir}/icons/hicolor

%postun
if [ "$1" -eq 0 ]; then
	touch --no-create %{_datadir}/icons/hicolor
fi


%files -f %{name}.lang
%defattr(-,root,root)
%license COPYING
%doc NEWS
%{_bindir}/mutter
%{_libdir}/mutter-*/plugins/libdefault.so
%{_libexecdir}/mutter-restart-helper
/lib/udev/rules.d/61-mutter.rules
%{_datadir}/GConf/gsettings/mutter-schemas.convert
%{_datadir}/applications/*
%{_datadir}/glib-2.0/schemas/org.gnome.mutter.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.mutter.wayland.gschema.xml
%{_datadir}/gnome-control-center/keybindings/50-mutter-navigation.xml
%{_datadir}/gnome-control-center/keybindings/50-mutter-system.xml
%{_datadir}/gnome-control-center/keybindings/50-mutter-wayland.xml
%{_datadir}/gnome-control-center/keybindings/50-mutter-windows.xml
%{_mandir}/man1/mutter.1.gz

%files libs
%defattr(-,root,root,-)
%{_libdir}/lib*.so.*
%dir %{_libdir}/mutter-*
%dir %{_libdir}/mutter-*/plugins
%{_libdir}/mutter-*/lib*.so.*
%{_libdir}/mutter-*/*.so
%{_libdir}/mutter-*/*.typelib

%files devel
%defattr(-,root,root,-)
%{_includedir}/mutter-*/*
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*
%{_libdir}/mutter-*/*.gir


%changelog
* Sun Mar 28 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 40.0-1
- new upstream release.
- built with wayland.

* Mon Aug 03 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.36.4-1
- new upstream release.
- added systemd support (disabled as default).
- dropped Patch0: fixed in upstream.

* Sun Dec 30 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.30.2-1
- new upstream release.

* Sun Jul 17 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.20.3-1
- new upstream release

* Fri Nov 13 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.2-1
- new upstream release

* Sat Oct 31 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.1-1
- new upstream release
- add Patch100 (mutter-3.18.1-roundf.patch)
- remove %%{name}-docs subpackage

* Sat May 16 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.2-1
- new upstream release

* Sat May 16 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.2-1
- new upstream release

* Sun Apr 19 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.1.1-1
- new upstream release

* Sun Mar 29 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.0-1
- new upstream release

* Mon Dec 22 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.14.3-1
- new upstream release

* Wed Nov 19 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.14.2-1
- new upstream release

* Sat Nov 08 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.14.1.5-1
- new upstream release
- add BuildRequires: mesa-libgbm-devel, libxkbfile-devel, xkeyboard-config, libxkbcommon-devel

* Sun Sep 21 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.2-2
- rebuild with upower-0.99.1

* Wed May 14 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.2-1
- new upstream release

* Sat Apr 19 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.1-1
- new upstream release

* Sat Apr 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.0-1
- new upstream release

* Sat Jan 25 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.3-1
- new upstream release

* Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.2-1
- new upstream release

* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.1.1-1
- new upstream release
- add BuildRequires: gnome-desktop3-devel, upower-devel
- create libs subpackage
- add Patch0 (mutter-3.10.0.1-introspection.patch)

* Sun Aug 11 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.4-1
- new upstream release

* Sun Jun 09 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.3-1
- new upstream release

* Sun May 19 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.2-1
- new upstream release
- remove Patch101 (mutter-vine-customize.patch)

* Thu Apr 18 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.1-1
- new upstream release
- create %%{name}-doc subpackage

* Sun Feb 17 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.3-1
- new upstream release

* Wed Nov 14 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.2-1
- new upstream release

* Tue Oct 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.1-1
- new upstream release

* Sat Sep 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.0-1
- new upstream release
- remove BuildRequires: GConf2-devel

* Sat Apr 21 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.1-1
- new upstream release
- update Patch101 (mutter-vine-customize.patch)
- add BuildRequires: gsettings-desktop-schemas-devel

* Sat Jan 21 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.2-1
- new upstream release

* Fri Oct 21 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.1-1
- new upstream release

* Wed Sep 28 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.0-1
- new upstream release

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.92-1
- new upstream release

* Sun Sep 18 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.91.1-1
- new upstream release
- add Requires: gtk3-devel, libX11-devel (-devel package)

* Sat Sep 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.90.1-1
- new upstream release
- add BuildRequires: zenity

* Fri Aug 12 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.4-1
- new upstream release
- change BuildRequires: gobject-introspection-devel instead of gir-repository-devel 
- change BuildRequires: gtk3-devel instead of gtk2-devel
- change BuildRequires: libcanberra-gtk3-devel instead of libcanberra-devel
- add Patch101 (mutter-vine-customize.patch)

* Thu Sep 23 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.29.1-2
- rebuild with rpm-4.8.1 for pkg-config file

* Thu Apr 29 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.29.1-1
- new upstream release
- add BuildRequires: libcanberra-devel
- Requires: clutter-devel (devel package)

* Sun Feb 28 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.28.0-1
- initial build for Vine Linux

