Skip to content

Commit

Permalink
add %_ghclicensedir and %ghc_smp_mflags
Browse files Browse the repository at this point in the history
  • Loading branch information
juhp committed Jun 22, 2017
1 parent 91094cb commit 331f527
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion ghc-rpm-macros.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#%%global without_hscolour 1

Name: ghc-rpm-macros
Version: 1.7.1
Version: 1.7.2
Release: 1%{?dist}
Summary: RPM macros for building Haskell packages for GHC

Expand Down Expand Up @@ -110,6 +110,9 @@ EOF


%changelog
* Thu Jun 22 2017 Jens Petersen <petersen@redhat.com> - 1.7.2-1
- add _ghclicensedir and ghc_smp_mflags macros

* Tue Feb 14 2017 Jens Petersen <petersen@redhat.com> - 1.7.1-1
- add -d option to ghc_lib_subpackage to use .files in topdir

Expand Down
10 changes: 6 additions & 4 deletions macros.ghc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\

%Cabal_version %(ghc-pkg --global --simple-output list Cabal | sed -e "s/Cabal-//")

%_ghclicensedir %{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}

# ghc_gen_filelists [name] [version]
%ghc_gen_filelists()\
%define pkgname %{?1}%{!?1:%{pkg_name}}\
Expand All @@ -90,7 +92,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\
Expand All @@ -115,13 +117,13 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.
%ghc_bin_build\
%global debug_package %{nil}\
%cabal_configure\
%cabal build %{_smp_mflags} %{?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_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build %{_smp_mflags} %{?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]
Expand Down
2 changes: 1 addition & 1 deletion macros.ghc-fedora
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Fedora specific settings

%_ghcdocdir %{?_defaultlicensedir}%{!?_defaultlicensedir:%_docdir}/%{name}
%_ghcdocdir %{_ghclicensedir}/%{name}

%cabal_install_options -v

0 comments on commit 331f527

Please sign in to comment.