|
|
|
@ -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}\
|
|
|
|
|