- use gen_contents_index to re-index haddock

- add %%pkg_docdir to cabal_configure
- requires(post) ghc for haddock for doc
- improve doc file lists
- no longer need to create ghost package.conf.old
- remove or rename alternatives files more consistently
epel9
Jens Petersen 17 years ago
parent 4b8e6f699e
commit c7ae1a2bd5

@ -1,2 +1,2 @@
ghc-6.8.3-src-extralibs.tar.bz2 ghc-6.10.0.20081007-src.tar.bz2
ghc-6.8.3-src.tar.bz2 ghc-6.10.0.20081007-src-extralibs.tar.bz2

@ -1,7 +1,7 @@
%cabal %{_bindir}/runhaskell Setup %cabal %{_bindir}/runhaskell Setup
%cabal_configure \ %cabal_configure \
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{_docdir}/%{hsc_name}/libraries/%{pkg_name} --haddockdir=%{_docdir}/%{hsc_name}/libraries/%{pkg_name} --libsubdir='$compiler/$pkgid' %cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{pkg_docdir} --haddockdir=%{pkg_docdir} --libsubdir='$compiler/$pkgid'
%cabal_build \ %cabal_build \
%cabal build \ %cabal build \
@ -56,10 +56,5 @@ install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{pkg_libdir} \
%{nil} %{nil}
%ghc_reindex_haddock \ %ghc_reindex_haddock \
if [ -f %{_bindir}/haddock -a -d %{_docdir}/%{hsc_name}/libraries ]; then \ ( cd %{_docdir}/ghc/libraries && ./gen_contents_index ) || : \
cd %{_docdir}/%{hsc_name}/libraries && \
haddock --gen-index --gen-contents -o . -t 'Haskell Hierarchical Libraries' \\\
$(find . \\( \\( -path ./ghc -o -path ./ghc-prim \\) -prune \\) -o \\( -name '*.haddock' -print \\) \\\
| sed 's!.*/\\([^/]*\\).haddock!--read-interface=\\1,\\0!'); \
fi \
%{nil} %{nil}

