make ghc_lib_subpackage backward compatible with older 2 arg form

epel9
Jens Petersen 8 years ago
parent 9c211a6a35
commit ebdd0063dd

@ -10,8 +10,8 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.6.9
Release: 8%{?dist}
Version: 1.6.10
Release: 1%{?dist}
Summary: RPM macros for building Haskell packages for GHC
License: GPLv3+
@ -146,6 +146,9 @@ EOF
%changelog
* Wed Oct 26 2016 Jens Petersen <petersen@redhat.com> - 1.6.10-1
- make ghc_lib_subpackage backward compatible with older 2 args form
* Mon Oct 17 2016 Jens Petersen <petersen@redhat.com> - 1.6.9-8
- disable dynlinking on armv7hl too

@ -1,16 +1,17 @@
# RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*-
# ghc_lib_subpackage [-c cdepslist] [-l licensetag] [-x] [name-version]
# for backward compat also support: ghc_lib_subpackage name version
%ghc_lib_subpackage(c:l:x)\
%define pkgname %{lua:\
%define pkgname %{?2:%{1}}%{!?2:%{lua:\
local pv = rpm.expand("%1")\
local _, _, name = string.find(pv, "^([%a-]+)-")\
print(name)\
}\
%define pkgver %{lua:\
}}\
%define pkgver %{?2}%{!?2:%{lua:\
local pv = rpm.expand("%1")\
print(string.sub(pv, string.find(pv, "[%d.]+$")))\
}\
}}\
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\
%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\
%define basepkg %{ghc_prefix}-%{pkgname}\

Loading…
Cancel
Save