extra macros cleanup: merge all remaining macros into %ghc_lib_subpackage

epel9
Jens Petersen 12 years ago
parent 80fec1cbd1
commit ecaa01415c

@ -1,88 +1,31 @@
# RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*- # RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*-
%ghc_shared_files\ # ghc_lib_subpackage [-c cdepslist] [-l licensetag] [-x] [name] [version]
%files -n %{basepkg} -f %{basepkg}.files\ %ghc_lib_subpackage(c:l:x)\
%{?base_doc_files:%doc %base_doc_files}\
%{nil}
# ghc_lib_package [-c cdepslist]
%ghc_lib_package(c:)\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define basepkg ghc-%{pkgname}\
%ghc_shared_files\
\
%ghc_package_devel\
%{nil}
# ghc_package [-l licensetag] [name] [version]
%ghc_package(l:)\
%define pkgname %{?1}%{!?1:%{pkg_name}}\ %define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\ %define pkgver %{?2}%{!?2:%{version}}\
%define pkgnamever %{pkgname}-%{pkgver}\
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgnamever}}}\
%define basepkg ghc-%{pkgname}\ %define basepkg ghc-%{pkgname}\
%package -n %{basepkg}\ %package -n %{basepkg}\
Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library}\ Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library}\
%{?1:Version: %{pkgver}}\ %{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\ %{-l:License: %{-l*}}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")} %{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")}
# ghc_description [name] [version]
%ghc_description()\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define basepkg ghc-%{pkgname}\
%description -n %{basepkg}\
%{?common_description}%{!?common_description:Haskell %{pkgname} library.}
# 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 pkgnamever %{pkgname}-%{pkgver}\
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgnamever}}}\
%define basepkg ghc-%{pkgname}\
%ghc_package\
\ \
%ghc_description\ %description -n %{basepkg}\
This package provides the Haskell %{pkgname} library.
\ \
%ghc_lib_package\ %files -n %{basepkg} -f %{basepkg}.files\
%{nil} %{?base_doc_files:%doc %base_doc_files}\
%ghc_pkg_recache %{_bindir}/ghc-pkg recache --no-user-package-conf || :
# (deprecated) for docs post and postun
%ghc_reindex_haddock :
%ghc_devel_files\
%files -n %{basepkg}-devel -f %{basepkg}-devel.files\
%{?devel_doc_files:%doc %devel_doc_files}\
%{nil}
%ghc_files()\
%{?1:%define base_doc_files %*}\
%define basepkg ghc-%{pkg_name}\
%ghc_shared_files\
\ \
%ghc_devel_files\
%{nil}
# devel pkg basic requires
%ghc_devel_requires Requires: ghc-compiler = %{ghc_version}\
Requires(post): ghc-compiler = %{ghc_version}\
Requires(postun): ghc-compiler = %{ghc_version}\
%if 0%{!?-m:1}\
Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:%{version}}-%{release}\
%endif
# ghc_devel_package [-c cdepslist] [-l licensetag] [-m] [name] [version]
# -m : meta-package
%ghc_devel_package(c:l:m)\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
%define basepkg ghc-%{pkgname}\
%package -n %{basepkg}-devel\ %package -n %{basepkg}-devel\
Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library} development files\ Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library} development files\
%{?1:Version: %{pkgver}}\ %{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\ %{-l:License: %{-l*}}\
%{?ghc_devel_requires}\ Requires(post): ghc-compiler = %{ghc_version}\
Requires(postun): ghc-compiler = %{ghc_version}\
Requires: ghc-%{pkgname} = %{pkgver}-%{release}\
%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}\ %{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}\
%{-c:Requires: %{-c*}}\ %{-c:Requires: %{-c*}}\
%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\ %{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
@ -92,36 +35,17 @@ Provides: %{basepkg}-doc = %{pkgver}-%{release}\
Obsoletes: %{basepkg}-prof < %{pkgver}-%{release}\ Obsoletes: %{basepkg}-prof < %{pkgver}-%{release}\
%if %{undefined without_prof}\ %if %{undefined without_prof}\
Provides: %{basepkg}-prof = %{pkgver}-%{release}\ Provides: %{basepkg}-prof = %{pkgver}-%{release}\
%endif %endif\
\
# ghc_devel_description
%ghc_devel_description()\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define basepkg ghc-%{pkgname}\
%description -n %{basepkg}-devel\ %description -n %{basepkg}-devel\
%{?common_description}%{!?common_description:Haskell %{pkgname} library.}\ This package provides the Haskell %{pkgname} library development files.
\ \
This package contains the development files.
# ghc_devel_post_postun
%ghc_devel_post_postun()\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define basepkg ghc-%{pkgname}\
%post -n %{basepkg}-devel\ %post -n %{basepkg}-devel\
%ghc_pkg_recache\ %ghc_pkg_recache\
\ \
%postun -n %{basepkg}-devel\ %postun -n %{basepkg}-devel\
%ghc_pkg_recache %ghc_pkg_recache\
# ghc_package_devel [-c cdepslist] [-l licensetag] [name] [version]
%ghc_package_devel(c:h:l:)\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define basepkg ghc-%{pkgname}\
%ghc_devel_package\
\
%ghc_devel_description\
\
%ghc_devel_post_postun\
\ \
%ghc_devel_files\ %files -n %{basepkg}-devel -f %{basepkg}-devel.files\
%{?devel_doc_files:%doc %devel_doc_files}\
%{nil} %{nil}

Loading…
Cancel
Save