add %_ghclicensedir and %ghc_smp_mflags macros

backport from github
This commit is contained in:
Jens Petersen 2017-07-30 21:05:03 +01:00
parent 2cfb9bdb77
commit 5969f32695
3 changed files with 14 additions and 7 deletions

View File

@ -10,8 +10,8 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.6.19
Release: 3%{?dist}
Version: 1.6.20
Release: 1%{?dist}
Summary: RPM macros for building Haskell packages for GHC
License: GPLv3+
@ -161,6 +161,11 @@ EOF
%changelog
* 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

View File

@ -64,6 +64,8 @@ LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\
# 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}}\
@ -89,7 +91,7 @@ if [ -d "%{buildroot}%{docdir}" ]; then\
echo "%{docdir}" >> %{basepkg}-devel.files\
fi\
%if 0%{?1:1}\
for i in $(ls %{buildroot}%{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}/%{!?1:%{name}}%{?1:%{basepkg}}); do\
for i in $(ls %{buildroot}%{_ghclicensedir}/%{!?1:%{name}}%{?1:%{basepkg}}); do\
echo "%%license %{?1:%{pkgnamever}/}$i" >> %{basepkg}.files\
done\
%endif\
@ -114,13 +116,13 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.
%ghc_bin_build\
%global debug_package %{nil}\
%cabal_configure\
%cabal build %{?cabal_build_options}
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}
# 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} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build %{?cabal_build_options}\
%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1%{!?fedora:-%2} --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}\
%{nil}
# ghc_lib_build [name] [version]

View File

@ -1,5 +1,5 @@
# Fedora specific settings
%_ghcdocdir %{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}/%{name}
%_ghcdocdir %{_ghclicensedir}/%{name}
%cabal_install_options -v