Compare commits

..

8 Commits
master ... f21

Author SHA1 Message Date
Jens Petersen 72434b09df backport some improvements from f22
- cabal macro now sets utf8 locale
- introduce ghc_pkgdocdir since no _pkgdocdir in RHEL 7 and earlier
- add cabal_test macro which uses it
- only run cabal haddock for real libraries with modules
- make sure basepkg.files is also created for meta packages
- ghc_fix_dynamic_rpath: on ARMv7 RPATH is RUNPATH
2015-10-08 17:08:46 +09:00
Jens Petersen 28cbb65983 version doc htmldirs and ghcpkgdocdir again; fix cabal-tweak-flag string
version because haddock generates versioned crosslinks

new aliases: %ghc_html_dir, %ghc_html_libraries_dir, and %ghc_html_pkg_dir
2015-01-22 16:59:49 +09:00
Jens Petersen 3df2d9cc3c exclude -Wall from CFLAGS to prevent Cabal configure warning with ghc-7.6
see #1175667:

In function 'foo':
warning: control reaches end of non-void function [-Wreturn-type]
2015-01-19 14:14:29 +09:00
Jens Petersen afcae244ac backport various recent improvements from rawhide
- split ghc.attr into ghc_lib.attr and ghc_bin.attr for finer grained handling
- require ghc-compiler for ghc_version
- macros.ghc: cabal_configure now passes CFLAGS and LDFLAGS to ghc (#1138982)
  (thanks to Sergei Trofimovich and Ville Skyttä)
- ghc-deps.sh: support ghc-pkg for ghc build <= 7.4.2 as well
2014-11-14 18:27:31 +09:00
Jens Petersen b154c1ea88 ghc.attr needs to handle requires for /usr/bin files too 2014-10-16 17:06:34 +09:00
Jens Petersen 1d69007d72 backport some recent changes from f22
- improve ghc_fix_dynamic_rpath not to assume cwd = pkg_name
- drop -O2: it often uses too much build mem
- add an rpm .attr file for ghc-deps.sh rather than running it
  as an external dep generator (#1132275)
2014-09-10 17:19:16 +09:00
Jens Petersen 3e2085dbb6 fix warning in macros.ghc-extra about unused pkgnamever 2014-08-20 22:46:57 +09:00
Peter Robinson 5a6a2084b4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-16 15:44:17 +00:00
13 changed files with 221 additions and 803 deletions

View File

@ -5,7 +5,3 @@ Initial implementation:
Bryan O'Sullivan
Jens Petersen
Yaakov Nemoy
Contributions from:
Peter Trommler
Ondřej Súkup

View File

@ -1,3 +0,0 @@
import Distribution.Simple
main = defaultMain

View File

@ -1,30 +0,0 @@
#!/bin/sh
set -e +x
USAGE="Usage: $0 dep"
if [ $# -ne 1 ]; then
echo "$USAGE"
exit 1
fi
DEP=$1
CABALFILE=$(ls *.cabal)
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
echo "There needs to be one .cabal file in the current dir!"
exit 1
fi
if [ ! -f $CABALFILE.orig ]; then
BACKUP=.orig
fi
if grep "$DEP" $CABALFILE | sed -e "s/$DEP//" | grep -q -e "[A-Za-z]"; then
echo "$0: deleting whole $DEP lines not safe - try more precise pattern"
exit 1
fi
sed -i$BACKUP -e "/$DEP/d" $CABALFILE

View File

@ -1,43 +1,87 @@
#!/bin/sh
# find rpm provides and requires for Haskell GHC libraries
[ $# -ne 2 ] && echo "Usage: $(basename $0) [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
[ $# -ne 2 ] && echo "Usage: `basename $0` [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
set +x
mode=$1
pkgbasedir=$2
pkgconfdir=$pkgbasedir/package.conf.d
MODE=$1
PKGBASEDIR=$2
PKGCONFDIR=$PKGBASEDIR/package.conf.d
GHC_VER=$(basename $PKGBASEDIR | sed -e s/ghc-//)
ghc_pkg="/usr/lib/rpm/ghc-pkg-wrapper $pkgbasedir"
# for a ghc build use the new ghc-pkg
INPLACE_GHCPKG=$PKGBASEDIR/../../bin/ghc-pkg-$GHC_VER
case $mode in
--provides) field=id ;;
--requires) field=depends ;;
*) echo "$(basename $0): Need --provides or --requires"
exit 1
;;
if [ -x "$INPLACE_GHCPKG" ]; then
case $GHC_VER in
7.8.*)
GHC_PKG="$PKGBASEDIR/bin/ghc-pkg --global-package-db=$PKGCONFDIR"
;;
7.6.*)
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-package-db=$PKGCONFDIR"
;;
*)
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-conf=$PKGCONFDIR"
;;
esac
else
GHC_PKG="/usr/bin/ghc-pkg-${GHC_VER}"
fi
case $MODE in
--provides) FIELD=id ;;
--requires) FIELD=depends ;;
*) echo "`basename $0`: Need --provides or --requires" ; exit 1
esac
ghc_ver=$(basename $pkgbasedir | sed -e s/ghc-//)
if [ -d "$PKGBASEDIR" ]; then
SHARED=$(find $PKGBASEDIR -type f -name '*.so')
fi
files=$(cat)
for i in $files; do
case $i in
# exclude builtin_rts.conf
$pkgconfdir/*-*.conf)
name=$(grep "^name: " $i | sed -e "s/name: //")
ids=$($ghc_pkg field $name $field | sed -e "s/rts//" -e "s/bin-package-db-[^ ]\+//")
for d in $ids; do
case $d in
*-*) echo "ghc-devel($d)" ;;
*) ;;
esac
done
;;
*)
;;
esac
LIB_FILE=$(echo $i | grep /libHS | egrep -v "/libHSrts")
if [ "$LIB_FILE" ]; then
if [ -d "$PKGCONFDIR" ]; then
META=""
SELF=""
case $LIB_FILE in
*.so) META=ghc ;;
*.a) META=ghc-devel
if [ "$SHARED" ]; then
SELF=ghc
fi
;;
esac
if [ "$META" ]; then
PKGVER=$(echo $LIB_FILE | sed -e "s%$PKGBASEDIR/\([^/]\+\)/libHS.*%\1%")
HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER $FIELD | sed -e "s/^$FIELD: \+//")
for i in $HASHS; do
case $i in
*-*) echo "$META($i)" ;;
*) ;;
esac
done
if [ "$MODE" = "--requires" -a "$SELF" ]; then
HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER id | sed -e "s/^id: \+//")
for i in $HASHS; do
echo "$SELF($i)"
done
fi
fi
fi
elif [ "$MODE" = "--requires" ]; then
if file $i | grep -q 'executable, .* dynamically linked'; then
BIN_DEPS=$(objdump -p $i | grep NEEDED | grep libHS | grep -v libHSrts | sed -e "s%^ *NEEDED *libHS\(.*\)-ghc${GHC_VER}\.so%\1%")
if [ -d "$PKGCONFDIR" ]; then
PACKAGE_CONF_OPT="--package-conf=$PKGCONFDIR"
fi
for p in ${BIN_DEPS}; do
HASH=$(${GHC_PKG} --global $PACKAGE_CONF_OPT field $p id | sed -e "s/^id: \+//" | uniq)
echo "ghc($HASH)"
done
fi
fi
done

View File

@ -1,32 +0,0 @@
#!/bin/sh
[ $# -lt 1 ] && echo "Usage: `basename $0` %{buildroot}%{ghclibdir} ..." && exit 1
set +x
PKGBASEDIR=$1
shift
PKGCONFDIR=$PKGBASEDIR/package.conf.d
GHC_VER=$(basename $PKGBASEDIR | sed -e s/ghc-//)
# for a ghc build use the new ghc-pkg
INPLACE_GHCPKG=$PKGBASEDIR/../../bin/ghc-pkg-$GHC_VER
if [ -x "$INPLACE_GHCPKG" ]; then
case $GHC_VER in
7.4.*)
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-conf=$PKGCONFDIR"
;;
7.6.*)
GHC_PKG="$PKGBASEDIR/ghc-pkg --global-package-db=$PKGCONFDIR"
;;
# 7.8 and 7.10
*)
GHC_PKG="env LD_LIBRARY_PATH=$(dirname $PKGBASEDIR) $PKGBASEDIR/bin/ghc-pkg --global-package-db=$PKGCONFDIR"
;;
esac
else
GHC_PKG="/usr/bin/ghc-pkg-${GHC_VER} -f $PKGCONFDIR"
fi
$GHC_PKG -v0 --simple-output $* | uniq

View File

@ -1,22 +1,22 @@
%global debug_package %{nil}
%if 0%{?fedora} || 0%{?rhel} >= 7
%global macros_dir %{_rpmconfigdir}/macros.d
%else
%global macros_dir %{_sysconfdir}/rpm
%endif
# uncomment to bootstrap without hscolour
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.9.6
Version: 1.2.20
Release: 1%{?dist}
Summary: RPM macros for building Haskell packages for GHC
Summary: RPM macros for building packages for GHC
License: GPLv3+
URL: https://github.com/fedora-haskell/ghc-rpm-macros
# Currently source is only in git but tarballs could be made if it helps
URL: https://fedoraproject.org/wiki/Packaging:Haskell
# This is a Fedora maintained package, originally made for
# the distribution. Hence the source is currently only available
# from this package. But it could be hosted on fedorahosted.org
# for example if other rpm distros would prefer that.
Source0: macros.ghc
Source1: COPYING
Source2: AUTHORS
@ -24,19 +24,21 @@ Source3: ghc-deps.sh
Source4: cabal-tweak-dep-ver
Source5: cabal-tweak-flag
Source6: macros.ghc-extra
Source7: ghc.attr
Source8: ghc-pkg-wrapper
Source9: macros.ghc-os
Source10: Setup.hs
Source11: cabal-tweak-drop-dep
Requires: redhat-rpm-config
Source7: ghc_bin.attr
Source8: ghc_lib.attr
Requires: ghc-srpm-macros
# macros.ghc-srpm moved out from redhat-rpm-config-21
Requires: redhat-rpm-config > 20-1.fc21
# for ghc_version
Requires: ghc-compiler
%if %{undefined without_hscolour}
%ifarch %{ix86} %{ix86} x86_64 ppc ppc64 alpha sparcv9 armv7hl armv5tel s390 s390x ppc64le aarch64
Requires: hscolour
%endif
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildArch: noarch
%endif
# for execstack (hack not needed for ghc-7.8)
%ifnarch ppc64le aarch64
Requires: prelink
%endif
%description
@ -48,72 +50,12 @@ these macros.
%package extra
Summary: Extra RPM macros for building Haskell library subpackages
Requires: %{name} = %{version}-%{release}
Requires: chrpath
%description extra
Extra macros used for subpackaging of Haskell libraries,
for example in ghc and haskell-platform.
# ideally packages should be obsoleted by some relevant package
# this is a last resort when there is no such appropriate package
%package -n ghc-obsoletes
Summary: Dummy package to obsolete deprecated Haskell packages
%if 0%{?fedora} >= 22
# these 3 no longer build with ghc-7.8
Obsoletes: ghc-ForSyDe < 3.1.2, ghc-ForSyDe-devel < 3.1.2
Obsoletes: ghc-parameterized-data < 0.1.6
Obsoletes: ghc-parameterized-data-devel < 0.1.6
Obsoletes: ghc-type-level < 0.2.5, ghc-type-level-devel < 0.2.5
Obsoletes: leksah < 0.14, ghc-leksah < 0.14, ghc-leksah-devel < 0.14
# dropped from HP 2014.2
Obsoletes: ghc-cgi < 3001.1.8, ghc-cgi-devel < 3001.1.8
%endif
%if 0%{?fedora} >= 24
Obsoletes: ghc-citeproc-hs < 0.3.10-3, ghc-citeproc-hs-devel < 0.3.10-3
Obsoletes: ghc-hakyll < 4.5.4.0-6, ghc-hakyll-devel < 4.5.4.0-6
Obsoletes: ghc-leksah-server < 0.14.3.1-4, ghc-leksah-server-devel < 0.14.3.1-4
%endif
%if 0%{?fedora} >= 25
Obsoletes: ghc-cmdtheline <= 0.2.3, ghc-cmdtheline-devel <= 0.2.3
Obsoletes: ghc-concrete-typerep <= 0.1.0.2, ghc-concrete-typerep-devel <= 0.1.0.2
Obsoletes: ghc-glade <= 0.12.5.0, ghc-glade-devel <= 0.12.5.0
Obsoletes: bluetile <= 0.6, bluetile-core <= 0.6
Obsoletes: ghc-lambdabot-utils <= 4.2.2, ghc-lambdabot-utils-devel <= 4.2.2
Obsoletes: haddock <= 2.14.3, ghc-haddock <= 2.14.3, ghc-haddock-devel <= 2.14.3
Obsoletes: ghc-monad-unify <= 0.2.2, ghc-monad-unify-devel <= 0.2.2
Obsoletes: idris <= 0.9.9.1
Obsoletes: ghc-editline < 0.2.1.1-13, ghc-editline-devel < 0.2.1.1-13
Obsoletes: ghc-hashed-storage < 0.5.11-4, ghc-hashed-storage-devel < 0.5.11-4
Obsoletes: ghc-nats <= 0.2, ghc-nats-devel <= 0.2
Obsoletes: ghc-primes <= 0.2.1.0-11, ghc-primes-devel <= 0.2.1.0-11
%endif
%if 0%{?fedora} >= 26
Obsoletes: ghc-geniplate <= 0.6.0.5, ghc-geniplate-devel <= 0.6.0.5
Obsoletes: ghc-sized-types <= 0.3.4.0, ghc-sized-types-devel <= 0.3.4.0
# dropped from HP 8.0.2
Obsoletes: ghc-cgi < 3001.2.2.2-5, ghc-cgi-devel < 3001.2.2.2-5
Obsoletes: ghc-multipart < 0.1.2-5, ghc-multipart-devel < 0.1.2-5
%endif
%if 0%{?fedora} >= 27
Obsoletes: ghc-webkit <= 0.14.2.1, ghc-webkit-devel <= 0.14.2.1
%endif
%if 0%{?fedora} >= 28
Obsoletes: ghc-fail < 4.9.0.0-2, ghc-fail-devel < 4.9.0.0-2
Obsoletes: ghc-ltk < 0.16, ghc-ltk-devel < 0.16
%endif
%if 0%{?fedora} >= 29
Obsoletes: ghc-content-store < 0.2.1-3, ghc-content-store-devel < 0.2.1-3
Obsoletes: ghc-bdcs < 0.6.1-3, ghc-bdcs-devel < 0.6.1-3
Obsoletes: ghc-bdcs-api < 0.1.3-3, ghc-bdcs-api-devel < 0.1.3-3
%endif
%description -n ghc-obsoletes
Meta package for obsoleting deprecated Haskell packages.
This package can safely be removed.
%prep
%setup -c -T
cp %{SOURCE1} %{SOURCE2} .
@ -126,462 +68,81 @@ echo no build stage needed
%install
install -p -D -m 0644 %{SOURCE0} %{buildroot}/%{macros_dir}/macros.ghc
install -p -D -m 0644 %{SOURCE6} %{buildroot}/%{macros_dir}/macros.ghc-extra
install -p -D -m 0644 %{SOURCE9} %{buildroot}/%{macros_dir}/macros.ghc-os
install -p -D -m 0755 %{SOURCE3} %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh
%if 0%{?fedora} || 0%{?rhel} >= 7
install -p -D -m 0644 %{SOURCE7} %{buildroot}/%{_prefix}/lib/rpm/fileattrs/ghc.attr
%endif
install -p -D -m 0644 %{SOURCE10} %{buildroot}/%{_datadir}/%{name}/Setup.hs
install -p -D -m 0644 %{SOURCE7} %{buildroot}/%{_prefix}/lib/rpm/fileattrs/ghc_bin.attr
install -p -D -m 0644 %{SOURCE8} %{buildroot}/%{_prefix}/lib/rpm/fileattrs/ghc_lib.attr
install -p -D -m 0755 %{SOURCE4} %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
install -p -D -m 0755 %{SOURCE11} %{buildroot}/%{_bindir}/cabal-tweak-drop-dep
install -p -D -m 0755 %{SOURCE8} %{buildroot}/%{_prefix}/lib/rpm/ghc-pkg-wrapper
%if 0%{?rhel} && 0%{?rhel} < 7
cat >> %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh <<EOF
# turn off shared libs and dynamic linking on secondary archs
%ifnarch %{ix86} x86_64
cat >> %{buildroot}/%{macros_dir}/macros.ghc <<EOF
echo \$files | tr [:blank:] '\n' | %{_rpmconfigdir}/rpmdeps --requires
# shared libraries are only supported on primary intel archs
%%ghc_without_dynamic 1
%%ghc_without_shared 1
EOF
%endif
%files
%license COPYING
%doc AUTHORS
%doc COPYING AUTHORS
%{macros_dir}/macros.ghc
%{macros_dir}/macros.ghc-os
%if 0%{?fedora} || 0%{?rhel} >= 7
%{_prefix}/lib/rpm/fileattrs/ghc.attr
%endif
%{_prefix}/lib/rpm/fileattrs/ghc_bin.attr
%{_prefix}/lib/rpm/fileattrs/ghc_lib.attr
%{_prefix}/lib/rpm/ghc-deps.sh
%{_prefix}/lib/rpm/ghc-pkg-wrapper
%{_bindir}/cabal-tweak-dep-ver
%{_bindir}/cabal-tweak-drop-dep
%{_bindir}/cabal-tweak-flag
%{_datadir}/%{name}/Setup.hs
%files extra
%{macros_dir}/macros.ghc-extra
%if 0%{?fedora} >= 22
%files -n ghc-obsoletes
%endif
%changelog
* Fri Feb 1 2019 Jens Petersen <petersen@redhat.com> - 1.9.6-1
- disable debuginfo by undefining _enable_debug_packages
- leave stripping to generic rpm macros
- use C.utf8 locale for building instead of en_US.utf8
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Oct 25 2018 Jens Petersen <petersen@redhat.com> - 1.9.5-5
- need to disable -Werror=format-security too on s390x
* Wed Oct 24 2018 Jens Petersen <petersen@redhat.com> - 1.9.5-4
- silence C compiler Wunused-label warnings flood on s390x again
* Tue Oct 23 2018 Jens Petersen <petersen@redhat.com> - 1.9.5-3
- f29: obsolete content-store, bdcs, and bdcs-api
* Sat Oct 6 2018 Jens Petersen <petersen@redhat.com> - 1.9.5-2
- fix ghc_set_gcc_flags name
* Sat Oct 6 2018 Jens Petersen <petersen@redhat.com> - 1.9.5-1
- disable hardened ldflags again
* Fri Oct 5 2018 Jens Petersen <petersen@redhat.com> - 1.9.4-1
- cabal_configure now uses ghc_set_gcc_flags
* Fri Oct 5 2018 Jens Petersen <petersen@redhat.com> - 1.9.3-1
- disable dynamic linking of executables for better portability
- replace ghc_set_cflags with simplified ghc_set_gcc_flags
* Tue Jul 31 2018 Jens Petersen <petersen@redhat.com> - 1.9.2-1
- inject a Setup.hs if none shipped
* Tue Jul 24 2018 Jens Petersen <petersen@redhat.com> - 1.9.1-1
- remove -Wall and -Werror=format-security separately (on aarch64 and s390x)
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu May 24 2018 Jens Petersen <petersen@redhat.com> - 1.9.0-1
- support Cabal bundled internal libraries (yuck)
- ghc_check_bootstrap should be redundant now according to upstream
- rename ghc_bootstrap to ghc_quick_build (disables prof and haddock)
* Mon Apr 30 2018 Jens Petersen <petersen@redhat.com> - 1.8.7-6
- obsolete ghc-fail
* Sat Apr 7 2018 Robert-André Mauchin <zebob.m@gmail.com> - 1.8.7-5
- drop hash from pkgdir in ghc_gen_filelists too
* Thu Apr 5 2018 Jens Petersen <petersen@redhat.com> - 1.8.7-4
- configure libexecsubdir (Cabal-2 only) (#1563863)
- drop hash from libsubdir
* Tue Mar 6 2018 Jens Petersen <petersen@redhat.com> - 1.8.7-3
- obsolete ghc-ltk
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Feb 3 2018 Jens Petersen <petersen@redhat.com> - 1.8.7-1
- no longer need to prune -z defs from LDFLAGS
- drop the ldconfig scripts since they are not needed for F28
* Mon Jan 29 2018 Jens Petersen <petersen@redhat.com> - 1.8.6-1
- cabal-tweak-drop-dep: quote grep pattern to allow whitespace
* Sun Jan 28 2018 Jens Petersen <petersen@redhat.com> - 1.8.5-1
- re-enable _ghcdynlibdir (for ghc-8.2)
* Sun Jan 28 2018 Jens Petersen <petersen@redhat.com> - 1.8.4-1
- make the recent dynlib packaging changes conditional on _ghcdynlibdir
- temporarily disable _ghcdynlibdir for Rawhide
* Thu Jan 25 2018 Jens Petersen <petersen@redhat.com> - 1.8.3-1
- remove "-z defs" from LDFLAGS since it breaks linking with ghc (see #1535422)
* Tue Jan 23 2018 Jens Petersen <petersen@redhat.com> - 1.8.1-1
- ghc_fix_rpath: remove leading or trailing ':'
* Mon Jan 22 2018 Jens Petersen <petersen@redhat.com> - 1.8.0-1
- add _ghcdynlibdir for Cabal --dynlibdir
- dynlibs in _libdir
- drop ghc_without_shared
- ghc_fix_rpath removes RPATHs for 8.2+
- add ldconfig install scripts to ghc_lib_subpackage
* Mon Dec 4 2017 Jens Petersen <petersen@fedoraproject.org> - 1.6.51-1
- add ghc_set_cflags macro
* Wed Nov 15 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-9
- obsolete ghc-webkit (#1375825)
* Wed Nov 15 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-8
- rename macros.ghc-fedora to macros.ghc-os
* Wed Nov 15 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-7
- use shell variable instead of macro to carry licensedir version
* Tue Nov 14 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-6
- make package noarch RHEL > 7
- only version license dir for RHEL <= 7
* Fri Nov 10 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-5
- -Werror=format-security fails without -Wall
* Fri Nov 10 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-4
- do not set -Wall on aarch64 and s390x since -Wunused-label is extremely noisy
* Fri Nov 10 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-3
- temporarily set Wall for all archs to see which are noisy
* Tue Oct 10 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-2
- drop the git-annex obsoletes
* Wed Sep 13 2017 Jens Petersen <petersen@redhat.com> - 1.6.50-1
- make some macro call args explicit for rpm-4.14 scope change
(this breaks builds with earlier versions of rpm)
- fix the package.conf existence check
* Wed Aug 2 2017 Jens Petersen <petersen@redhat.com>
- ghc_gen_filelists: check package.conf exists
* Sun Jul 30 2017 Jens Petersen <petersen@redhat.com> - 1.6.20-2
- make package noarch again for f27
* Sun Jul 30 2017 Jens Petersen <petersen@redhat.com> - 1.6.20-1
- add _ghclicensedir macro
- add ghc_smp_mflags macro, since -j4 breaks reproducible-builds.org completely
(report by Bernhard Wiedemann)
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.19-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu May 11 2017 Jens Petersen <petersen@redhat.com> - 1.6.19-2
- obsolete git-annex
* Fri Mar 24 2017 Jens Petersen <petersen@redhat.com> - 1.6.19-1
- fix haddock generation
- cabal_configure now outputs Cabal version
- fix ghc-deps.sh for ghc-pkg < 8 which does not accept pkg id
- fix ghc_fix_rpath for ghc-7.10
- Group and defattr are only needed for rhel5
* Thu Mar 16 2017 Jens Petersen <petersen@redhat.com> - 1.6.18-3
- condition obsoletes on fedora version
- add f26 obsoletes for cgi and multipart
* Sun Mar 12 2017 Jens Petersen <petersen@redhat.com> - 1.6.18-2
- obsolete geniplate and sized-types for F26
* Thu Mar 2 2017 Jens Petersen <petersen@redhat.com> - 1.6.18-1
- fix ghc_fix_rpath, ghc_gen_filelists, and ghc-deps.sh when pkg-ver already
installed
- ghc_bin_install and ghc_lib_install now run ghc_fix_rpath on subpkgs
* Wed Feb 22 2017 Jens Petersen <petersen@redhat.com> - 1.6.17-1
- setup --global/--user in cabal_configure
- allow subpackage names to contain digits
* Wed Feb 22 2017 Jens Petersen <petersen@redhat.com> - 1.6.16-1
- fix generation of haddock's
- fix fixing of rpaths for subpackages
* Tue Feb 14 2017 Jens Petersen <petersen@redhat.com> - 1.6.15-2
- do not set CFLAGS on ppc64 or ppc64le due to -Wunused-label noise
* Mon Feb 13 2017 Jens Petersen <petersen@redhat.com> - 1.6.15-1
- fix handling of ghc's .files with new ghc_lib_subpackage -d option
* Fri Feb 10 2017 Jens Petersen <petersen@redhat.com> - 1.6.14-1
- if ghc_subpackaging set configure with --user otherwise --global
* Thu Feb 9 2017 Jens Petersen <petersen@redhat.com> - 1.6.13-1
- build subpackages inside main package directory
* Wed Feb 8 2017 Jens Petersen <petersen@redhat.com> - 1.6.12-1
- no longer use a topdir for subpackage building
- only autopackage license if subpackaging
- add new cabal-tweak-drop-dep script for excluding trivial deps
- move uniq to ghc-pkg-wrapper
- add macros.ghc-fedora for Fedora specific config
- replace cabal_verbose with cabal_configure_verbose, cabal_build_verbose,
cabal_install_verbose, cabal_haddock_verbose, and cabal_test_verbose
- new _ghcdocdir
* Fri Dec 2 2016 Jens Petersen <petersen@redhat.com> - 1.6.11-2
- add more F25 obsoletes for: editline, hashed-storage, nats, primes
* Fri Nov 25 2016 Jens Petersen <petersen@redhat.com> - 1.6.11-1
- re-enable dynlink on armv7hl and aarch64 since binutils was fixed (#1386126)
- condition use of _defaultlicensedir
- quote some echo'd macros
* Mon Oct 31 2016 Jens Petersen <petersen@redhat.com> - 1.6.10-2
- only disable arm dynlinking for f26 (#1386126)
* Wed Oct 26 2016 Jens Petersen <petersen@redhat.com> - 1.6.10-1
- make ghc_lib_subpackage backward compatible with older 2 args form
* Mon Oct 17 2016 Jens Petersen <petersen@redhat.com> - 1.6.9-8
- disable dynlinking on armv7hl too (#1386126)
* Mon Oct 17 2016 Jens Petersen <petersen@redhat.com> - 1.6.9-7
- set LDFLAGS for aarch64 again
- disable dynamic linking for aarch64 since it fails (#1386126)
* Mon Oct 17 2016 Jens Petersen <petersen@redhat.com> - 1.6.9-6
- only pass CFLAGS and LDFLAGS to ghc if set
* Mon Oct 17 2016 Jens Petersen <petersen@redhat.com> - 1.6.9-5
- for aarch64 do not set CFLAGS and LDFLAGS
* Wed Oct 12 2016 Jens Petersen <petersen@redhat.com> - 1.6.9-4
- remove Agda obsoletes
* Tue Oct 4 2016 Jens Petersen <petersen@redhat.com> - 1.6.9-3
- obsolete idris
* Tue Sep 27 2016 Jens Petersen <petersen@redhat.com> - 1.6.9-2
- macros.ghc-extra requires chrpath
* Tue Sep 27 2016 Jens Petersen <petersen@redhat.com> - 1.6.9-1
- new ghc_fix_rpath macro deprecates ghc_fix_dynamic_rpath
- ghc-pkg-wrapper: quieter and simple output
- ghc_libs_install now runs ghc_fix_rpath to fix subpackage rpaths
* Tue Sep 6 2016 Jens Petersen <petersen@redhat.com> - 1.6.8-1
- set Cabal docdir to licensedir so licenses end up in right place
* Thu Sep 1 2016 Jens Petersen <petersen@redhat.com> - 1.6.7-1
- ghc_lib_subpackage now takes name-version processed with lua
* Fri Aug 26 2016 Jens Petersen <petersen@redhat.com> - 1.6.6-1
- ghc_gen_filelists: support packages with more than one license file
- move licenses from docdir to licensedir instead of removing,
also for ghc_bin_install
* Thu Aug 25 2016 Jens Petersen <petersen@redhat.com> - 1.6.5-1
- ghc_gen_filelists now handles license files automatically
* Wed Aug 17 2016 Jens Petersen <petersen@redhat.com> - 1.6.4-1
- add ghc_libs_build and ghc_libs_install to ease bundling libraries
- drop _smp_mflags for now since it can overwhelm armv7hl
* Sat Aug 6 2016 Jens Petersen <petersen@redhat.com> - 1.6.3-1
- cabal_verbose from github fedora-haskell/ghc-rpm-macros
* Fri Jul 22 2016 Jens Petersen <petersen@redhat.com> - 1.6.2-4
- try obsoleting Agda
* Wed Jul 20 2016 Jens Petersen <petersen@redhat.com> - 1.6.2-3
- obsolete cmdtheline, concrete-typerep, glade, bluetile, lambdabot-utils,
haddock, monad-unify
* Wed Jun 22 2016 Jens Petersen <petersen@redhat.com> - 1.6.2-2
- obsoletes for hakyll and leksah-server
* Mon Jun 13 2016 Jens Petersen <petersen@redhat.com> - 1.6.2-1
- ghc_gen_filelists: uniq keyname to prevent build failure for installed version
* Mon Jun 6 2016 Jens Petersen <petersen@redhat.com> - 1.6.1-1
- disable debuginfo again until working
* Fri Jun 3 2016 Jens Petersen <petersen@redhat.com> - 1.6.0-1
- enable debuginfo package
- ghc-7.10 support from copr http://github.com/fedora-haskell/ghc-rpm-macros:
- ghc_gen_filelists: determine keyname with pkgnamever not just pkgname
(fixes building newer version of installed package)
- use _rpmconfigdir macro
- support el6 (no fileattrs or /usr/lib/rpm/macros.d)
- change url to github
- add and use ghc-pkg-wrapper script
- use ghc-pkg key field (for ghc-7.10)
- configure libsubdir using pkgkey like ghc-cabal
- handle no ghc-srpm-macros for fedora < 21
- fix ghc-pkg path in ghc-deps.sh for ghc-7.10
- update ghc_gen_filelists to use new keyed library filepaths
and specify libHS*.so more loosely
- ghc-dep.sh now just makes versioned devel reqs
- rename ghc_lib.attr to ghc.attr and drop ghc_bin.attr
* Tue Mar 8 2016 Jens Petersen <petersen@redhat.com> - 1.4.15-5
- add ghc-citeproc-hs to obsoletes
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.15-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Jens Petersen <petersen@redhat.com> - 1.4.15-3
- reenable dynamic linking for aarch64 (#1195231)
* Mon May 25 2015 Jens Petersen <petersen@redhat.com> - 1.4.15-2
- add leksah to ghc-obsoletes
* Thu May 7 2015 Jens Petersen <petersen@redhat.com> - 1.4.15-1
* Thu Oct 8 2015 Jens Petersen <petersen@redhat.com> - 1.2.20-1
- cabal macro now sets utf8 locale
- disable dynamic linking on aarch64 as a workaround (#1195231)
* Thu Apr 2 2015 Jens Petersen <petersen@redhat.com> - 1.4.14-1
- add explicit --enable-shared again for arm64
* Mon Mar 23 2015 Jens Petersen <petersen@redhat.com> - 1.4.13-1
- fix ghc-deps.sh for ghc builds:
- use .a files again instead of .conf for devel deps
- extract pkg-ver from library filename rather than directory
(should also work for 7.10)
- introduce ghc_pkgdocdir since no _pkgdocdir in RHEL 7 and earlier
* Sat Mar 7 2015 Jens Petersen <petersen@fedoraproject.org> - 1.4.12-1
- version ghc-pkg in ghc_pkg_recache
- allow overriding ghc- prefix with ghc_name (for ghc784 etc)
* Fri Mar 6 2015 Jens Petersen <petersen@redhat.com> - 1.4.11-2
- add ghc-obsoletes dummy subpackage for obsoleting deprecated packages
- initially: ForSyDe, parameterized-data, type-level, and cgi for F22
* Mon Mar 2 2015 Jens Petersen <petersen@redhat.com> - 1.4.11-1
- fix ghc-deps.sh to handle meta-packages
- configure --disable-shared if ghc_without_shared
* Fri Feb 27 2015 Jens Petersen <petersen@fedoraproject.org> - 1.4.10-1
- have to turn off hardening in cabal_configure: set _hardened_ldflags to nil
* Fri Feb 27 2015 Jens Petersen <petersen@fedoraproject.org> - 1.4.9-1
- turn off _hardened_build for libraries since it breaks linking
<https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code>
* Sun Feb 1 2015 Jens Petersen <petersen@redhat.com> - 1.4.8-1
- drop cabal_tests_not_working since not all tests failing on ARMv7
* Sat Jan 31 2015 Jens Petersen <petersen@redhat.com> - 1.4.7-1
- fix arch for cabal_tests_not_working
- add cabal_test macro which uses it
* Sat Jan 31 2015 Jens Petersen <petersen@redhat.com> - 1.4.6-1
- disable Cabal tests on armv7 since they give an internal error
https://ghc.haskell.org/trac/ghc/ticket/10029
- fix building of meta packages:
- only run cabal haddock for real libraries with modules
- make sure basepkg.files is also created for meta packages
* Sat Jan 31 2015 Jens Petersen <petersen@redhat.com> - 1.4.5-1
- fix the R*PATH regexp
* Sat Jan 31 2015 Jens Petersen <petersen@redhat.com> - 1.4.4-1
- ghc_fix_dynamic_rpath: on ARMv7 RPATH is RUNPATH
* Thu Jan 22 2015 Jens Petersen <petersen@redhat.com> - 1.4.3-1
* Thu Jan 22 2015 Jens Petersen <petersen@redhat.com> - 1.2.19-1
- version ghcpkgdocdir
- add new names ghc_html_dir, ghc_html_libraries_dir, and ghc_html_pkg_dir
* Thu Jan 22 2015 Jens Petersen <petersen@redhat.com> - 1.4.2-1
- correct cabal-tweak-flag error message for missing flag (#1184508)
* Sat Jan 17 2015 Jens Petersen <petersen@redhat.com> - 1.4.1-1
- revert to versioned doc htmldirs
* Sat Jan 17 2015 Jens Petersen <petersen@redhat.com> - 1.4.0-1
- enable shared libraries and dynamic linking on all arch's
since ghc-7.8 now supports that
- disable debuginfo until ghc-7.10 which will support dwarf debugging output
(#1138982)
* Mon Jan 19 2015 Jens Petersen <petersen@redhat.com> - 1.2.18-1
- exclude -Wall from CFLAGS to prevent Cabal configure warning with ghc-7.6
(#1175667)
* Fri Nov 14 2014 Jens Petersen <petersen@redhat.com> - 1.3.10-1
* Fri Nov 14 2014 Jens Petersen <petersen@redhat.com> - 1.2.17-1
- split ghc.attr into ghc_lib.attr and ghc_bin.attr for finer grained handling
- require ghc-compiler for ghc_version
* Mon Oct 27 2014 Jens Petersen <petersen@redhat.com> - 1.3.9-1
- macros.ghc: cabal_configure now passes CFLAGS and LDFLAGS to ghc (#1138982)
(thanks to Sergei Trofimovich and Ville Skyttä)
* Thu Oct 23 2014 Jens Petersen <petersen@redhat.com> - 1.3.8-1
- ghc-deps.sh: support ghc-pkg for ghc builds <= 7.4.2 as well
* Thu Oct 16 2014 Jens Petersen <petersen@redhat.com> - 1.3.7-1
* Thu Oct 16 2014 Jens Petersen <petersen@redhat.com> - 1.2.16-1
- ghc.attr needs to handle requires for /usr/bin files too
* Wed Sep 10 2014 Jens Petersen <petersen@redhat.com> - 1.3.6-1
* Wed Sep 10 2014 Jens Petersen <petersen@redhat.com> - 1.2.15-1
- improve ghc_fix_dynamic_rpath not to assume cwd = pkg_name
* Fri Aug 29 2014 Jens Petersen <petersen@redhat.com> - 1.3.5-1
- no longer disable debuginfo by default:
packages now need to explicitly opt out of debuginfo if appropriate
* Thu Aug 28 2014 Jens Petersen <petersen@redhat.com> - 1.3.4-1
- drop -O2 for ghc-7.8: it uses too much build mem
* Fri Aug 22 2014 Jens Petersen <petersen@redhat.com> - 1.3.3-1
- temporarily revert to ghc-7.6 config for shared libs
until we move to ghc-7.8
* Thu Aug 21 2014 Jens Petersen <petersen@redhat.com> - 1.3.2-1
- drop -O2: it often uses too much build mem
- add an rpm .attr file for ghc-deps.sh rather than running it
as an external dep generator (#1132275)
(see http://rpm.org/wiki/PackagerDocs/DependencyGenerator)
* Wed Aug 20 2014 Jens Petersen <petersen@redhat.com> - 1.3.1-1
* Wed Aug 20 2014 Jens Petersen <petersen@redhat.com> - 1.2.14-1
- fix warning in macros.ghc-extra about unused pkgnamever
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-2
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Aug 2 2014 Jens Petersen <petersen@redhat.com> - 1.3.0-1
- shared libs available for all archs in ghc-7.8
- cabal_configure --disable-shared with ghc_without_shared
- ghc_clear_execstack no longer needed
* Fri Jun 27 2014 Jens Petersen <petersen@redhat.com> - 1.2.13-2
- ghc-srpm-macros is now a separate source package

View File

@ -1,3 +0,0 @@
%__ghc_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot}%{ghclibdir}
%__ghc_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
%__ghc_path ^%{ghclibdir}/package.conf.d/.*\.conf$

3
ghc_bin.attr Normal file
View File

@ -0,0 +1,3 @@
%__ghc_bin_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
%__ghc_bin_magic executable, .* dynamically linked
%__ghc_bin_flags exeonly

3
ghc_lib.attr Normal file
View File

@ -0,0 +1,3 @@
%__ghc_lib_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot}%{ghclibdir}
%__ghc_lib_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir}
%__ghc_lib_path ^%{ghclibdir}/.*/libHS.*\\.(so|a)$

View File

@ -2,42 +2,37 @@
# see https://fedoraproject.org/wiki/Packaging:Haskell for more details
# "cabal"
%cabal [ -x Setup ] || ghc --make %{!?ghc_user_conf:-no-user-package-db} %{!?ghc_static_setup:-dynamic} Setup\
LANG=C.utf8\
%cabal [ -x Setup ] || ghc --make %{!?ghc_user_conf:-no-user-package-db} %{!?ghc_without_dynamic:-dynamic} Setup\
LANG=en_US.utf8\
./Setup
# compiler version
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
%ghc_set_gcc_flags\
# -Wunused-label is extremely noisy\
%ifarch s390x\
CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall //' -e 's/-Werror=format-security //')}"\
%else\
CFLAGS="${CFLAGS:-%optflags}"\
# check ghc version was rebuilt against self
%ghc_check_bootstrap\
if [ ! "$(ghc --info | grep \\"Booter\\ version\\",\\"%{ghc_version}\\")" ]; then\
echo "Warning: this ghc build is not self-bootstrapped."\
%if %{undefined ghc_bootstrapping}\
echo "The ghc package should be rebuilt against its current version before\
proceeding, to avoid dependency ABI breakage from a future ghc rebuild."\
echo "To override set ghc_bootstrapping."\
echo "Aborting."\
exit 1\
%endif\
export CFLAGS\
%global _hardened_ldflags %{nil}\
export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"\
%{nil}
fi
# configure
%cabal_configure\
%ghc_set_gcc_flags\
if ! [ -f Setup.hs -o -f Setup.lhs ]; then\
cp %{_datadir}/ghc-rpm-macros/Setup.hs .\
fi\
%cabal --version\
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --libexecsubdir='$pkgid' --ghc %{?_ghcdynlibdir:--dynlibdir=%{_ghcdynlibdir}} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')}" --disable-executable-stripping --disable-library-stripping %{?cabal_configure_options} $cabal_configure_extra_options
%ghc_check_bootstrap\
CFLAGS="${CFLAGS:-%optflags}"; export CFLAGS\
LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS\
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{ghc_pkgdocdir} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} --ghc-options="$(echo ' '$CFLAGS | sed -e 's/-Wall -Werror=format-security //' -e 's/ / -optc/g') $(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')" %{?cabal_configure_options} $cabal_configure_extra_options
# install
%cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options}
%cabal_install %cabal copy --destdir=%{buildroot} -v
# tests
tests
%cabal_test\
%if %{with tests}\
%cabal test %{?cabal_test_options}\
%cabal test\
%endif
# no _pkgdocdir in EPEL <= 7
@ -46,56 +41,45 @@ fi\
# root dir for ghc docs (used by ghc.spec)
%ghc_html_dir %{_docdir}/ghc/html
# deprecates
%ghcdocbasedir %ghc_html_dir
%ghcdocbasedir %{_docdir}/ghc/html
# libraries doc dir (internal)
%ghc_html_libraries_dir %{ghc_html_dir}/libraries
# deprecates
%ghclibdocdir %ghc_html_libraries_dir
%ghclibdocdir %{ghcdocbasedir}/libraries
# pkg doc dir
%ghc_html_pkg_dir %{ghc_html_libraries_dir}/%{pkg_name}-%{version}
# deprecates
%ghcpkgdocdir %ghc_html_pkg_dir
%ghcpkgdocdir %{ghclibdocdir}/%{pkg_name}-%{version}
# top library dir
%ghclibdir %{_libdir}/ghc-%{ghc_version}
%_ghclicensedir %{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}
# ghc_gen_filelists [name] [version]
%ghc_gen_filelists()\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
%define pkgnamever %{pkgname}-%{pkgver}\
%define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\
%define basepkg ghc-%{pkgname}\
%define pkgdir %{ghclibdir}/%{pkgnamever}\
%define docdir %{ghclibdocdir}/%{pkgnamever}\
if [ -z "$(ls %{buildroot}%{ghclibdir}/package.conf.d/)" ]; then\
echo "%{buildroot}%{ghclibdir}/package.conf.d/*.conf not found"\
exit 1\
fi\
rm -f %{basepkg}.files %{basepkg}-devel.files\
touch %{basepkg}.files %{basepkg}-devel.files\
ls %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
pkgdir="%{ghclibdir}/%{pkgnamever}"\
if [ -d "%{buildroot}${pkgdir}" ]; then\
%if %{defined _ghcdynlibdir}\
echo "${pkgdir}" >> %{basepkg}-devel.files\
%else\
echo "%%dir ${pkgdir}" >> %{basepkg}.files\
find %{buildroot}${pkgdir} -mindepth 1 -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
find %{buildroot}${pkgdir} ! \\( -type d -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\
if [ -d "%{buildroot}%{pkgdir}" ]; then\
echo "%dir %{pkgdir}" >> %{basepkg}.files\
%if %{undefined ghc_without_shared}\
echo "%attr(755,root,root) %{pkgdir}/libHS%{pkgnamever}-ghc%{ghc_version}.so" >> %{basepkg}.files\
%endif\
echo "%%attr(755,root,root) %{?_ghcdynlibdir}%{!?_ghcdynlibdir:${pkgdir}}/libHS%{pkgnamever}-*ghc%{ghc_version}.so" >> %{basepkg}.files\
fi\
echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\
if [ -d "%{buildroot}%{pkgdir}" ]; then\
find %{buildroot}%{pkgdir} -mindepth 1 -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
find %{buildroot}%{pkgdir} ! \\( -type d -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\
fi\
if [ -d "%{buildroot}%{docdir}" ]; then\
echo "%{docdir}" >> %{basepkg}-devel.files\
fi\
%if 0%{?1:1}\
for i in $(ls %{buildroot}%{_ghclicensedir}/%{!?1:%{name}}%{?1:%{basepkg}}); do\
echo "%%license %{?1:%{pkgnamever}/}$i" >> %{basepkg}.files\
done\
%endif\
for i in %{basepkg}.files %{basepkg}-devel.files; do\
if [ -f "$i" ]; then\
sed -i -e "s!%{buildroot}!!g" $i\
@ -103,6 +87,9 @@ fi\
done\
%{nil}
# compiler version
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
# create and install package.conf file
# cabal_pkg_conf [name] [version]
%cabal_pkg_conf()\
@ -110,117 +97,82 @@ done\
%define pkgver %{?2}%{!?2:%{version}}\
%define pkgnamever %{pkgname}-%{pkgver}\
%cabal register --gen-pkg-config\
if [ -d %{pkgnamever}.conf ]; then\
for i in $(ls "%{pkgnamever}.conf/"); do\
sub=$(echo $i | sed -e "s/^[0-9]\\+-//")\
install -D --mode=0644 %{pkgnamever}.conf/${i} %{buildroot}%{ghclibdir}/package.conf.d/${sub}.conf\
done\
else\
install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.d/%{pkgnamever}.conf\
fi\
%{nil}
# ghc_bin_build
%ghc_bin_build\
%undefine _enable_debug_packages\
%global debug_package %{nil}\
%cabal_configure\
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}
%cabal build
# ghc_lib_build_without_haddock [name] [version]
%ghc_lib_build_without_haddock()\
%undefine _enable_debug_packages\
%if 0%{?rhel} && 0%{?rhel} < 8\
licensedirversion=%{?2:-%2}\
%endif\
%cabal_configure %{!?without_prof:-p} --enable-shared %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1${licensedirversion} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}\
%global debug_package %{nil}\
%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_docdir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1-%2} %{!?1:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build\
%{nil}
# ghc_lib_build [name] [version]
%ghc_lib_build()\
%ghc_lib_build_without_haddock %{?1} %{?2}\
%ghc_lib_build_without_haddock\
%if %{undefined without_haddock}\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
if [ -n dist/build/libHS%{pkgname}-%{pkgver}*.so ]; then\
%cabal haddock --html --hyperlink-source --hoogle %{?cabal_haddock_options}\
if [ -f dist/build/libHS%{pkgname}-%{pkgver}.a ]; then\
%cabal haddock --html %{!?without_hscolour:%(if [ -x %{_bindir}/HsColour ]; then echo --hyperlink-source; fi)} --hoogle\
fi\
%endif\
%{nil}
# ghc_strip_dynlinked
%ghc_strip_dynlinked\
%if %{undefined __debug_package}\
find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -exec strip "{}" \\;\
%endif
# ghc_clear_execstack
%ghc_clear_execstack\
if [ -d "%{buildroot}%{_bindir}" -a -x "%{_bindir}/execstack" ]; then\
find %{buildroot}%{_bindir} -type f -exec sh -c "file {} | grep -q ' ELF '" \\; -exec %{_bindir}/execstack -c "{}" \\;\
fi
# install bin package
%ghc_bin_install()\
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
%cabal_install\
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
%{!?1:%ghc_strip_dynlinked}\
%{!?1:%ghc_clear_execstack}\
%{nil}
# ghc_lib_install [name] [version]
%ghc_lib_install()\
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
%{!?_fileattrsdir:%global __find_provides %{_rpmconfigdir}/rpmdeps --provides}\
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
%cabal_install\
%cabal_pkg_conf %{?1} %{?2}\
%ghc_gen_filelists %{?1} %{?2}\
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
%cabal_pkg_conf\
%ghc_gen_filelists\
%{!?1:%ghc_strip_dynlinked}\
%{!?1:%ghc_clear_execstack}\
%{nil}
# ghc_fix_rpath lib-ver ...
%ghc_fix_rpath()\
%if %{undefined ghc_without_dynamic}\
if ! type chrpath > /dev/null; then exit 1; fi\
for i in $(find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\
for lib in %*; do\
if [ -x "$i" ]; then\
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
case $rpath in\
*$PWD/$lib/dist/build*)\
case %{ghc_version} in\
7.10.*)\
pkgid=$(cd %{buildroot}%{ghclibdir}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $pkgid library-dirs) ;;\
8.0)\
pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\
*)\
syspath="" ;;\
esac\
newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g" -e "s/::/:/" -e "s/^://" -e "s/:$//")\
chrpath -r $newrpath $i\
;;\
esac\
else\
echo "%%ghc_fix_rpath: no $i executable"\
exit 1\
fi\
done\
done\
%endif\
%{nil}
# Deprecated by ghc_fix_rpath:
# ghc_fix_dynamic_rpath prog ...
%ghc_fix_dynamic_rpath()\
%if %{undefined ghc_without_dynamic}\
if ! type chrpath > /dev/null; then exit 1; fi\
pdir=$(pwd)\
PDIR=$(pwd)\
for i in %*; do\
case $i in\
/*) prog=%{buildroot}$i ;;\
*) prog=%{buildroot}%{_bindir}/$i ;;\
/*) PROG=%{buildroot}$i ;;\
*) PROG=%{buildroot}%{_bindir}/$i ;;\
esac\
if [ -x "$prog" ]; then\
rpath=$(chrpath $prog | sed -e "s@^$prog: R.*PATH=@@")\
case $rpath in\
*$pdir*)\
newrpath=$(echo $rpath | sed -e "s@$pdir/dist/build@%{ghclibdir}/%{pkg_name}-%{version}@g")\
chrpath -r $newrpath $prog\
if [ -x "$PROG" ]; then\
RPATH=$(chrpath $PROG | sed -e "s@^$PROG: R.*PATH=@@")\
case $RPATH in\
*$PDIR*)\
NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR/dist/build@%{ghclibdir}/%{pkg_name}-%{version}@g")\
chrpath -r $NEWRPATH $PROG\
;;\
esac\
else\
echo "%%ghc_fix_dynamic_rpath: no such file $prog"\
echo "%%ghc_fix_dynamic_rpath: no such file $PROG"\
exit 1\
fi\
done\
@ -229,13 +181,17 @@ done\
%ghc_pkg_recache %{_bindir}/ghc-pkg-%{ghc_version} recache --no-user-package-db || :
# deprecated
%ghc_bootstrap\
# - without_hscolour, without_testsuite, and ghc_bootstrapping
# need to be set locally in the spec file
# skip prof libs, and documentation
%ghc_test\
%global without_prof 1\
%global without_haddock 1\
%global without_manual 1
# skip prof libs and documentation
%ghc_quick_build\
%global without_prof 1\
%global without_haddock 1
# skip shared and prof libs, documentation, and testsuite
%ghc_bootstrap\
%global ghc_without_shared 1\
%global ghc_without_dynamic 1\
%ghc_test

View File

@ -1,43 +1,28 @@
# RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*-
# ghc_lib_subpackage [-c cdepslist] [-d] [-l licensetag] [-x] [name-version]
# for backward compat also support: ghc_lib_subpackage name version
%ghc_lib_subpackage(c:dl:x)\
%define pkgname %{?2:%{1}}%{!?2:%{lua:\
local pv = rpm.expand("%1")\
local _, _, name = string.find(pv, "^([%a%d-]+)-")\
print(name)\
}}\
%define pkgver %{?2}%{!?2:%{lua:\
local pv = rpm.expand("%1")\
print(string.sub(pv, string.find(pv, "[%d.]+$")))\
}}\
# ghc_lib_subpackage [-c cdepslist] [-l licensetag] [-x] [name] [version]
%ghc_lib_subpackage(c:l:x)\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
%define pkgver %{?2}%{!?2:%{version}}\
%{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\
%define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\
%define basepkg %{ghc_prefix}-%{pkgname}\
%define basepkg ghc-%{pkgname}\
%package -n %{basepkg}\
Summary: Haskell %{pkgname} library\
%if 0%{?rhel} && 0%{?rhel} < 6\
Group: System/Libraries\
%endif\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
Url: http://hackage.haskell.org/package/%{pkgname}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(%{ghc_prefix}-[^, ]*\\)-devel/\\1/g")}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1/g")}\
\
%description -n %{basepkg}\
This package provides the Haskell %{pkgname} library.\
\
%package -n %{basepkg}-devel\
Summary: Haskell %{pkgname} library development files\
%if 0%{?rhel} && 0%{?rhel} < 6\
Group: Development/Languages/Other\
%endif\
%{?1:Version: %{pkgver}}\
%{-l:License: %{-l*}}\
Requires(post): %{ghc_prefix}-compiler = %{ghc_version}\
Requires(postun): %{ghc_prefix}-compiler = %{ghc_version}\
Requires: %{ghc_prefix}-%{pkgname}%{?_isa} = %{pkgver}-%{release}\
Requires(post): ghc-compiler = %{ghc_version}\
Requires(postun): ghc-compiler = %{ghc_version}\
Requires: ghc-%{pkgname}%{?_isa} = %{pkgver}-%{release}\
%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}\
%{-c:Requires: %{-c*}}\
%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
@ -51,50 +36,9 @@ This package provides the Haskell %{pkgname} library development files.\
%postun -n %{basepkg}-devel\
%ghc_pkg_recache\
\
%files -n %{basepkg} -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}.files\
%if 0%{?rhel} && 0%{?rhel} < 6\
%defattr(-,root,root,-)\
%endif\
%files -n %{basepkg} -f %{basepkg}.files\
%{?base_doc_files:%doc %base_doc_files}\
\
%files -n %{basepkg}-devel -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-devel.files\
%if 0%{?rhel} && 0%{?rhel} < 6\
%defattr(-,root,root,-)\
%endif\
%files -n %{basepkg}-devel -f %{basepkg}-devel.files\
%{?devel_doc_files:%doc %devel_doc_files}\
%{nil}
# ghc_libs_build [name-version] ...
%ghc_libs_build()\
HOME=$PWD\
%global ghc_subpackaging 1\
for i in %*; do\
name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\
ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
cd $name-$ver\
case $name in\
haskell-platform)\
%ghc_lib_build_without_haddock $name $ver\
;;\
*)\
%ghc_lib_build $name $ver\
./Setup register --inplace\
;;\
esac\
cd ..\
done\
%{nil}
# ghc_libs_install [name-version] ...
%ghc_libs_install()\
HOME=$PWD\
args="%*"\
for i in $args; do\
cd $i\
name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\
ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\
%ghc_lib_install $name $ver\
cd ..\
done\
%ghc_fix_rpath $args\
%{nil}

View File

@ -1,9 +0,0 @@
# OS specific settings
%_ghcdocdir %{_ghclicensedir}/%{name}
%_ghcdynlibdir %{_libdir}
%ghc_without_dynamic 1
%cabal_install_options -v

View File

@ -23,22 +23,17 @@ ARCH=$(arch)
if [ -f /etc/os-release ]; then
eval $(grep VERSION_ID /etc/os-release)
if git branch -a | grep -q f$VERSION_ID; then
BRANCH=f$VERSION_ID
else
case $VERSION_ID in
7.*) BRANCH=epel7 ;;
*) BRANCH=master ;;
esac
fi
case $VERSION_ID in
21) BRANCH=master ;;
7.*) BRANCH=el7 ;;
*) BRANCH="f$VERSION_ID" ;;
esac
else
# assume RHEL6
BRANCH=el6
fi
if [ "* $BRANCH" != "$(git branch | grep '^*')" ]; then
fedpkg switch-branch $BRANCH
fi
fedpkg switch-branch $BRANCH
if [ "* $BRANCH" != "$(git branch | grep '^*')" ]; then
echo "Git branch does not match Fedora installation!"
@ -47,14 +42,7 @@ fi
git pull
if [ "$UID" != "0" ]; then
SUDO="sudo"
else
SUDO=""
fi
echo Running dnf builddep:
$SUDO dnf builddep $PKG.spec
sudo yum-builddep $PKG.spec
fedpkg local
@ -68,10 +56,10 @@ PKGS=$(cd $ARCH; rpm -qp $(ls *-$VERREL*.rpm))
for i in $PKGS; do
# FIXME: should check NVR is same before building
rpm -q --quiet $i || $SUDO dnf install -q $i
rpm -q --quiet $i || sudo yum install -q $i
for k in list requires provides scripts; do
rpm -qp --$k $ARCH/$i.rpm | grep -v rpmlib > $TMP/$i.$k.test || :
rpm -q --$k $i | grep -v rpmlib > $TMP/$i.$k.installed || :
diff -u $TMP/$i.$k.installed $TMP/$i.$k.test -I /usr/lib/.build-id || :
diff -u $TMP/$i.$k.installed $TMP/$i.$k.test || :
done
done