- bring back including haddock-generated lib docs, now under docdir/ghc
- fix macros.ghc filepath (#460304) - spec file cleanups: - fix the source urls back - drop requires chkconfig - do not override __spec_install_post - override _target_platform so we can use %%configure - setup docs building in build.mk - no longer need to remove network/include/Typeable.h - install binaries under libdir not libexec - remove hsc2hs and runhaskell binaries since are alternatives
This commit is contained in:
parent
97f36761c3
commit
2a4aeca5cc
104
ghc.spec
104
ghc.spec
@ -2,32 +2,20 @@
|
|||||||
%define build_prof 1
|
%define build_prof 1
|
||||||
%define build_doc 1
|
%define build_doc 1
|
||||||
|
|
||||||
# Fixing packaging problems can be a tremendous pain because it
|
|
||||||
# generally requires a complete rebuild, which takes hours. To offset
|
|
||||||
# the misery, do a complete build once using "rpmbuild -bc", then copy
|
|
||||||
# your built tree to a directory of the same name suffixed with
|
|
||||||
# ".built", using "cp -al". Finally, set this variable, and it will
|
|
||||||
# copy the already-built tree into place during build instead of
|
|
||||||
# actually doing the build.
|
|
||||||
#
|
|
||||||
# Obviously, this can only work if you leave the build section
|
|
||||||
# completely untouched between builds.
|
|
||||||
%define package_debugging 0
|
|
||||||
|
|
||||||
Name: ghc
|
Name: ghc
|
||||||
Version: 6.8.3
|
Version: 6.8.3
|
||||||
Release: 4%{?dist}
|
Release: 5%{?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
|
||||||
License: BSD
|
License: BSD
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
Source0: http://www.haskell.org/ghc/dist/stable/dist/ghc-%{version}-src.tar.bz2
|
Source0: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
|
||||||
Source1: http://www.haskell.org/ghc/dist/stable/dist/ghc-%{version}-src-extralibs.tar.bz2
|
Source1: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src-extralibs.tar.bz2
|
||||||
Source2: ghc-rpm-macros.ghc
|
Source2: ghc-rpm-macros.ghc
|
||||||
Patch0: ghc-6.8.3-libraries-config.patch
|
Patch0: ghc-6.8.3-libraries-config.patch
|
||||||
URL: http://haskell.org/ghc/
|
URL: http://haskell.org/ghc/
|
||||||
Requires: chkconfig, gcc, gmp-devel, readline-devel
|
Requires: gcc, gmp-devel, readline-devel
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
Obsoletes: ghc682, ghc681, ghc661, ghc66
|
Obsoletes: ghc682, ghc681, ghc661, ghc66
|
||||||
BuildRequires: ghc, happy, sed
|
BuildRequires: ghc, happy, sed
|
||||||
@ -75,85 +63,51 @@ you like to have local access to the documentation in HTML format.
|
|||||||
|
|
||||||
# the debuginfo subpackage is currently empty anyway, so don't generate it
|
# the debuginfo subpackage is currently empty anyway, so don't generate it
|
||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
%define __spec_install_post /usr/lib/rpm/brp-compress
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version} -b1
|
%setup -q -n %{name}-%{version} -b1
|
||||||
|
%patch0 -p1 -b .0-haddock~
|
||||||
%patch0 -p1 -b .hdkl
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if %{package_debugging}
|
|
||||||
cd ..
|
|
||||||
rm -rf %{name}-%{version}
|
|
||||||
cp -al %{name}-%{version}.built %{name}-%{version}
|
|
||||||
cd %{name}-%{version}
|
|
||||||
exit 0
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if !%{build_prof}
|
%if !%{build_prof}
|
||||||
echo "GhcLibWays=" >> mk/build.mk
|
echo "GhcLibWays=" >> mk/build.mk
|
||||||
echo "GhcRTSWays=thr debug" >> mk/build.mk
|
echo "GhcRTSWays=thr debug" >> mk/build.mk
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
HaddockCmd=%{_bindir}/haddock-0.9 \
|
%if %{build_doc}
|
||||||
./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
|
echo "XMLDocWays = html" >> mk/build.mk
|
||||||
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
|
echo "HADDOCK_DOCS = YES" >> mk/build.mk
|
||||||
--datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \
|
%endif
|
||||||
--libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
|
|
||||||
--sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir}
|
|
||||||
|
|
||||||
cat <<HADDOCK_PATH_HACK >> mk/build.mk
|
export HaddockCmd=%{_bindir}/haddock-0.9
|
||||||
docdir := %{_docdir}/%{name}-%{version}
|
# workaround ghc configure script hysteria about archs
|
||||||
htmldir := \$(docdir)
|
%define _target_platform %{_build}
|
||||||
dvidir := \$(docdir)
|
%configure
|
||||||
pdfdir := \$(docdir)
|
|
||||||
psdir := \$(docdir)
|
|
||||||
HADDOCK_PATH_HACK
|
|
||||||
|
|
||||||
# drop truncated copy of header (#222865)
|
make %{_smp_mflags}
|
||||||
rm libraries/network/include/Typeable.h
|
make %{_smp_mflags} -C libraries
|
||||||
|
|
||||||
make %{_smp_mflags} all libexecdir=%{_libexecdir}
|
|
||||||
%if %{build_doc}
|
%if %{build_doc}
|
||||||
make %{_smp_mflags} html
|
make %{_smp_mflags} html
|
||||||
make %{_smp_mflags} -C libraries HADDOCK_DOCS=YES
|
|
||||||
( cd libraries/Cabal && docbook2html doc/Cabal.xml --output doc/Cabal )
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
make DESTDIR=${RPM_BUILD_ROOT} libdir=%{_libdir}/%{name}-%{version} \
|
make DESTDIR=${RPM_BUILD_ROOT} install
|
||||||
libexecdir=%{_libexecdir}/%{name}-%{version} install
|
|
||||||
|
|
||||||
pushd ${RPM_BUILD_ROOT}/%{_libexecdir}/%{name}-%{version}
|
|
||||||
strip cgprof ghc-%{version} ghc-pkg.bin hsc2hs-bin unlit
|
|
||||||
popd
|
|
||||||
|
|
||||||
pushd ${RPM_BUILD_ROOT}/%{_libdir}/%{name}-%{version}
|
|
||||||
for i in ../../libexec/%{name}-%{version}/*; do
|
|
||||||
ln -s $i .
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
|
|
||||||
%if %{build_doc}
|
%if %{build_doc}
|
||||||
make DESTDIR=${RPM_BUILD_ROOT} XMLDocWays="html" HADDOCK_DOCS=YES install-docs
|
make DESTDIR=${RPM_BUILD_ROOT} install-docs
|
||||||
if [ -d ${RPM_BUILD_ROOT}/%{_docdir}/%{name}/libraries ]; then
|
|
||||||
mv ${RPM_BUILD_ROOT}/%{_docdir}/%{name}/libraries \
|
|
||||||
${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version}
|
|
||||||
fi
|
|
||||||
cp libraries/*.html ${RPM_BUILD_ROOT}/%{_docdir}/%{name}-%{version}/libraries
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# install rpm macros
|
# install rpm macros
|
||||||
mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc
|
mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm
|
||||||
cp -p %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysconfdir}/rpm/macros.ghc
|
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} .%{_libexecdir}/%{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 \)
|
||||||
)
|
)
|
||||||
|
|
||||||
# make paths absolute (filter "./usr" to "/usr")
|
# make paths absolute (filter "./usr" to "/usr")
|
||||||
@ -167,7 +121,8 @@ cat rpm-dir.files rpm-prof.files > rpm-prof-filelist
|
|||||||
# create package.conf.old
|
# create package.conf.old
|
||||||
touch $RPM_BUILD_ROOT%{_libdir}/ghc-%{version}/package.conf.old
|
touch $RPM_BUILD_ROOT%{_libdir}/ghc-%{version}/package.conf.old
|
||||||
|
|
||||||
mv ${RPM_BUILD_ROOT}%{_bindir}/hsc2hs ${RPM_BUILD_ROOT}%{_bindir}/hsc2hs-ghc
|
# these are handled as alternatives
|
||||||
|
rm ${RPM_BUILD_ROOT}%{_bindir}/{hsc2hs,runhaskell}
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
@ -216,12 +171,25 @@ fi
|
|||||||
%if %{build_doc}
|
%if %{build_doc}
|
||||||
%files doc
|
%files doc
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%{_docdir}/%{name}-%{version}
|
%{_docdir}/%{name}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Sep 17 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-4
|
* Wed Sep 24 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-5.fc10
|
||||||
|
- bring back haddock-generated lib docs, now under docdir/ghc
|
||||||
|
- fix macros.ghc filepath (#460304)
|
||||||
|
- spec file cleanups:
|
||||||
|
- fix the source urls back
|
||||||
|
- drop requires chkconfig
|
||||||
|
- do not override __spec_install_post
|
||||||
|
- override _target_platform so we can use %%configure
|
||||||
|
- setup docs building in build.mk
|
||||||
|
- no longer need to remove network/include/Typeable.h
|
||||||
|
- install binaries under libdir not libexec
|
||||||
|
- remove hsc2hs and runhaskell binaries since are alternatives
|
||||||
|
|
||||||
|
* Wed Sep 17 2008 Jens Petersen <petersen@redhat.com> - 6.8.3-4.fc10
|
||||||
- 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…
Reference in New Issue
Block a user