%global __provides_exclude_from ^(%{_libdir}/hyprland/.*\\.so)$ %global plugins %{expand:borders-plus-plus csgo-vulkan-fix hyprbars hyprtrails hyprwinwrap hyprexpo} %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} %global build_for release %define pluginsmeta %{lua: rpm.define("pluginsmetaname hyprland-plugins") } Name: hyprland-plugins Version: 0.45.0 Release: %autorelease Summary: Official plugins for Hyprland License: BSD-3-Clause URL: https://github.com/hyprwm/hyprland-plugins Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: gcc-c++ BuildRequires: meson BuildRequires: hyprland-devel Requires: hyprland = 0.45.2 # print Recommends: for each plugin %{lua:for w in rpm.expand('%plugins'):gmatch("%S+") do print("Recommends: hyprland-plugin-"..w..(rpm.expand("%build_for") == "git" and "-git" or "")..'\n') end} %description %{summary}. %define _package() \%package -n hyprland-plugin-%1%{?pluginssuffix:%{pluginssuffix}}\ Summary: %1 plugin for hyprland\ Requires: hyprland >= 0.45.2\ \%description -n hyprland-plugin-%1%{?pluginssuffix:%{pluginssuffix}}\ \%1 plugin for hyprland.\ \%files -n hyprland-plugin-%1%{?pluginssuffix:%{pluginssuffix}}\ \%%license LICENSE\ \%dir %{_libdir}/hyprland\ \%{_libdir}/hyprland/lib%1.so\ # expand %%_package for each plugin %{lua:for w in rpm.expand('%plugins'):gmatch("%S+") do print(rpm.expand("%_package "..w)..'\n\n') end} %prep %autosetup -n hyprland-plugins-%{version} -p1 %build for plugin in %{plugins} do pushd $plugin %meson --libdir=%{_libdir}/hyprland %meson_build popd done %install for plugin in %{plugins} do pushd $plugin %meson_install popd done %files %changelog %autochangelog