@ -16,7 +16,7 @@
Name: ghc Name: ghc
Version: 6.10.0.20081007 Version: 6.10.0.20081007
Release: 6%{?dist} Release: 7%{?dist}
Summary: Glasgow Haskell Compilation system Summary: Glasgow Haskell Compilation system
# See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239713 # See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239713
ExcludeArch: alpha ppc64 ExcludeArch: alpha ppc64
@ -65,6 +65,8 @@ needed.
Summary: Documentation for GHC Summary: Documentation for GHC
Group: Development/Languages Group: Development/Languages
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
# for haddock
Requires(post): %{name} = %{version}-%{release}
%description doc %description doc
Preformatted documentation for the Glorious Glasgow Haskell Preformatted documentation for the Glorious Glasgow Haskell
@ -126,7 +128,8 @@ cp -p %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc
SRC_TOP=$PWD SRC_TOP=$PWD
rm -f rpm-*-filelist rpm-*.files rm -f rpm-*-filelist rpm-*.files
( cd $RPM_BUILD_ROOT ( cd $RPM_BUILD_ROOT
find .%{_libdir}/%{name}-%{version} \( -type d -fprintf $SRC_TOP/rpm-dir.files "%%%%dir %%p\n" \) -o \( -type f \( -name '*.p_hi' -o -name '*_p.a' \) -fprint $SRC_TOP/rpm-prof.files \) -o \( -not -name 'package.conf' -fprint $SRC_TOP/rpm-lib.files \) find .%{_libdir}/%{name}-%{version} \( -type d -fprintf $SRC_TOP/rpm-dir.files "%%%%dir %%p\n" \) -o \( -type f \( -name '*.p_hi' -o -name '*_p.a' \) -fprint $SRC_TOP/rpm-prof.files \) -o \( -not -name 'package.conf*' -fprint $SRC_TOP/rpm-lib.files \)
find .%{_docdir}/%{name}/* -type d ! -name libraries > $SRC_TOP/rpm-doc-dir.files
) )
# make paths absolute (filter "./usr" to "/usr") # make paths absolute (filter "./usr" to "/usr")
@ -137,19 +140,21 @@ cat rpm-dir.files rpm-lib.files > rpm-base-filelist
cat rpm-dir.files rpm-prof.files > rpm-prof-filelist cat rpm-dir.files rpm-prof.files > rpm-prof-filelist
%endif %endif
# create package.conf.old
touch $RPM_BUILD_ROOT%{_libdir}/ghc-%{version}/package.conf.old
# these are handled as alternatives # these are handled as alternatives
mv ${RPM_BUILD_ROOT}%{_bindir}/hsc2hs{,-ghc} for i in hsc2hs runhaskell; do
rm ${RPM_BUILD_ROOT}%{_bindir}/runhaskell if [ -x ${RPM_BUILD_ROOT}%{_bindir}/$i-ghc ]; then
rm ${RPM_BUILD_ROOT}%{_bindir}/$i
else
mv ${RPM_BUILD_ROOT}%{_bindir}/$i{,-ghc}
fi
done
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%post %post
semanage fcontext -a -t unconfined_execmem_exec_t %{_libdir}/ghc-%{version}/ghc >/dev/null 2>&1 || : semanage fcontext -a -t unconfined_execmem_exec_t %{_libdir}/ghc-%{version}/ghc >/dev/null 2>&1 || :
restorecon %{_libdir}/ghc-%{version}/ghc >/dev/null restorecon %{_libdir}/ghc-%{version}/ghc
# Alas, GHC, Hugs, and nhc all come with different set of tools in # Alas, GHC, Hugs, and nhc all come with different set of tools in
# addition to a runFOO: # addition to a runFOO:
@ -170,11 +175,7 @@ update-alternatives --install %{_bindir}/hsc2hs hsc2hs \
%post doc %post doc
cd %{_docdir}/ghc/libraries && \ ( cd %{_docdir}/ghc/libraries && ./gen_contents_index ) || :
haddock --gen-index --gen-contents -o . -t 'Haskell Hierarchical Libraries' \
$(find . \( \( -path ./ghc -o -path ./ghc-prim \) -prune \) -o \( -name '*.haddock' -print \) \
| sed 's!.*/\([^/]*\).haddock!--read-interface=\1,\0!')
%preun %preun
if test "$1" = 0; then if test "$1" = 0; then
@ -200,9 +201,12 @@ fi
%if %{build_doc} %if %{build_doc}
%files doc %files doc -f rpm-doc-dir.files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_docdir}/%{name} %dir %{_docdir}/%{name}
%{_docdir}/%{name}/index.html
%{_docdir}/%{name}/libraries/gen_contents_index
%dir %{_docdir}/%{name}/libraries
%ghost %{_docdir}/%{name}/libraries/doc-index.html %ghost %{_docdir}/%{name}/libraries/doc-index.html
%ghost %{_docdir}/%{name}/libraries/haddock.css %ghost %{_docdir}/%{name}/libraries/haddock.css
%ghost %{_docdir}/%{name}/libraries/haddock-util.js %ghost %{_docdir}/%{name}/libraries/haddock-util.js
@ -214,6 +218,14 @@ fi
%changelog %changelog
* Thu Oct 23 2008 Jens Petersen <petersen@redhat.com> - 6.10.0.20081007-7
- use gen_contents_index to re-index haddock
- add %%pkg_docdir to cabal_configure
- requires(post) ghc for haddock for doc
- improve doc file lists
- no longer need to create ghost package.conf.old
- remove or rename alternatives files more consistently
* Tue Oct 14 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-6 * Tue Oct 14 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.10.0.20081007-6
- Update macros to install html and haddock bits in the right places - Update macros to install html and haddock bits in the right places
@ -241,7 +253,7 @@ fi
- Drop unneeded haddock patch - Drop unneeded haddock patch
- Rename hsc2hs to hsc2hs-ghc so the alternatives symlink to it will work - Rename hsc2hs to hsc2hs-ghc so the alternatives symlink to it will work
* Wed Sep 24 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-5.fc10 * Wed Sep 24 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-5
- bring back including haddock-generated lib docs, now under docdir/ghc - bring back including haddock-generated lib docs, now under docdir/ghc
- fix macros.ghc filepath (#460304) - fix macros.ghc filepath (#460304)
- spec file cleanups: - spec file cleanups:
@ -251,9 +263,9 @@ fi
- setup docs building in build.mk - setup docs building in build.mk
- no longer need to remove network/include/Typeable.h - no longer need to remove network/include/Typeable.h
- install binaries under libdir not libexec - install binaries under libdir not libexec
- remove hsc2hs and runhaskell binaries since are alternatives - remove hsc2hs and runhaskell binaries since they are alternatives
* Wed Sep 17 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-4.fc10 * Wed Sep 17 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-4
- add macros.ghc for new Haskell Packaging Guidelines (#460304) - add macros.ghc for new Haskell Packaging Guidelines (#460304)
* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.3-3 * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 6.8.3-3

Loading…
Cancel
Save