From d700f0340f6fc1cce65bea01bc83937468b14e20 Mon Sep 17 00:00:00 2001 From: Jan Staněk Date: Sep 12 2019 08:47:14 +0000 Subject: Clean spec file - Remove remnants of packaging arbitrary git checkouts - Rename api_ver to abi_ver (since SONAME tracks ABI changes) - Use simpler GitHub release URL - Remove dependency-resolution comments from BR, sort BR - Replace hard devel dependency for xcb-icccm with softer Recommends - Replace as much macro-magic as possible --- diff --git a/wlroots.spec b/wlroots.spec index f70c44f..3bd197d 100644 --- a/wlroots.spec +++ b/wlroots.spec @@ -1,19 +1,9 @@ -%global commit 0.7.0 -%global gitdate %{nil} -%global gitrel %{nil} -%global gitver %{nil} -# Keep the below around for possible snapshot times (was a must prior to 0.1) -#global scommit #(c=#{commit}; echo ${c:0:7}) -#global gitrel .#{gitdate}git#{scommit} -#global gitver -#{gitdate}git#{scommit} - - -%global api_ver 3 - +# Version of the .so library +%global abi_ver 3 Name: wlroots Version: 0.7.0 -Release: 1%{?gitrel}%{?dist} +Release: 2%{?dist} Summary: A modular Wayland compositor library # Source files/overall project licensed as MIT, but @@ -24,10 +14,9 @@ Summary: A modular Wayland compositor library # `wayland-scanner` binary during build and don't alter # the main license of the binaries linking with them by # the underlying licenses. - License: MIT URL: https://github.com/swaywm/%{name} -Source0: %{url}/archive/%{commit}.tar.gz#/%{name}-%{version}%{?gitver}.tar.gz +Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz # this file is a modification of examples/meson.build so as to: # - make it self-contained # - only has targets for examples known to compile well (cf. "examples) global) @@ -35,54 +24,25 @@ Source1: examples.meson.build BuildRequires: gcc BuildRequires: meson >= 0.48.0 -# patch application -#BuildRequires: git - +BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(freerdp2) -# freerdp-devel +BuildRequires: pkgconfig(gbm) >= 17.1.0 +BuildRequires: pkgconfig(glesv2) BuildRequires: pkgconfig(libcap) -# libcap-devel BuildRequires: pkgconfig(libdrm) >= 2.4.95 -# libdrm-devel >= 2.4.95 -# # transitively: mesa-libEGL-devel BuildRequires: pkgconfig(libinput) >= 1.9.0 -# libinput-devel >= 1.9.0 -BuildRequires: pkgconfig(winpr2) -# libwinpr-devel -BuildRequires: pkgconfig(xkbcommon) -# libxkbcommon-devel -# # transitively: freerdp-devel -BuildRequires: pkgconfig(egl) -# mesa-libEGL-devel -BuildRequires: pkgconfig(glesv2) -BuildRequires: pkgconfig(gbm) >= 17.1.0 -# mesa-libgbm-devel >= 17.1.0 -BuildRequires: pkgconfig(pixman-1) -# pixman-devel BuildRequires: pkgconfig(libudev) -# systemd-devel +BuildRequires: pkgconfig(pixman-1) BuildRequires: pkgconfig(wayland-client) -BuildRequires: pkgconfig(wayland-server) >= 1.16 -# wayland-devel >= 1.16 -# # transitively: freerdp-devel BuildRequires: pkgconfig(wayland-protocols) >= 1.17 -# wayland-protocols-devel >= 1.17 +BuildRequires: pkgconfig(wayland-server) >= 1.16 +BuildRequires: pkgconfig(winpr2) BuildRequires: pkgconfig(xcb-icccm) -# xcb-util-wm-devel - -# these are for examples only: -#BuildRequires: pkgconfig(libpng) -# libpng -# for: examples/screencopy -#BuildRequires: libavcoded libavformat libavutil -# not in Fedora -# for: examples/dmabuf-capture - +BuildRequires: pkgconfig(xkbcommon) # only select examples are supported for being readily compilable (see SOURCE1) -%global examples %{nil \ -} cat multi-pointer output-layout pointer rotation screencopy simple tablet touch - +%global examples \ + cat multi-pointer output-layout pointer rotation screencopy simple tablet touch %description %{summary}. @@ -90,64 +50,50 @@ BuildRequires: pkgconfig(xcb-icccm) %package devel Summary: Development files for %{name} - Requires: %{name}%{?_isa} == %{version}-%{release} -Requires: xcb-util-wm-devel%{?_isa} -# these dependencies are fulfilled with automatic "pkgconfig(*)") -#Requires: libinput-devel#{?_isa} >= 1.9.0 -#Requires: libxkbcommon-devel${?_isa} -#Requires: mesa-libEGL-devel${?_isa} -#Requires: pixman-devel#{?_isa} -#Requires: systemd-devel#{?_isa} -#Requires: wayland-devel#{?_isa} >= 1.16 - +# not required per se, so not picked up automatically by RPM +Recommends: pkgconfig(xcb-icccm) # for examples Suggests: gcc -Suggests: libpng -Suggests: meson +Suggests: meson >= 0.48.0 +Suggests: pkgconfig(libpng) %description devel Development files for %{name}. %prep -%setup -q -n %{name}-%{commit} -#global __scm git_am -#__scm_setup_git -#autopatch -p1 +%autosetup -p1 %build - -# Needed since xcb-errors is not packaged (yet?) -%global __meson_auto_features auto -%meson -Drootston=false -Dexamples=false -%meson_build +# Disable options requiring extra/unpackaged dependencies +%{meson} -Drootston=false -Dexamples=false -Dxcb-errors=disabled +%{meson_build} %install -%meson_install +%{meson_install} -# %%doc && examples. -%{__mkdir} -p %{buildroot}%{_pkgdocdir}/examples -%{__cp} -p README.md %{buildroot}%{_pkgdocdir} -examples=$(for e in %{examples}; do echo examples/$e.[ch]; done) -%{__cp} -p ${examples} %{buildroot}%{_pkgdocdir}/examples -%{__cp} -p %SOURCE1 %{buildroot}%{_pkgdocdir}/examples/meson.build +EXAMPLES=( %{examples} ) # Normalize whitespace by creating an array +for example in "${EXAMPLES[@]}"; do + install -pm0644 -Dt '%{buildroot}/%{_pkgdocdir}/examples' examples/"${example}".[ch] +done +install -pm0644 -D '%{SOURCE1}' '%{buildroot}/%{_pkgdocdir}/examples/meson.build' %check -%meson_test +%{meson_test} %files -%doc %dir %{_pkgdocdir} -%doc %{_pkgdocdir}/README.md %license LICENSE -%{_libdir}/lib%{name}.so.%{api_ver}* +%doc README.md +%doc %dir %{_pkgdocdir} +%{_libdir}/lib%{name}.so.%{abi_ver}* -%files devel +%files devel %doc %{_pkgdocdir}/examples %{_includedir}/wlr %{_libdir}/lib%{name}.so @@ -155,6 +101,9 @@ examples=$(for e in %{examples}; do echo examples/$e.[ch]; done) %changelog +* Thu Sep 12 2019 Jan Staněk - 0.7.0-2 +- Spec file cleanup + * Thu Aug 29 2019 Jeff Peeler - 0.7.0-1 - Updated to version 0.7.0