drop doc re-indexing cronjob and add a rpm-state dir for posttrans scripts (#870694)

This commit is contained in:
Jens Petersen 2012-10-29 20:14:11 +09:00
parent 356d662fcc
commit 483b090ae7
3 changed files with 7 additions and 71 deletions

View File

@ -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

View File

@ -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

View File

@ -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 <petersen@redhat.com> - 7.4.2-7
* Mon Oct 29 2012 Jens Petersen <petersen@redhat.com> - 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 <rel-eng@lists.fedoraproject.org> - 7.4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild