File fonts-config.spec of Package fonts-config

#
# spec file for package fonts-config
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
  %define _fillupdir %{_datadir}/fillup-templates
%endif
Name:           fonts-config
Version:        20201112+git.80b5b89
Release:        0
Summary:        Configure fonts for X Windows and other applications
# MIT for infinality
License:        GPL-2.0-or-later AND MIT
Group:          System/X11/Fonts
URL:            https://github.com/openSUSE/fonts-config
Source:         %{name}-ng-%{version}.tar.xz
BuildRequires:  fontconfig
BuildRequires:  fontpackages-devel
BuildRequires:  go
Requires:       fontconfig
Requires(pre):  %fillup_prereq
Recommends:     mkfontdir
Recommends:     mkfontscale
%reconfigure_fonts_prereq

%description
Configure fonts for X Windows and other applications.

fonts-config is usually called automatically when a package containing
fonts is installed, upgraded or removed. But it can also be executed
directly, which is mainly useful to debug it (use the --debug flag).

%prep
%setup -q -n %{name}-ng-%{version}

%build
export GOPATH=%{_builddir}/go
mkdir -p %{_builddir}/go/src/github.com/marguerite
ln -s %{_builddir}/%{name}-ng-%{version} %{_builddir}/go/src/github.com/marguerite/%{name}-ng
pushd %{_builddir}/go/src/github.com/marguerite/%{name}-ng
export GO111MODULES=on
%make_build
popd

%install
pushd %{_builddir}/go/src/github.com/marguerite/%{name}-ng
export GO111MODULES=on
%make_install
popd

%post
%{fillup_only -n fonts-config}
%reconfigure_fonts_post -c
exit 0

%postun
%reconfigure_fonts_postun -c

%posttrans
%reconfigure_fonts_posttrans

%files
%license LICENSE
%{files_fontsconf_availdir}
%{_sbindir}/fonts-config
%{_datadir}/fonts-config/
%{_fillupdir}/sysconfig.fonts-config
%{_fontsconfavaildir}/*.conf
%config %{_fontsconfddir}/*.conf

%changelog
openSUSE Build Service is sponsored by