From b6ba7540fe261409c12fce2fa59cd00c95e2c994 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 26 Jul 2022 18:33:57 +0800 Subject: [PATCH] %ghc_gen_filelists: check pkg licensedir exists prevents warning errors: eg for ghc9.4: ls: cannot access '~/fedora/haskell/ghc9.4/BUILDROOT/ghc9.4-9.4.0.20220721-7.fc37.x86_64/usr/share/licenses/ghc9.4-Cabal': No such file or directory etc, though not actually harmful --- ghc-rpm-macros.spec | 7 +++++-- macros.ghc | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index c3c93f9..9cc011a 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -7,8 +7,8 @@ %endif Name: ghc-rpm-macros -Version: 2.4.3 -Release: 2%{?dist} +Version: 2.4.4 +Release: 1%{?dist} Summary: RPM macros for building Haskell packages for GHC License: GPLv3+ @@ -190,6 +190,9 @@ EOF %changelog +* Tue Jul 26 2022 Jens Petersen - 2.4.4-1 +- ghc_gen_filelists: check pkg licensedir exists + * Thu Jul 21 2022 Fedora Release Engineering - 2.4.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/macros.ghc b/macros.ghc index be19641..7503666 100644 --- a/macros.ghc +++ b/macros.ghc @@ -90,9 +90,11 @@ fi\ rm -f %{basepkg}.files %{basepkg}-doc.files\ touch %{basepkg}.files %{basepkg}-doc.files\ %if 0%{?1:1}\ +if [ -d "%{buildroot}%{_ghclicensedir}/%{basepkg}" ]; then\ for i in $(ls %{buildroot}%{_ghclicensedir}/%{basepkg}); do\ echo "%%license %{pkgnamever}/$i" >> %{basepkg}.files\ done\ +fi\ %endif\ for i in %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibplatform}}/libHS%{pkgnamever}-*ghc%{ghc_version}.so; do\ if [ -x "$i" ]; then\