[ghc-rpm-macros/f20] bcond --enable-tests, -O2 everywhere, GPLv3+, use _rpmconfigdir,
Jens Petersen
petersen at fedoraproject.org
Sat May 17 03:51:29 UTC 2014
commit 26bbb3510b2a511657ee003f7a35cc767bb3d249
Author: Jens Petersen <petersen at redhat.com>
Date: Sat May 17 12:51:01 2014 +0900
bcond --enable-tests, -O2 everywhere, GPLv3+, use _rpmconfigdir,
backport recent changes from Rawhide:
- do bcond cabal configure --enable-tests also for Bin packages
- enable configure bcond check for tests
- use -O2 also for executable (Bin) packages and allow it to be overrided
- set Url field when generating subpackages
- update license tag to GPLv3+
- handle no _pkgdocdir in RHEL7 and docdir path different to F20+
- abort ghc_fix_dynamic_rpath if no chrpath
- Install macros to %%{_rpmconfigdir}/macros.d. (Ville Skyttä)
- set datasubdir in cabal_configure for ghc-7.8
note -O2 has known issues with the ghc-7.6 llvm backend
where it sometimes backfires (eg pandoc)
ghc-rpm-macros.ghc | 8 +++++---
ghc-rpm-macros.ghc-extra | 1 +
ghc-rpm-macros.spec | 26 ++++++++++++++++++++------
3 files changed, 26 insertions(+), 9 deletions(-)
---
diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc
index 045a1b4..8c415ec 100644
--- a/ghc-rpm-macros.ghc
+++ b/ghc-rpm-macros.ghc
@@ -21,7 +21,7 @@ fi
# configure
%cabal_configure\
%ghc_check_bootstrap\
-%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_pkgdocdir} --libsubdir='$compiler/$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?cabal_configure_options} $cabal_configure_extra_options
+%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} --libsubdir='$compiler/$pkgid' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} --ghc-option=-O2 %{?with_tests:--enable-tests} %{?cabal_configure_options} $cabal_configure_extra_options
# install
%cabal_install %cabal copy --destdir=%{buildroot} -v
@@ -87,7 +87,7 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.
# ghc_lib_build_without_haddock [name] [version]
%ghc_lib_build_without_haddock()\
%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 --htmldir=%{ghclibdocdir}/%1-%2} %{!?1:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci} --ghc-option=-O2\
+%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}
@@ -133,13 +133,15 @@ fi
%{nil}
# ghc_fix_dynamic_rpath prog ...
+# (assumes cwd = pkg_name!)
%ghc_fix_dynamic_rpath()\
%if %{undefined ghc_without_dynamic}\
+if ! type chrpath > /dev/null; then exit 1; fi\
PDIR=$(cd ..; pwd)\
for i in %*; do\
PROG=%{buildroot}%{_bindir}/$i\
if [ -x "$PROG" ]; then\
- RPATH=$(chrpath $PROG| sed -e "s@^$PROG: RPATH=@@")\
+ RPATH=$(chrpath $PROG | sed -e "s@^$PROG: RPATH=@@")\
case $RPATH in\
*$PDIR*)\
NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR@%{ghclibdir}@g" -e "s@/dist/build@@g")\
diff --git a/ghc-rpm-macros.ghc-extra b/ghc-rpm-macros.ghc-extra
index 3cfc35a..554c57d 100644
--- a/ghc-rpm-macros.ghc-extra
+++ b/ghc-rpm-macros.ghc-extra
@@ -11,6 +11,7 @@
Summary: Haskell %{pkgname} library\
%{?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-[^, ]*\\)-devel/\\1/g")}\
\
%description -n %{basepkg}\
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index d28063b..859478d 100644
--- a/ghc-rpm-macros.spec
+++ b/ghc-rpm-macros.spec
@@ -1,16 +1,16 @@
%global debug_package %{nil}
-%global macros_dir %{_sysconfdir}/rpm
+%global macros_dir %{_rpmconfigdir}/macros.d
# uncomment to bootstrap without hscolour
#%%global without_hscolour 1
Name: ghc-rpm-macros
-Version: 1.0.7.3
+Version: 1.0.7.4
Release: 1%{?dist}
Summary: RPM macros for building packages for GHC
-License: GPLv3
+License: GPLv3+
URL: https://fedoraproject.org/wiki/Packaging:Haskell
# This is a Fedora maintained package, originally made for
@@ -41,10 +41,12 @@ these macros.
%package extra
-Summary: Extra RPM macros for building Haskell packages with several libs
+Summary: Extra RPM macros for building Haskell library subpackages
Requires: %{name} = %{version}-%{release}
%description extra
+Extra macros used for subpackaging of Haskell libraries,
+for example in ghc and haskell-platform.
%prep
@@ -90,8 +92,20 @@ EOF
%changelog
+* Sat May 17 2014 Jens Petersen <petersen at redhat.com> - 1.0.7.4-1
+- do bcond cabal configure --enable-tests also for Bin packages
+- enable configure bcond check for tests
+- use -O2 also for executable (Bin) packages and allow it to be overrided
+- set Url field when generating subpackages
+- update license tag to GPLv3+
+- handle no _pkgdocdir in RHEL7 and docdir path different to F20+
+- abort ghc_fix_dynamic_rpath if no chrpath
+- Install macros to %%{_rpmconfigdir}/macros.d.
+- set datasubdir in cabal_configure for ghc-7.8
+
* Tue Feb 4 2014 Jens Petersen <petersen at redhat.com> - 1.0.7.3-1
-- ghc_fix_dynamic_rpath: abort for non-existent executable name with error msg
+- quote the ghc_fix_dynamic_rpath error message
+- ghc_fix_dynamic_rpath: abort for non-existent executable name
- cabal-tweak-flag: add manual field to enforce flag changes
- ghc-deps.sh: fix ghc-pkg path when bootstrapping new ghc version
- fix ghc-deps.sh when bootstrapping a new ghc version
@@ -109,7 +123,7 @@ EOF
- add ghc_docdir for package's docdir since not provided by standard macros
* Fri Jul 26 2013 Jens Petersen <petersen at redhat.com> - 1.0.6-1
-- also make %ghc_lib_build docdir unversioned
+- also make %%ghc_lib_build docdir unversioned
- require redhat-rpm-config >= 9.1.0-50.fc20 for unversioned docdir
* Fri Jul 26 2013 Jens Petersen <petersen at redhat.com> - 1.0.5-1
More information about the scm-commits
mailing list