+Name: qtwayland
+Version: 5.0.0beta1
+Release: 1
+License: LGPLv2.1 with exception or GPLv3
+Summary: Wayland support for Qt5
+Url: http://qt-project.org/
+Group: System/Libraries
+Source0: %{name}-%{version}.tar.bz2
+Requires: qtbase >= 5.0.0beta1
+
+BuildRequires: qtbase-devel >= 5.0.0beta1
+BuildRequires: pkgconfig(QtGui)
+BuildRequires: pkgconfig(QtPlatformSupport)
+BuildRequires: gcc-c++
+#BuildRequires: pkgconfig(QtV8)
+#BuildRequires: pkgconfig(QtQuick)
+
+# QtWayland dependencies
+BuildRequires: mesa-libEGL-devel
+BuildRequires: mesa-libGLESv2-devel
+BuildRequires: mesa-libgbm
+BuildRequires: pkgconfig(xkbcommon)
+BuildRequires: pkgconfig(wayland-client)
+BuildRequires: mesa-libwayland-egl-devel pkgconfig(wayland-egl)
+
+# indirect dependencies via QtPlatformSupport (static library)
+# (its .pc file does not list its dependencies properly):
+BuildRequires: pkgconfig(libudev)
+BuildRequires: pkgconfig(fontconfig)
+BuildRequires: pkgconfig(freetype2)
+BuildRequires: pkgconfig(glib-2.0)
+
+%description
+Wayland support for Qt5
+
+%prep
+%setup -q -n %{name}-%{version}
+
+%build
+
+export QTDIR=/usr/share/qt5
+export DESTDIR=%{buildroot}
+
+qmake
+# Build everything, including QtCompositor, otherwise the plugin
+# build fails
+make %{?jobs:-j%jobs}
+
+%install
+# Install only the wayland platform plugin
+# We don't need the QtCompositor library
+cd src/plugins
+%make_install #INSTALL_ROOT="%{buildroot}"
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/qt5/plugins/platforms/*