@ -1,5 +1,5 @@
# disable prof, docs, perf build
# disable prof, docs, perf build, debuginfo
# NB This SHOULD be disabled (bcond_with) for all koji production builds
# NB This must be disabled (bcond_with) for all koji production builds
%bcond_with quickbuild
%bcond_with quickbuild
# make sure ghc libraries' ABI hashes unchanged
# make sure ghc libraries' ABI hashes unchanged
@ -8,18 +8,21 @@
# to handle RCs
# to handle RCs
%global ghc_release %{version}
%global ghc_release %{version}
%global base_ver 4.11.1.0
# build profiling libraries
# build profiling libraries
# build docs (haddock and manuals)
# build haddock and manuals
# - combined since disabling haddock seems to cause no manuals built
# - earlier combined since disabling haddock seems to cause no manuals built?
# - <https://ghc.haskell.org/trac/ghc/ticket/15190>
# - <https://ghc.haskell.org/trac/ghc/ticket/15190>
# perf production build (disable for quick build)
# perf production build (disable for quick build)
%if %{with quickbuild}
%if %{with quickbuild}
%bcond_with prof
%undefine with_ghc_prof
%bcond_with docs
%undefine with_haddock
%bcond_with manual
%bcond_with perf_build
%bcond_with perf_build
%undefine _enable_debug_packages
%else
%else
%bcond_without prof
%bcond_without manual
%bcond_without docs
%bcond_without perf_build
%bcond_without perf_build
%endif
%endif
@ -33,13 +36,12 @@
%global ghc_unregisterized_arches s390 s390x %{mips}
%global ghc_unregisterized_arches s390 s390x %{mips}
Name: ghc
Name: ghc
# ghc must be rebuilt after a version bump to avoid ABI change problems
Version: 8.4.4
Version: 8.4.4
# Since library subpackages are versioned:
# Since library subpackages are versioned:
# - release can only be reset if *all* library versions get bumped simultaneously
# - release can only be reset if *all* library versions get bumped simultaneously
# (sometimes after a major release)
# (sometimes after a major release)
# - minor release numbers for a branch should be incremented monotonically
# - minor release numbers for a branch should be incremented monotonically
Release: 76 %{?dist}
Release: 99 %{?dist}
Summary: Glasgow Haskell Compiler
Summary: Glasgow Haskell Compiler
License: BSD and HaskellReport
License: BSD and HaskellReport
@ -48,8 +50,6 @@ Source0: https://downloads.haskell.org/~ghc/%{ghc_release}/ghc-%{version}-src.ta
%if %{with testsuite}
%if %{with testsuite}
Source1: https://downloads.haskell.org/~ghc/%{ghc_release}/ghc-%{version}-testsuite.tar.xz
Source1: https://downloads.haskell.org/~ghc/%{ghc_release}/ghc-%{version}-testsuite.tar.xz
%endif
%endif
Source3: ghc-doc-index.cron
Source4: ghc-doc-index
Source5: ghc-pkg.man
Source5: ghc-pkg.man
Source6: haddock.man
Source6: haddock.man
Source7: runghc.man
Source7: runghc.man
@ -61,7 +61,9 @@ Patch5: ghc-configure-fix-sphinx-version-check.patch
# https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05
# https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05
Patch6: ghc-sphinx-1.8-4eebc8016.patch
Patch6: ghc-sphinx-1.8-4eebc8016.patch
# Arch dependent packages
# Arch dependent patches
# arm
Patch12: ghc-armv7-VFPv3D16--NEON.patch
Patch12: ghc-armv7-VFPv3D16--NEON.patch
# for s390x
# for s390x
@ -91,7 +93,7 @@ BuildRequires: ghc-compiler
%if %{with abicheck}
%if %{with abicheck}
BuildRequires: ghc
BuildRequires: ghc
%endif
%endif
BuildRequires: ghc-rpm-macros-extra
BuildRequires: ghc-rpm-macros-extra >= 2.0
BuildRequires: ghc-binary-devel
BuildRequires: ghc-binary-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
BuildRequires: ghc-containers-devel
@ -101,15 +103,19 @@ BuildRequires: ghc-process-devel
BuildRequires: ghc-transformers-devel
BuildRequires: ghc-transformers-devel
BuildRequires: gmp-devel
BuildRequires: gmp-devel
BuildRequires: libffi-devel
BuildRequires: libffi-devel
BuildRequires: make
# for terminfo
# for terminfo
BuildRequires: ncurses-devel
BuildRequires: ncurses-devel
# for man and docs
BuildRequires: perl-interpreter
BuildRequires: perl-interpreter
%if %{with testsuite}
%if %{with testsuite}
BuildRequires: python3
BuildRequires: python3
%endif
%endif
%if %{with docs}
%if %{with manual}
%if 0%{?fedora} >= 31
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx
%else
BuildRequires: python2-sphinx
%endif
%endif
%endif
%ifarch %{ghc_llvm_archs}
%ifarch %{ghc_llvm_archs}
BuildRequires: llvm%{llvm_major}
BuildRequires: llvm%{llvm_major}
@ -122,10 +128,16 @@ BuildRequires: autoconf, automake
%endif
%endif
Requires: ghc-compiler = %{version}-%{release}
Requires: ghc-compiler = %{version}-%{release}
Requires: ghc-ghc-devel = %{version}-%{release}
Requires: ghc-ghc-devel = %{version}-%{release}
Requires: ghc-libraries = %{version}-%{release}
Requires: ghc-devel = %{version}-%{release}
%if %{with docs}
%if %{with haddock}
Recommends: ghc-doc-cron = %{version}-%{release}
Suggests: ghc-doc = %{version}-%{release}
Recommends: ghc-manual = %{version}-%{release}
Suggests: ghc-doc-index = %{version}-%{release}
%endif
%if %{with manual}
Suggests: ghc-manual = %{version}-%{release}
%endif
%if %{with ghc_prof}
Suggests: ghc-prof = %{version}-%{release}
%endif
%endif
Recommends: zlib-devel
Recommends: zlib-devel
@ -156,15 +168,8 @@ for the functional language Haskell. Highlights:
Summary: GHC compiler and utilities
Summary: GHC compiler and utilities
License: BSD
License: BSD
Requires: gcc%{?_isa}
Requires: gcc%{?_isa}
Requires: ghc-base-devel%{?_isa}
Requires: ghc-base-devel%{?_isa} = %{base_ver}-%{release}
# for alternatives
%if %{without haddock}
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
# added in f14
Obsoletes: ghc-doc < 6.12.3-4
%if %{without docs}
Obsoletes: ghc-doc-cron < %{version}-%{release}
# added in f28
Obsoletes: ghc-doc-index < %{version}-%{release}
Obsoletes: ghc-doc-index < %{version}-%{release}
%endif
%endif
%ifarch %{ghc_llvm_archs}
%ifarch %{ghc_llvm_archs}
@ -174,28 +179,34 @@ Requires: llvm%{llvm_major}
%description compiler
%description compiler
The package contains the GHC compiler, tools and utilities.
The package contains the GHC compiler, tools and utilities.
The ghc libraries are provided by ghc-libraries .
The ghc libraries are provided by ghc-devel .
To install all of ghc (including the ghc library),
To install all of ghc (including the ghc library),
install the main ghc package.
install the main ghc package.
%if %{with docs}
%if %{with haddock}
%package doc-cron
%package doc
Summary: GHC library documentation indexing cronjob
Summary: Haskell library documentation meta package
License: BSD
%description doc
Installing this package causes ghc-*-doc packages corresponding to ghc-*-devel
packages to be automatically installed too.
%package doc-index
Summary: GHC library documentation indexing
License: BSD
License: BSD
Obsoletes: ghc-doc-cron < %{version}-%{release}
Requires: ghc-compiler = %{version}-%{release}
Requires: ghc-compiler = %{version}-%{release}
Requires: crontabs
# added in f28
Obsoletes: ghc-doc-index < %{version}-%{release}
BuildArch: noarch
BuildArch: noarch
%description doc-cron
%description doc-index
The package provides a cronjob for re-indexing installed library development
The package enables re-indexing of installed library documention.
documention.
%endif
%endif
%if %{with docs }
%if %{with manual }
%package manual
%package manual
Summary: GHC manual
Summary: GHC manual
License: BSD
License: BSD
@ -209,35 +220,21 @@ This package provides the User Guide and Haddock manual.
# ghclibdir also needs ghc_version_override for bootstrapping
# ghclibdir also needs ghc_version_override for bootstrapping
%global ghc_version_override %{version}
%global ghc_version_override %{version}
# EL7 rpm supports fileattrs ghc.attr
%if 0%{?rhel} && 0%{?rhel} < 7
# needs ghc_version_override for bootstrapping
%global _use_internal_dependency_generator 0
%global __find_provides /usr/lib/rpm/rpmdeps --provides
%global __find_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
%endif
%global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release}
%global BSDHaskellReport %{quote:BSD and HaskellReport}
%global BSDHaskellReport %{quote:BSD and HaskellReport}
# use "./libraries-versions.sh" to check versions
# use "./libraries-versions.sh" to check versions
%if %{defined ghclibdir}
%if %{defined ghclibdir}
%ghc_lib_subpackage -d -l BSD Cabal-2.2.0.1
%ghc_lib_subpackage -d -l BSD Cabal-2.2.0.1
%ghc_lib_subpackage -d -l %BSDHaskellReport array-0.5.2.0
%ghc_lib_subpackage -d -l %BSDHaskellReport array-0.5.2.0
%ghc_lib_subpackage -d -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa} base-4.11.1.0
%ghc_lib_subpackage -d -l %BSDHaskellReport -c gmp-devel%{?_isa},libffi-devel%{?_isa} base-%{base_ver}
%ghc_lib_subpackage -d -l BSD binary-0.8.5.1
%ghc_lib_subpackage -d -l BSD binary-0.8.5.1
%ghc_lib_subpackage -d -l BSD bytestring-0.10.8.2
%ghc_lib_subpackage -d -l BSD bytestring-0.10.8.2
%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.5.11.0
%ghc_lib_subpackage -d -l %BSDHaskellReport containers-0.5.11.0
%ghc_lib_subpackage -d -l %BSDHaskellReport deepseq-1.4.3.0
%ghc_lib_subpackage -d -l %BSDHaskellReport deepseq-1.4.3.0
%ghc_lib_subpackage -d -l %BSDHaskellReport directory-1.3.1.5
%ghc_lib_subpackage -d -l %BSDHaskellReport directory-1.3.1.5
%ghc_lib_subpackage -d -l BSD filepath-1.4.2
%ghc_lib_subpackage -d -l BSD filepath-1.4.2
# in ghc not ghc-libraries:
%ghc_lib_subpackage -d -x ghc-%{ghc_version_override}
%ghc_lib_subpackage -d -x -l BSD ghc-boot-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD ghc-boot-th-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD ghc-boot-th-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD ghc-compact-0.1.0.0
%ghc_lib_subpackage -d -l BSD ghc-compact-0.1.0.0
%ghc_lib_subpackage -d -l BSD -x ghci-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD haskeline-0.7.4.2
%ghc_lib_subpackage -d -l BSD haskeline-0.7.4.2
%ghc_lib_subpackage -d -l BSD hpc-0.6.0.3
%ghc_lib_subpackage -d -l BSD hpc-0.6.0.3
%ghc_lib_subpackage -d -l BSD mtl-2.2.2
%ghc_lib_subpackage -d -l BSD mtl-2.2.2
@ -251,30 +248,42 @@ This package provides the User Guide and Haddock manual.
%ghc_lib_subpackage -d -l BSD time-1.8.0.2
%ghc_lib_subpackage -d -l BSD time-1.8.0.2
%ghc_lib_subpackage -d -l BSD transformers-0.5.5.0
%ghc_lib_subpackage -d -l BSD transformers-0.5.5.0
%ghc_lib_subpackage -d -l BSD unix-2.7.2.2
%ghc_lib_subpackage -d -l BSD unix-2.7.2.2
%if %{with docs }
%if %{with haddock }
%ghc_lib_subpackage -d -l BSD xhtml-3000.2.2.1
%ghc_lib_subpackage -d -l BSD xhtml-3000.2.2.1
%endif
%endif
# in ghc not ghc-devel:
%ghc_lib_subpackage -d -x ghc-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD -x ghc-boot-%{ghc_version_override}
%ghc_lib_subpackage -d -l BSD -x ghci-%{ghc_version_override}
%endif
%endif
%global version %{ghc_version_override}
%global version %{ghc_version_override}
%package libraries
%package devel
Summary: GHC development libraries meta package
Summary: GHC development libraries meta package
License: BSD and HaskellReport
License: BSD and HaskellReport
Requires: ghc-compiler = %{version}-%{release}
Requires: ghc-compiler = %{version}-%{release}
Obsoletes: ghc-devel < %{version}-%{release}
Obsoletes: ghc-libraries < %{version}-%{release}
Provides: ghc-devel = %{version}-%{release}
Provides: ghc-libraries = %{version}-%{release}
Obsoletes: ghc-prof < %{version}-%{release}
Provides: ghc-prof = %{version}-%{release}
# since f15
Obsoletes: ghc-libs < 7.0.1-3
%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")}
%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/ghc-\1-devel = \2-%{release},/g")}
%description libraries
%description devel
This is a meta-package for all the development library packages in GHC
This is a meta-package for all the development library packages in GHC
except the ghc library, which is installed by the toplevel ghc metapackage.
except the ghc library, which is installed by the toplevel ghc metapackage.
%if %{with ghc_prof}
%package prof
Summary: GHC profiling libraries meta package
License: BSD
Requires: ghc-compiler = %{version}-%{release}
%description prof
Installing this package causes ghc-*-prof packages corresponding to ghc-*-devel
packages to be automatically installed too.
%endif
%prep
%prep
%setup -q -n %{name}-%{version} %{?with_testsuite:-b1}
%setup -q -n %{name}-%{version} %{?with_testsuite:-b1}
@ -284,9 +293,7 @@ except the ghc library, which is installed by the toplevel ghc metapackage.
%patch5 -p1 -b .orig
%patch5 -p1 -b .orig
%patch6 -p1 -b .orig
%patch6 -p1 -b .orig
%if 0%{?fedora} || 0%{?rhel} > 6
rm -r libffi-tarballs
rm -r libffi-tarballs
%endif
%ifarch armv7hl
%ifarch armv7hl
%patch12 -p1 -b .orig
%patch12 -p1 -b .orig
@ -309,7 +316,7 @@ rm -r libffi-tarballs
%endif
%endif
%global gen_contents_index gen_contents_index.orig
%global gen_contents_index gen_contents_index.orig
%if %{with docs }
%if %{with haddock }
if [ ! -f "libraries/%{gen_contents_index}" ]; then
if [ ! -f "libraries/%{gen_contents_index}" ]; then
echo "Missing libraries/%{gen_contents_index}, needed at end of %%install!"
echo "Missing libraries/%{gen_contents_index}, needed at end of %%install!"
exit 1
exit 1
@ -331,15 +338,18 @@ BuildFlavour = quick-llvm
BuildFlavour = quick
BuildFlavour = quick
%endif
%endif
%endif
%endif
GhcLibWays = v dyn %{?with_prof:p}
GhcLibWays = v dyn %{?with_ghc_ prof:p}
%if %{with docs }
%if %{with haddock }
HADDOCK_DOCS = YES
HADDOCK_DOCS = YES
BUILD_MAN = YES
EXTRA_HADDOCK_OPTS += --hyperlinked-source
%else
%else
HADDOCK_DOCS = NO
HADDOCK_DOCS = NO
%endif
%if %{with manual}
BUILD_MAN = YES
%else
BUILD_MAN = NO
BUILD_MAN = NO
%endif
%endif
EXTRA_HADDOCK_OPTS += --hyperlinked-source
BUILD_SPHINX_PDF = NO
BUILD_SPHINX_PDF = NO
EOF
EOF
## for verbose build output
## for verbose build output
@ -357,9 +367,7 @@ autoreconf
autoconf
autoconf
%endif
%endif
# replace later with ghc_set_gcc_flags
%ghc_set_gcc_flags
export CFLAGS="${CFLAGS:-%optflags}"
export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"
# for ghc >= 8.2
# for ghc >= 8.2
export CC=%{_bindir}/gcc
export CC=%{_bindir}/gcc
# * %%configure induces cross-build due to different target/host/build platform names
# * %%configure induces cross-build due to different target/host/build platform names
@ -369,12 +377,10 @@ export CC=%{_bindir}/gcc
--libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
--libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--docdir=%{_docdir}/ghc \
--docdir=%{_docdir}/ghc \
--with-system-libffi \
%ifarch %{ghc_unregisterized_arches}
%ifarch %{ghc_unregisterized_arches}
--enable-unregisterised \
--enable-unregisterised \
%endif
%endif
%if 0%{?fedora} || 0%{?rhel} > 6
--with-system-libffi \
%endif
%{nil}
%{nil}
# avoid "ghc: hGetContents: invalid argument (invalid byte sequence)"
# avoid "ghc: hGetContents: invalid argument (invalid byte sequence)"
@ -386,28 +392,33 @@ make %{?_smp_mflags}
make DESTDIR=%{buildroot} install
make DESTDIR=%{buildroot} install
%if %{defined _ghcdynlibdir}
%if %{defined _ghcdynlibdir}
mv %{buildroot}%{ghclibdir}/*/libHS*ghc%{ghc_version}.so %{buildroot}%{_libdir}/
mv %{buildroot}%{ghclibdir}/*/libHS*ghc%{ghc_version}.so %{buildroot}%{_ghcdyn libdir}/
for i in $(find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \; -print); do
for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \; -print); do
chrpath -d $i
chrpath -d $i
done
done
for i in %{buildroot}%{ghclibdir}/package.conf.d/*.conf; do
for i in %{buildroot}%{ghclibdir}/package.conf.d/*.conf; do
sed -i -e 's!^dynamic-library-dirs: .*!dynamic-library-dirs: %{_libdir}!' $i
sed -i -e 's!^dynamic-library-dirs: .*!dynamic-library-dirs: %{_ghcdyn libdir}!' $i
done
done
sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs: %{_libdir}!' %{buildroot}%{ghclibdir}/package.conf.d/rts.conf
sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs: %{_ghcdyn libdir}!' %{buildroot}%{ghclibdir}/package.conf.d/rts.conf
%endif
%endif
# libraries licenses
rm %{buildroot}%{ghc_html_libraries_dir}/{ghc-prim,integer-gmp}-*/LICENSE
mkdir -p %{buildroot}%{_ghclicensedir}
for i in $(cd %{buildroot}%{ghc_html_libraries_dir}; ls */LICENSE); do
pkg=$(dirname $i | sed -e "s/\\(.*\\)-.*/\\1/")
mkdir %{buildroot}%{_ghclicensedir}/ghc-$pkg
mv %{buildroot}%{ghc_html_libraries_dir}/$i %{buildroot}%{_ghclicensedir}/ghc-$pkg/
done
for i in %{ghc_packages_list}; do
for i in %{ghc_packages_list}; do
name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")
name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")
ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")
ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")
%ghc_gen_filelists $name $ver
%ghc_gen_filelists $name $ver
%if 0%{?rhel} && 0%{?rhel} < 7
echo "%%doc libraries/$name/LICENSE" >> ghc-$name.files
%else
echo "%%license libraries/$name/LICENSE" >> ghc-$name.files
%endif
done
done
echo "%%dir %{ghclibdir}" >> ghc-base%{?_ghcdynlibdir:-devel}.files
echo "%%dir %{ghclibdir}" >> ghc-base%{?_ghcdynlibdir:-devel}.files
echo "%{ghclibdir}/include" >> ghc-base-devel.files
%ghc_gen_filelists ghc-boot %{ghc_version_override}
%ghc_gen_filelists ghc-boot %{ghc_version_override}
%ghc_gen_filelists ghc %{ghc_version_override}
%ghc_gen_filelists ghc %{ghc_version_override}
@ -416,66 +427,34 @@ echo "%%dir %{ghclibdir}" >> ghc-base%{?_ghcdynlibdir:-devel}.files
%ghc_gen_filelists integer-gmp 1.0.2.0
%ghc_gen_filelists integer-gmp 1.0.2.0
%define merge_filelist()\
%define merge_filelist()\
cat ghc-%1.files >> ghc-%2.files\
cat ghc-%1-devel.files >> ghc-%2-devel.files\
cp -p libraries/%1/LICENSE libraries/LICENSE.%1\
cp -p libraries/%1/LICENSE libraries/LICENSE.%1\
%if 0%{?rhel} && 0%{?rhel} < 7\
echo "%%doc libraries/LICENSE.%1" >> ghc-%2.files\
%else\
echo "%%license libraries/LICENSE.%1" >> ghc-%2.files\
echo "%%license libraries/LICENSE.%1" >> ghc-%2.files\
%endif
cat ghc-%1.files >> ghc-%2.files\
for i in devel doc prof; do\
cat ghc-%1-$i.files >> ghc-%2-$i.files\
done
%merge_filelist integer-gmp base
%merge_filelist integer-gmp base
%merge_filelist ghc-prim base
%merge_filelist ghc-prim base
# add rts libs
# add rts libs
%if %{defined _ghcdynlibdir}
rm -f rts.files
echo "%{ghclibdir}/rts" >> ghc-base-devel.files
touch rts.files
%else
ls %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibdir}/rts}/libHSrts*-ghc%{ghc_version}.so >> rts.files
echo "%%dir %{ghclibdir}/rts" >> ghc-base.files
find %{buildroot}%{ghclibdir}/rts -type d -fprintf rts-devel.files '%%%%dir %p\n' -o -name 'libHSrts*_p.a' -fprint rts-prof.files -o -fprint rts-devel.files
ls -d %{buildroot}%{ghclibdir}/rts/lib*.a >> ghc-base-devel.files
echo "%{ghclibdir}/package.conf.d/rts.conf" >> rts-devel.files
%endif
sed -i -e "s!%{buildroot}!!g" rts.files rts-devel.files rts-prof.files
ls %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibdir}/rts}/libHSrts*.so >> ghc-base.files
cat rts.files >> ghc-base.files
%if 0%{?rhel} && 0%{?rhel} < 7
cat rts-devel.files >> ghc-base-devel.files
ls %{buildroot}%{ghclibdir}/rts/libffi.so.* >> ghc-base.files
cat rts-prof.files >> ghc-base-prof.files
%endif
%if %{defined _ghcdynlibdir}
%if %{with haddock}
sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs: %{_libdir}!' %{buildroot}%{ghclibdir}/package.conf.d/rts.conf
%endif
ls -d %{buildroot}%{ghclibdir}/package.conf.d/rts.conf %{buildroot}%{ghclibdir}/include >> ghc-base-devel.files
%if 0%{?rhel} && 0%{?rhel} < 7
ls %{buildroot}%{ghclibdir}/rts/libffi.so >> ghc-base-devel.files
%endif
sed -i -e "s|^%{buildroot}||g" ghc-base*.files
# these are handled as alternatives
for i in hsc2hs runhaskell; do
if [ -x %{buildroot}%{_bindir}/$i-ghc ]; then
rm %{buildroot}%{_bindir}/$i
else
mv %{buildroot}%{_bindir}/$i{,-ghc}
fi
touch %{buildroot}%{_bindir}/$i
done
%if %{with docs}
mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly
install -p --mode=0755 %SOURCE3 %{buildroot}%{_sysconfdir}/cron.hourly/ghc-doc-index
mkdir -p %{buildroot}%{_localstatedir}/lib/ghc
touch %{buildroot}%{_localstatedir}/lib/ghc/pkg-dir.cache{,.new}
install -p --mode=0755 %SOURCE4 %{buildroot}%{_bindir}/ghc-doc-index
# generate initial lib doc index
# generate initial lib doc index
cd libraries
cd libraries
sh %{gen_contents_index} --intree --verbose
sh %{gen_contents_index} --intree --verbose
cd ..
cd ..
%endif
%endif
# we package the library license files separately
find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';'
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_mandir}/man1
install -p -m 0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/ghc-pkg.1
install -p -m 0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/ghc-pkg.1
install -p -m 0644 %{SOURCE6} %{buildroot}%{_mandir}/man1/haddock.1
install -p -m 0644 %{SOURCE6} %{buildroot}%{_mandir}/man1/haddock.1
@ -536,30 +515,7 @@ make test
%endif
%endif
%post compiler
%if %{defined ghclibdir}
# Alas, GHC, Hugs, and nhc all come with different set of tools in
# addition to a runFOO:
#
# * GHC: hsc2hs
# * Hugs: hsc2hs, cpphs
# * nhc: cpphs
#
# Therefore it is currently not possible to use --slave below to form
# link groups under a single name 'runhaskell'. Either these tools
# should be disentangled from the Haskell implementations, or all
# implementations should have the same set of tools. *sigh*
update-alternatives --install %{_bindir}/runhaskell runhaskell \
%{_bindir}/runghc 500
update-alternatives --install %{_bindir}/hsc2hs hsc2hs \
%{_bindir}/hsc2hs-ghc 500
%preun compiler
if [ "$1" = 0 ]; then
update-alternatives --remove runhaskell %{_bindir}/runghc
update-alternatives --remove hsc2hs %{_bindir}/hsc2hs-ghc
fi
%transfiletriggerin compiler -- %{ghclibdir}/package.conf.d
%transfiletriggerin compiler -- %{ghclibdir}/package.conf.d
%ghc_pkg_recache
%ghc_pkg_recache
%end
%end
@ -567,6 +523,19 @@ fi
%transfiletriggerpostun compiler -- %{ghclibdir}/package.conf.d
%transfiletriggerpostun compiler -- %{ghclibdir}/package.conf.d
%ghc_pkg_recache
%ghc_pkg_recache
%end
%end
%endif
%if %{with haddock}
%transfiletriggerin doc-index -- %{ghc_html_libraries_dir}
%{ghc_html_libraries_dir}/gen_contents_index
%end
%transfiletriggerpostun doc-index -- %{ghc_html_libraries_dir}
%{ghc_html_libraries_dir}/gen_contents_index
%end
%endif
%files
%files
@ -581,11 +550,10 @@ fi
%{_bindir}/ghci-%{version}
%{_bindir}/ghci-%{version}
%{_bindir}/hp2ps
%{_bindir}/hp2ps
%{_bindir}/hpc
%{_bindir}/hpc
%ghost %{_bindir}/hsc2hs
%{_bindir}/hsc2hs
%{_bindir}/hsc2hs-ghc
%{_bindir}/runghc
%{_bindir}/runghc*
%{_bindir}/runghc-%{ghc_version}
%ghost %{_bindir}/runhaskell
%{_bindir}/runhaskell
%{_bindir}/runhaskell-ghc
%dir %{ghclibdir}/bin
%dir %{ghclibdir}/bin
%{ghclibdir}/bin/ghc
%{ghclibdir}/bin/ghc
%{ghclibdir}/bin/ghc-pkg
%{ghclibdir}/bin/ghc-pkg
@ -593,7 +561,7 @@ fi
%{ghclibdir}/bin/hsc2hs
%{ghclibdir}/bin/hsc2hs
%{ghclibdir}/bin/ghc-iserv
%{ghclibdir}/bin/ghc-iserv
%{ghclibdir}/bin/ghc-iserv-dyn
%{ghclibdir}/bin/ghc-iserv-dyn
%if %{with prof}
%if %{with ghc_ prof}
%{ghclibdir}/bin/ghc-iserv-prof
%{ghclibdir}/bin/ghc-iserv-prof
%endif
%endif
%{ghclibdir}/bin/runghc
%{ghclibdir}/bin/runghc
@ -617,16 +585,12 @@ fi
%{_mandir}/man1/haddock.1*
%{_mandir}/man1/haddock.1*
%{_mandir}/man1/runghc.1*
%{_mandir}/man1/runghc.1*
%if %{with docs}
%if %{with haddock}
%{_bindir}/ghc-doc-index
%{_bindir}/haddock
%{_bindir}/haddock
%{_bindir}/haddock-ghc-%{version}
%{_bindir}/haddock-ghc-%{version}
%{ghclibdir}/bin/haddock
%{ghclibdir}/bin/haddock
%{ghclibdir}/html
%{ghclibdir}/html
%{ghclibdir}/latex
%{ghclibdir}/latex
%if %{with docs}
%{_mandir}/man1/ghc.1*
%endif
%dir %{ghc_html_dir}/libraries
%dir %{ghc_html_dir}/libraries
%{ghc_html_dir}/libraries/gen_contents_index
%{ghc_html_dir}/libraries/gen_contents_index
%{ghc_html_dir}/libraries/prologue.txt
%{ghc_html_dir}/libraries/prologue.txt
@ -640,32 +604,46 @@ fi
%ghost %{ghc_html_dir}/libraries/plus.gif
%ghost %{ghc_html_dir}/libraries/plus.gif
%ghost %{ghc_html_dir}/libraries/quick-jump.css
%ghost %{ghc_html_dir}/libraries/quick-jump.css
%ghost %{ghc_html_dir}/libraries/synopsis.png
%ghost %{ghc_html_dir}/libraries/synopsis.png
%dir %{_localstatedir}/lib/ghc
%ghost %{_localstatedir}/lib/ghc/pkg-dir.cache
%ghost %{_localstatedir}/lib/ghc/pkg-dir.cache.new
%endif
%endif
%if %{with manual}
%if %{with docs}
%{_mandir}/man1/ghc.1*
%files doc-cron
%config(noreplace) %{_sysconfdir}/cron.hourly/ghc-doc-index
%endif
%endif
%files libraries
%files devel
%if %{with haddock}
%files doc
%if %{with docs}
%files doc-index
%endif
%if %{with manual}
%files manual
%files manual
## needs pandoc
## needs pandoc
#%%{ghc_html_dir}/Cabal
#%%{ghc_html_dir}/Cabal
%if %{with docs }
%if %{with haddock }
%{ghc_html_dir}/haddock
%{ghc_html_dir}/haddock
%endif
%endif
%{ghc_html_dir}/index.html
%{ghc_html_dir}/index.html
%{ghc_html_dir}/users_guide
%{ghc_html_dir}/users_guide
%endif
%endif
%if %{with ghc_prof}
%files prof
%endif
%changelog
%changelog
* Tue Jul 16 2019 Jens Petersen <petersen@redhat.com> - 8.4.4-99
- subpackage library haddock documentation and profiling libraries
- add ghc-doc and ghc-prof metapackages to pull in lib docs and prof libs
- rename ghc-doc-cron with ghc-doc-index using file triggers
- rename ghc-libraries to ghc-devel
- for quickbuild disable debuginfo
- lock ghc-compiler requires ghc-base-devel to ver-rel
- drop alternatives for runhaskell and hsc2hs
- use ghc_set_gcc_flags, with_ghc_prof, and with_haddock
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org>
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild