From 051b51f30f42de12c07a0a96bf607328554df15f Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 16 May 2022 18:28:41 +0800 Subject: [PATCH] define ghc_prefix (used for ghcX.Y packaging) --- ghc-rpm-macros.spec | 7 +++++-- macros.ghc | 7 +++++-- macros.ghc-extra | 7 +++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 4e372ff..81c73be 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -7,8 +7,8 @@ %endif Name: ghc-rpm-macros -Version: 2.3.15 -Release: 2%{?dist} +Version: 2.3.16 +Release: 1%{?dist} Summary: RPM macros for building Haskell packages for GHC License: GPLv3+ @@ -183,6 +183,9 @@ EOF %changelog +* Mon May 16 2022 Jens Petersen - 2.3.16-1 +- define ghc_prefix (used for ghcX.Y packaging) + * Wed Apr 27 2022 Jens Petersen - 2.3.15-2 - drop ghc-compiler requires to allow using ghcX.Y-compiler-default diff --git a/macros.ghc b/macros.ghc index b8be433..4f8c7cd 100644 --- a/macros.ghc +++ b/macros.ghc @@ -46,8 +46,11 @@ fi\ # no _pkgdocdir in EPEL <= 7 %ghc_pkgdocdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} +# library package prefix +%ghc_prefix %{?ghc_name}%{!?ghc_name:ghc} + # root dir for ghc docs (used by ghc.spec) -%ghc_html_dir %{_docdir}/%{?ghc_name}%{!?ghc_name:ghc}/html +%ghc_html_dir %{_docdir}/%{ghc_prefix}/html # deprecates %ghcdocbasedir %ghc_html_dir @@ -76,7 +79,7 @@ fi\ %define pkgname %{?1}%{!?1:%{pkg_name}}\ %define pkgver %{?2}%{!?2:%{version}}\ %define pkgnamever %{pkgname}-%{pkgver}\ -%define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\ +%define basepkg %{ghc_prefix}-%{pkgname}\ if [ -z "$(ls %{buildroot}%{ghcliblib}/package.conf.d/%{pkgnamever}*.conf)" ]; then\ echo '%{buildroot}%{ghcliblib}/package.conf.d/%{pkgnamever}*.conf not found'\ exit 1\ diff --git a/macros.ghc-extra b/macros.ghc-extra index 2983eeb..ae447d7 100644 --- a/macros.ghc-extra +++ b/macros.ghc-extra @@ -14,7 +14,6 @@ print(string.sub(pv, string.find(pv, "[%d.]+$")))\ }}\ %global ghc_subpackages_list %{?ghc_subpackages_list} %{pkgname}-%{pkgver}\ %{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\ -%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\ %define basepkg %{ghc_prefix}-%{pkgname}\ %if 0%{!-m:1}\ %package -n %{basepkg}\ @@ -52,8 +51,8 @@ Summary: Haskell %{pkgname} library documentation\ %{?1:Version: %{pkgver}}\ %{-l:License: %{-l*}}\ BuildArch: noarch\ -Requires: ghc-filesystem\ -Supplements: (%{basepkg}-devel and ghc-doc)\ +Requires: %{ghc_prefix}-filesystem\ +Supplements: (%{basepkg}-devel and %{ghc_prefix}-doc)\ \ %description -n %{basepkg}-doc\ This package provides the Haskell %{pkgname} library documentation.\ @@ -65,7 +64,7 @@ Summary: Haskell %{pkgname} profiling library\ %{?1:Version: %{pkgver}}\ %{-l:License: %{-l*}}\ Requires: %{ghc_prefix}-%{pkgname}-devel%{?_isa} = %{pkgver}-%{release}\ -Supplements: (%{basepkg}-devel and ghc-prof)\ +Supplements: (%{basepkg}-devel and %{ghc_prefix}-prof)\ \ %description -n %{basepkg}-prof\ This package provides the Haskell %{pkgname} profiling library.\