# ---------------------------------------------------------------------- copyright and license --- # # File: etc/gnome-shell-extension-agism.spec.in # # Copyright 🄯 2022 Van de Bugger. # # This file is part of Agism. # # Agism is free software: you can redistribute it and/or modify it under the terms of the GNU # General Public License as published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # Agism is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License along with Agism. If not, see # . # # SPDX-License-Identifier: GPL-3.0-or-later # # ---------------------------------------------------------------------- copyright and license --- # In OpenSuse documentation files are expected to be in `/usr/share/doc/packages/${name}`, while # `make` by default installs documents to `/usr/share/doc/${name}`. `rpmbuild` fails because it # can't find files it expected location. # # I would expect OpenSuse's `$configure` macro passes `--docdir` option to `configure` command, # bit it does not. Let's fix it: # %if 0%{?suse_version} %global configure %{configure} --docdir=%{_docdir}/%{name} %endif %{lua: --[[-- Some platform do not have `pandoc` and build fails. Let's disable man pages on these platforms to avoid build failure. TODO: Use vdb.lua here. --]]-- function defined( name ) return rpm.expand( "%{?" .. name .. ":1}" ) == "1" end function gets( name, default ) return defined( name ) and rpm.expand( "%{" .. name .. "}" ) or default end function getn( name, default ) return tonumber( gets( name, default ) ) end epel = getn( "epel" ) mageia = getn( "mageia" ) mandriva = gets( "mandriva_branch" ) centos = not mageia and getn( "centos" ) -- Mageia defines "centos", so we have CentOS only if "mageia" is not defined. suse = getn( "suse_version" ) arch = gets( "_arch" ) man = not ( epel and epel == 9 or -- epel-9 (epel-8 is ok). centos and centos == 9 or -- centos-stream-9 (centos-stream-8 is ok). mageia and mageia <= 9 or -- mageia-8 and mageia-cauldron (9). mandriva == "Cooker" or mandriva == "Rolling" or suse and suse == 1599 and arch == "i386" -- opensuse-tumbleweed-i586. ) print( rpm.expand( ( man and "%bcond_without" or "%bcond_with" ) .. " " .. "man\n" ) ) } %global ver 2 %global rel 0.vdb.1.t %global uuid agism@agism.sourceforge.io %global _extdir %{_datadir}/gnome-shell/extensions %global _licdir %{_datadir}/licenses %global debug_package %{nil} Name: gnome-shell-extension-agism Version: %{ver} Release: %{rel}%{?dist} Summary: (D-Bus) API for GNOME Input Source Manager License: GPLv3+ URL: https://agism.sourceforge.io/ Source0: https://sourceforge.net/projects/vdb-sandbox/files/2/agism-%{ver}-%{rel}.tar.gz BuildArch: noarch # Fedora packaging guidelines say dependency on coreutils, gzip, shadow-utils should not be # declared. BuildRequires: make %if %{with man} BuildRequires: pandoc %endif BuildRequires: m4 %if 0%{?fedora} BuildRequires: perl-interpreter %endif %if 0%{?suse_version} BuildRequires: perl-base %endif BuildRequires: perl(JSON) BuildRequires: yajl %description Agism allows 3rd party applications (specifically keyboard layout switchers) to enumerate and activate input sources (aka keyboard layouts). %prep %setup -q -n agism-%{ver}-%{rel} %{__mkdir} _build %{__ln_s} ../conf''igure _build/conf''igure # rpmlint complains "configure-without-libdir-spec". Let's hide configure from rpmlint. %build cd _build %{configure} \ %{?with_man:--enable-man} \ %{!?with_man:--disable-man} \ --disable-author-testing \ --disable-rpm \ --disable-html \ --disable-dependency-tracking \ --srcdir=.. %{make_build} %install cd _build %{make_install} %if 0%{?fedora} %{__rm} -rf %{buildroot}%{_datadir}/licenses/gnome-shell-extension-%{name} %endif %check cd _build # Non-UTF-8 locale may cause exception when printing non-ASCII characters. LANG=C.UTF-8 %{__make} check %files %defattr( -, root, root, - ) %dir %{_extdir}/%{uuid} %doc %{_extdir}/%{uuid}/* %dir %{_licdir}/%{name} %{_licdir}/%{name}/* %if %{with man} %{_mandir}/man7/* %endif %changelog * Fri Sep 16 2022 Van de Bugger - 2-0.vdb.1 - Agism v2. * Thu Jul 28 2022 Van de Bugger - 1-0.vdb.3 - Few files added to source tarball. * Wed Jun 01 2022 Van de Bugger - 1-0.vdb.2 - Upload link fixed in m4 macros. - Few download links fixed. * Wed Jun 01 2022 Van de Bugger - 1-0.vdb.1 - Agism v1. # end of file #