2013-04-23 09:12:25 +00:00
|
|
|
# RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*-
|
|
|
|
|
2017-02-13 10:25:12 +00:00
|
|
|
# ghc_lib_subpackage [-c cdepslist] [-d] [-l licensetag] [-x] [name-version]
|
2016-10-26 08:49:50 +00:00
|
|
|
# for backward compat also support: ghc_lib_subpackage name version
|
2017-02-13 10:25:12 +00:00
|
|
|
%ghc_lib_subpackage(c:dl:x)\
|
2016-10-26 08:49:50 +00:00
|
|
|
%define pkgname %{?2:%{1}}%{!?2:%{lua:\
|
2016-09-01 05:59:29 +00:00
|
|
|
local pv = rpm.expand("%1")\
|
2017-02-23 11:58:38 +00:00
|
|
|
local _, _, name = string.find(pv, "^([%a%d-]+)-")\
|
2016-09-01 05:59:29 +00:00
|
|
|
print(name)\
|
2016-10-26 08:49:50 +00:00
|
|
|
}}\
|
|
|
|
%define pkgver %{?2}%{!?2:%{lua:\
|
2016-09-01 05:59:29 +00:00
|
|
|
local pv = rpm.expand("%1")\
|
|
|
|
print(string.sub(pv, string.find(pv, "[%d.]+$")))\
|
2016-10-26 08:49:50 +00:00
|
|
|
}}\
|
2014-08-20 13:09:31 +00:00
|
|
|
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\
|
2015-03-08 05:30:35 +00:00
|
|
|
%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\
|
2015-03-07 13:38:07 +00:00
|
|
|
%define basepkg %{ghc_prefix}-%{pkgname}\
|
2013-04-23 09:12:25 +00:00
|
|
|
%package -n %{basepkg}\
|
2013-06-17 04:54:55 +00:00
|
|
|
Summary: Haskell %{pkgname} library\
|
2013-04-23 09:12:25 +00:00
|
|
|
%{?1:Version: %{pkgver}}\
|
|
|
|
%{-l:License: %{-l*}}\
|
2014-04-30 03:44:15 +00:00
|
|
|
Url: http://hackage.haskell.org/package/%{pkgname}\
|
2015-03-07 13:38:07 +00:00
|
|
|
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(%{ghc_prefix}-[^, ]*\\)-devel/\\1/g")}\
|
2013-04-23 09:12:25 +00:00
|
|
|
\
|
2013-06-17 04:47:03 +00:00
|
|
|
%description -n %{basepkg}\
|
2013-06-17 04:54:55 +00:00
|
|
|
This package provides the Haskell %{pkgname} library.\
|
2013-04-23 09:12:25 +00:00
|
|
|
\
|
|
|
|
%package -n %{basepkg}-devel\
|
2013-06-17 04:54:55 +00:00
|
|
|
Summary: Haskell %{pkgname} library development files\
|
2013-04-23 09:12:25 +00:00
|
|
|
%{?1:Version: %{pkgver}}\
|
|
|
|
%{-l:License: %{-l*}}\
|
2019-07-15 16:34:14 +00:00
|
|
|
Provides: %{basepkg}-static = %{pkgver}-%{release}\
|
|
|
|
Requires: %{ghc_prefix}-compiler = %{ghc_version}%{?ghc_version_override:-%{release}}\
|
2015-03-07 13:38:07 +00:00
|
|
|
Requires: %{ghc_prefix}-%{pkgname}%{?_isa} = %{pkgver}-%{release}\
|
2013-04-23 09:12:25 +00:00
|
|
|
%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}\
|
|
|
|
%{-c:Requires: %{-c*}}\
|
|
|
|
%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
|
2013-06-17 04:47:03 +00:00
|
|
|
\
|
2013-04-23 09:12:25 +00:00
|
|
|
%description -n %{basepkg}-devel\
|
2013-06-17 04:54:55 +00:00
|
|
|
This package provides the Haskell %{pkgname} library development files.\
|
2013-04-23 09:12:25 +00:00
|
|
|
\
|
2019-07-16 16:09:25 +00:00
|
|
|
%if %{with haddock}\
|
2019-07-15 08:40:09 +00:00
|
|
|
%package -n %{basepkg}-doc\
|
|
|
|
Summary: Haskell %{pkgname} library documentation\
|
|
|
|
%{?1:Version: %{pkgver}}\
|
|
|
|
%{-l:License: %{-l*}}\
|
|
|
|
Supplements: (%{basepkg}-devel and ghc-doc)\
|
|
|
|
\
|
|
|
|
%description -n %{basepkg}-doc\
|
|
|
|
This package provides the Haskell %{pkgname} library documentation.\
|
|
|
|
%endif\
|
|
|
|
\
|
2019-07-16 16:09:25 +00:00
|
|
|
%if %{with ghc_prof}\
|
2019-07-15 08:40:09 +00:00
|
|
|
%package -n %{basepkg}-prof\
|
|
|
|
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)\
|
|
|
|
\
|
|
|
|
%description -n %{basepkg}-prof\
|
|
|
|
This package provides the Haskell %{pkgname} profiling library.\
|
2016-06-03 04:16:35 +00:00
|
|
|
%endif\
|
2019-07-15 08:40:09 +00:00
|
|
|
\
|
|
|
|
%files -n %{basepkg} -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}.files\
|
|
|
|
%{_ghclicensedir}/%{basepkg}\
|
2013-06-17 04:54:55 +00:00
|
|
|
\
|
2017-02-13 10:25:12 +00:00
|
|
|
%files -n %{basepkg}-devel -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-devel.files\
|
2019-07-15 08:40:09 +00:00
|
|
|
\
|
2019-07-16 16:09:25 +00:00
|
|
|
%if %{with haddock}\
|
2019-07-16 16:05:34 +00:00
|
|
|
%files -n %{basepkg}-doc -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-doc.files\
|
2019-07-15 08:40:09 +00:00
|
|
|
%endif\
|
|
|
|
\
|
2019-07-16 16:09:25 +00:00
|
|
|
%if %{with ghc_prof}\
|
2019-07-15 08:40:09 +00:00
|
|
|
%files -n %{basepkg}-prof -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-prof.files\
|
2016-06-03 04:16:35 +00:00
|
|
|
%endif\
|
2013-04-23 09:12:25 +00:00
|
|
|
%{nil}
|
2016-08-17 08:34:46 +00:00
|
|
|
|
2016-10-12 03:02:19 +00:00
|
|
|
# ghc_libs_build [name-version] ...
|
2016-08-18 06:25:17 +00:00
|
|
|
%ghc_libs_build()\
|
2016-08-17 08:34:46 +00:00
|
|
|
HOME=$PWD\
|
2017-02-10 03:50:02 +00:00
|
|
|
%global ghc_subpackaging 1\
|
2016-08-17 08:34:46 +00:00
|
|
|
for i in %*; do\
|
2016-08-17 09:16:52 +00:00
|
|
|
name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\
|
|
|
|
ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
|
2016-08-17 08:34:46 +00:00
|
|
|
cd $name-$ver\
|
|
|
|
case $name in\
|
|
|
|
haskell-platform)\
|
|
|
|
%ghc_lib_build_without_haddock $name $ver\
|
|
|
|
;;\
|
|
|
|
*)\
|
|
|
|
%ghc_lib_build $name $ver\
|
|
|
|
./Setup register --inplace\
|
|
|
|
;;\
|
|
|
|
esac\
|
|
|
|
cd ..\
|
|
|
|
done\
|
|
|
|
%{nil}
|
|
|
|
|
2016-10-12 03:02:19 +00:00
|
|
|
# ghc_libs_install [name-version] ...
|
2016-08-18 06:25:17 +00:00
|
|
|
%ghc_libs_install()\
|
2016-08-17 08:34:46 +00:00
|
|
|
HOME=$PWD\
|
2016-09-27 05:30:59 +00:00
|
|
|
args="%*"\
|
|
|
|
for i in $args; do\
|
|
|
|
cd $i\
|
2016-08-17 09:16:52 +00:00
|
|
|
name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\
|
|
|
|
ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
|
2016-08-17 08:34:46 +00:00
|
|
|
%ghc_lib_install $name $ver\
|
|
|
|
cd ..\
|
|
|
|
done\
|
2016-09-27 05:30:59 +00:00
|
|
|
%ghc_fix_rpath $args\
|
2016-08-17 08:34:46 +00:00
|
|
|
%{nil}
|