From b2f2d6c05a7cbd9b16c943f52fd56406e3a32131 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 29 Oct 2012 20:14:11 +0900 Subject: [PATCH] drop doc re-indexing cronjob and add a rpm-state dir for posttrans scripts (#870694) --- ghc-doc-index.cron | 41 ------------------------- ghc-gen_contents_index-cron-batch.patch | 20 ------------ ghc.spec | 17 +++++----- 3 files changed, 7 insertions(+), 71 deletions(-) delete mode 100755 ghc-doc-index.cron delete mode 100644 ghc-gen_contents_index-cron-batch.patch diff --git a/ghc-doc-index.cron b/ghc-doc-index.cron deleted file mode 100755 index 9cf2888..0000000 --- a/ghc-doc-index.cron +++ /dev/null @@ -1,41 +0,0 @@ -#! /bin/bash - -if [ -e /etc/sysconfig/ghc-doc-index ]; then - . /etc/sysconfig/ghc-doc-index -fi - -if [ "$CRON" = "no" ]; then - exit 0 -fi - - -LOCKFILE=/var/lock/ghc-doc-index.lock - -# the lockfile is not meant to be perfect, it's just in case the -# two cron scripts get run close to each other to keep -# them from stepping on each other's toes. -[ -f $LOCKFILE ] && exit 0 - -trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT -touch $LOCKFILE - -PKGDIRCACHE=/var/lib/ghc/pkg-dir.cache -LISTING="env LANG=C ls -dl" - -# only re-index ghc docs when there are changes -cd /usr/share/doc/ghc/html/libraries -if [ -r "$PKGDIRCACHE" ]; then - $LISTING */ > $PKGDIRCACHE.new - DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new) -else - $LISTING */ > $PKGDIRCACHE -fi -if [ -x "gen_contents_index" -a ! -r "$PKGDIRCACHE.new" -o -n "$DIR_DIFF" ]; then - ./gen_contents_index --batch -fi - -if [ -f $PKGDIRCACHE.new ]; then - mv -f $PKGDIRCACHE{.new,} -fi - -exit 0 diff --git a/ghc-gen_contents_index-cron-batch.patch b/ghc-gen_contents_index-cron-batch.patch deleted file mode 100644 index 9e30974..0000000 --- a/ghc-gen_contents_index-cron-batch.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -u ghc-6.12.3/libraries/gen_contents_index gen_contents_index ---- ghc-6.12.3/libraries/gen_contents_index 2010-11-05 10:28:02.000000000 +1000 -+++ gen_contents_index 2010-11-05 10:20:37.000000000 +1000 -@@ -22,5 +22,5 @@ - done - ;; --*) -+--batch) - HADDOCK=/usr/bin/haddock - # We don't want the GHC API to swamp the index -@@ -32,6 +32,9 @@ - HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG" - done - ;; -+*) -+ HADDOCK=/bin/true -+ tty -s && echo Run with '--batch' to index package haddock docs. - esac - - # Now create the combined contents and index pages diff --git a/ghc.spec b/ghc.spec index cb4f958..693ed3b 100644 --- a/ghc.spec +++ b/ghc.spec @@ -40,7 +40,6 @@ Source0: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2 %if %{undefined without_testsuite} Source2: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-testsuite.tar.bz2 %endif -Source3: ghc-doc-index.cron URL: http://haskell.org/ghc/ Obsoletes: ghc-dph-base < 0.5, ghc-dph-base-devel < 0.5, ghc-dph-base-prof < 0.5 Obsoletes: ghc-dph-par < 0.5, ghc-dph-par-devel < 0.5, ghc-dph-par-prof < 0.5 @@ -82,8 +81,6 @@ Requires: ghc-ghc-devel = %{version}-%{release} Patch1: ghc-6.12.1-gen_contents_index-haddock-path.patch # type-level too big so skip it in gen_contents_index Patch2: ghc-gen_contents_index-type-level.patch -# disable gen_contents_index when not --batch for cron -Patch3: ghc-gen_contents_index-cron-batch.patch # fedora does not allow copy libraries Patch4: ghc-use-system-libffi.patch Patch7: ghc-powerpc-pthread.patch @@ -200,7 +197,6 @@ except the ghc library, which is installed by the toplevel ghc metapackage. %setup -q -n %{name}-%{version} %{!?without_testsuite:-b2} %patch1 -p1 -b .orig %patch2 -p1 -%patch3 -p1 # make sure we don't use these rm -r ghc-tarballs/{mingw,perl} @@ -296,11 +292,10 @@ done %ghc_strip_dynlinked %if %{undefined without_haddock} -mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly -install -p --mode=755 %SOURCE3 %{buildroot}%{_sysconfdir}/cron.hourly/ghc-doc-index -mkdir -p %{buildroot}%{_localstatedir}/lib/ghc +mkdir -p %{buildroot}%{_localstatedir}/lib/rpm-state/ghc %endif + %check # stolen from ghc6/debian/rules: # Do some very simple tests that the compiler actually works @@ -409,14 +404,13 @@ fi %ghost %{ghcdocbasedir}/libraries/index*.html %ghost %{ghcdocbasedir}/libraries/minus.gif %ghost %{ghcdocbasedir}/libraries/plus.gif -%{_sysconfdir}/cron.hourly/ghc-doc-index -%{_localstatedir}/lib/ghc +%{_localstatedir}/lib/rpm-state/ghc %endif %files libraries %changelog -* Fri Aug 24 2012 Jens Petersen - 7.4.2-7 +* Mon Oct 29 2012 Jens Petersen - 7.4.2-7 - 7.4.2 bootstrap http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/release-7-4-2.html - update base and unix library versions @@ -427,6 +421,9 @@ fi - do not disable hscolour in build.mk - drop the explicit hscolour BR - without_hscolour should now be set by ghc-rpm-macros for bootstrapping +- drop cronjob for re-indexing html docs and add a rpm-state dir for + sharing state between devel posttrans scripts (#870694) + (http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Saving_state_between_scriptlets) * Thu Jul 19 2012 Fedora Release Engineering - 7.4.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild