#
# Conditional build:
+%bcond_without apidocs # don't build API documentation
%bcond_without static_libs # don't build static libraries
-#
+
Summary: Wayland - protocol for a compositor to talk to its clients
Summary(pl.UTF-8): Wayland - protokół między serwerem składającym a klientami
Name: wayland
-Version: 0.85.0
+Version: 1.12.0
Release: 1
License: MIT
Group: Libraries
-Source0: http://wayland.freedesktop.org/releases/%{name}-%{version}.tar.xz
-# Source0-md5: fe3fdfdcc0b20235a113e0e34a665b1c
-URL: http://wayland.freedesktop.org/
-BuildRequires: expat-devel
-BuildRequires: libffi-devel
+Source0: https://wayland.freedesktop.org/releases/%{name}-%{version}.tar.xz
+# Source0-md5: ee615e2d1e205eec48b02f069327eb96
+Patch1: %{name}-man.patch
+URL: https://wayland.freedesktop.org/
+BuildRequires: autoconf >= 2.64
+BuildRequires: automake >= 1:1.11
+BuildRequires: expat-devel >= 1.95
+BuildRequires: libffi-devel >= 3
+BuildRequires: libtool >= 2:2.2
+# for DTD valudation
+BuildRequires: libxml2-devel >= 2.0
BuildRequires: pkgconfig
-BuildRequires: pkgconfig(libffi)
+%if %{with apidocs}
+BuildRequires: docbook-style-xsl
+BuildRequires: doxygen >= 1.6.0
+BuildRequires: graphviz >= 2.26.0
+BuildRequires: libxslt-progs
+BuildRequires: xmlto
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%description static -l pl.UTF-8
Statyczne biblioteki Wayland.
+%package apidocs
+Summary: Wayland API and protocol documentation
+Summary(pl.UTF-8): Dokumentacja API biblioteki oraz protokołu Wayland
+Group: Documentation
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
+
+%description apidocs
+Wayland API and protocol documentation.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki oraz protokołu Wayland.
+
%prep
%setup -q
+%patch1 -p1
+
+# force regeneration (.so link is broken, double man3/)
+%{__rm} doc/man/*.3
%build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
%configure \
+ %{!?with_apidocs:--disable-documentation} \
--disable-silent-rules \
%{!?with_static_libs:--disable-static}
+
%{__make}
%install
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+# referenced by some installed wl_*.3 man pages
+cp -p doc/doxygen/man/man3/wayland-{client-core,server,server-core,util}.h.3 \
+ doc/doxygen/man/man3/wayland-{client,server,shm,util}.c.3 $RPM_BUILD_ROOT%{_mandir}/man3
+
# obsoleted by pkg-config
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libwayland-*.la
+%if %{with apidocs}
+# packaged as %doc in -devel
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/wayland
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README TODO
+%doc COPYING README TODO
%attr(755,root,root) %{_libdir}/libwayland-client.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libwayland-client.so.0
+%attr(755,root,root) %{_libdir}/libwayland-cursor.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libwayland-cursor.so.0
%attr(755,root,root) %{_libdir}/libwayland-server.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libwayland-server.so.0
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/wayland-scanner
%attr(755,root,root) %{_libdir}/libwayland-client.so
+%attr(755,root,root) %{_libdir}/libwayland-cursor.so
%attr(755,root,root) %{_libdir}/libwayland-server.so
%{_includedir}/wayland-*.h
+%dir %{_datadir}/wayland
+%{_datadir}/wayland/wayland.dtd
+%{_datadir}/wayland/wayland.xml
+%{_datadir}/wayland/wayland-scanner.mk
%{_pkgconfigdir}/wayland-client.pc
+%{_pkgconfigdir}/wayland-cursor.pc
+%{_pkgconfigdir}/wayland-scanner.pc
%{_pkgconfigdir}/wayland-server.pc
%{_aclocaldir}/wayland-scanner.m4
-%{_aclocaldir}/wayland-scanner.mk
+%if %{with apidocs}
+%{_mandir}/man3/wayland-*.c.3*
+%{_mandir}/man3/wayland-*.h.3*
+%{_mandir}/man3/wl_*.3*
+%endif
%if %{with static_libs}
%files static
%defattr(644,root,root,755)
%{_libdir}/libwayland-client.a
+%{_libdir}/libwayland-cursor.a
%{_libdir}/libwayland-server.a
%endif
+
+%if %{with apidocs}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/publican/Wayland/en-US/html/*
+%endif