%ghc_lib_subpackage now takes name-version processed with lua

epel9
Jens Petersen 8 years ago
parent 52dc56db34
commit 8539a717fc

@ -10,7 +10,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.6.6
Version: 1.6.7
Release: 1%{?dist}
Summary: RPM macros for building packages for GHC
@ -135,6 +135,9 @@ EOF
%changelog
* Thu Sep 1 2016 Jens Petersen <petersen@redhat.com> - 1.6.7-1
- ghc_lib_subpackage now takes name-version processed with lua
* Fri Aug 26 2016 Jens Petersen <petersen@redhat.com> - 1.6.6-1
- ghc_gen_filelists: support packages with more than one license file
- move licenses from docdir to licensedir instead of removing,

@ -1,9 +1,16 @@
# RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*-
# ghc_lib_subpackage [-c cdepslist] [-l licensetag] [-x] [name] [version]
# ghc_lib_subpackage [-c cdepslist] [-l licensetag] [-x] [name-version]
%ghc_lib_subpackage(c:l:x)\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
%define pkgname %{lua:\
local pv = rpm.expand("%1")\
local _, _, name = string.find(pv, "^([%a-]+)-")\
print(name)\
}\
%define pkgver %{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