move dependency generator setup from ghc_package_devel to ghc_lib_install
also backport bootstrapping improvements: - do not setup ghc-deps.sh when ghc_bootstrapping - add ghc_test build config - drop redundant defattr from filelists - ghc_bootstrap is now a macro providing bootstrap config - add ghc_check_bootstrap
This commit is contained in:
parent
90641e0ba0
commit
1347477ddf
@ -5,8 +5,22 @@
|
||||
%cabal [ -x Setup ] || ghc --make %{!?ghc_without_shared:%{!?ghc_without_dynamic:-dynamic}} Setup\
|
||||
./Setup
|
||||
|
||||
# check ghc version was rebuilt against self
|
||||
%ghc_check_bootstrap\
|
||||
if [ ! "$(ghc --info | grep \\"Booter\\ version\\",\\"%{ghc_version}\\")" ]; then\
|
||||
echo "Warning: this ghc build is not self-bootstrapped."\
|
||||
%if %{undefined ghc_bootstrapping}\
|
||||
echo "The ghc package should be rebuilt against its current version before\
|
||||
proceeding, to avoid dependency ABI breakage from a future ghc rebuild."\
|
||||
echo "To override set ghc_bootstrapping."\
|
||||
echo "Aborting."\
|
||||
exit 1\
|
||||
%endif\
|
||||
fi
|
||||
|
||||
# configure
|
||||
%cabal_configure\
|
||||
%ghc_check_bootstrap\
|
||||
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_shared:--enable-shared} %{?cabal_configure_options}
|
||||
|
||||
# install
|
||||
@ -29,13 +43,11 @@
|
||||
%define docdir %{ghclibdocdir}/%{pkgnamever}\
|
||||
rm -f %{basepkg}.files %{basepkg}-devel.files\
|
||||
%if %{undefined ghc_without_shared}\
|
||||
echo "%defattr(-,root,root,-)" > %{basepkg}.files\
|
||||
if [ -d "%{buildroot}%{pkgdir}" ]; then\
|
||||
echo "%dir %{pkgdir}" >> %{basepkg}.files\
|
||||
echo "%attr(755,root,root) %{pkgdir}/libHS%{pkgnamever}-ghc%{ghc_version}.so" >> %{basepkg}.files\
|
||||
fi\
|
||||
%endif\
|
||||
echo "%defattr(-,root,root,-)" > %{basepkg}-devel.files\
|
||||
%if 0%{!?1:1}\
|
||||
if [ -d "%{buildroot}%{_docdir}/%{name}-%{version}" ]; then\
|
||||
echo "%{_docdir}/%{name}-%{version}" >> %{basepkg}%{?ghc_without_shared:-devel}.files\
|
||||
@ -87,7 +99,6 @@ Requires: ghc-%{?pkg_name}%{!?pkg_name:%{pkgname}} = %{?pkgver}%{!?pkgver:
|
||||
%define basepkg ghc-%{pkgname}\
|
||||
%if %{undefined ghc_without_shared}\
|
||||
%files -n %{basepkg} -f %{basepkg}.files\
|
||||
%defattr(-,root,root,-)\
|
||||
%endif\
|
||||
\
|
||||
%ghc_package_devel\
|
||||
@ -127,8 +138,6 @@ This package provides the shared library.\
|
||||
%define pkgver %{?2}%{!?2:%{version}}\
|
||||
%define pkgnamever %{pkgname}-%{pkgver}\
|
||||
%define basepkg ghc-%{pkgname}\
|
||||
%global _use_internal_dependency_generator 0\
|
||||
%global __find_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}\
|
||||
%package -n %{basepkg}-devel\
|
||||
Summary: %{?common_summary}%{!?common_summary:Haskell %{pkgname} library} development files\
|
||||
Group: Development/Libraries\
|
||||
@ -159,7 +168,6 @@ This package contains the development files.\
|
||||
%ghc_reindex_haddock\
|
||||
\
|
||||
%files -n %{basepkg}-devel -f %{basepkg}-devel.files\
|
||||
%defattr(-,root,root,-)\
|
||||
%{nil}
|
||||
|
||||
# ghc_strip_dynlinked
|
||||
@ -191,6 +199,10 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \
|
||||
|
||||
# ghc_lib_install [name] [version]
|
||||
%ghc_lib_install()\
|
||||
%if %{undefined ghc_bootstrapping}\
|
||||
%global _use_internal_dependency_generator 0\
|
||||
%global __find_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}\
|
||||
%endif\
|
||||
%{?1:cd %1-%2}\
|
||||
%cabal_install\
|
||||
%cabal_pkg_conf\
|
||||
@ -198,3 +210,19 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \
|
||||
%ghc_gen_filelists\
|
||||
%{!?1:%ghc_strip_dynlinked}\
|
||||
%{nil}
|
||||
|
||||
# skip shared and prof libs, documentation, and testsuite
|
||||
# - without_hscolour needs to be set locally in the spec file
|
||||
%ghc_bootstrap\
|
||||
%global ghc_without_shared 1\
|
||||
%global ghc_without_dynamic 1\
|
||||
%global without_prof 1\
|
||||
%global without_haddock 1\
|
||||
%global without_manual 1
|
||||
|
||||
# skip prof libs, and documentation
|
||||
# - without_hscolour needs to be set locally in the spec file
|
||||
%ghc_test\
|
||||
%global without_prof 1\
|
||||
%global without_haddock 1\
|
||||
%global without_manual 1
|
||||
|
@ -3,7 +3,7 @@
|
||||
%global macros_file %{_sysconfdir}/rpm/macros.ghc
|
||||
|
||||
Name: ghc-rpm-macros
|
||||
Version: 0.10.58
|
||||
Version: 0.10.59
|
||||
Release: 1%{?dist}
|
||||
Summary: Macros for building packages for GHC
|
||||
|
||||
@ -60,6 +60,14 @@ EOF
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Sep 13 2011 Jens Petersen <petersen@redhat.com> - 0.10.59-1
|
||||
- do not setup ghc-deps.sh when ghc_bootstrapping
|
||||
- add ghc_test build config
|
||||
- drop redundant defattr from filelists
|
||||
- move dependency generator setup from ghc_package_devel to ghc_lib_install
|
||||
- ghc_bootstrap is now a macro providing bootstrap config
|
||||
- add ghc_check_bootstrap
|
||||
|
||||
* Mon Jun 27 2011 Jens Petersen <petersen@redhat.com> - 0.10.58-1
|
||||
- add requires for redhat-rpm-config for ghc_arches
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user