set Cabal docdir to licensedir

so licenses end up in right place
This commit is contained in:
Jens Petersen 2016-09-06 11:20:41 +09:00
parent 8539a717fc
commit 68da07a47a
2 changed files with 8 additions and 6 deletions

View File

@ -10,7 +10,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.6.7
Version: 1.6.8
Release: 1%{?dist}
Summary: RPM macros for building packages for GHC
@ -135,6 +135,9 @@ EOF
%changelog
* 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

View File

@ -25,7 +25,7 @@ fi
%global _hardened_ldflags %{nil}\
CFLAGS="${CFLAGS:-%optflags}"; export CFLAGS\
LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\
%cabal configure %{?cabal_verbose} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{ghc_pkgdocdir} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} --ghc-options="$(echo ' '$CFLAGS | sed -e 's/ / -optc/g') $(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')" %{?cabal_configure_options} $cabal_configure_extra_options
%cabal configure %{?cabal_verbose} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{ghc_licensedir} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} --ghc-options="$(echo ' '$CFLAGS | sed -e 's/ / -optc/g') $(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')" %{?cabal_configure_options} $cabal_configure_extra_options
# install
%cabal_install %cabal copy %{?cabal_verbose} %{!?cabal_verbose:-v} --destdir=%{buildroot}
@ -36,6 +36,8 @@ LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\
%cabal test %{?cabal_verbose}\
%endif
%ghc_licensedir %{_defaultlicensedir}/%{name}
# no _pkgdocdir in EPEL <= 7
%ghc_pkgdocdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
@ -83,7 +85,6 @@ fi\
for i in $(ls %{buildroot}%{_docdir}/%{!?1:*}%{?1:%{basepkg}}/); do\
echo "%%license %{?1:%{pkgnamever}/}$i" >> %{basepkg}.files\
mkdir -p %{buildroot}%{_defaultlicensedir}/%{basepkg}\
mv %{buildroot}%{_docdir}/%{!?1:*}%{?1:%{basepkg}}/$i %{buildroot}%{_defaultlicensedir}/%{basepkg}/\
done\
for i in %{basepkg}.files %{basepkg}-devel.files; do\
if [ -f "$i" ]; then\
@ -114,7 +115,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} %{?ghc_without_shared:--disable-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_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{ghc_licensedir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1-%2} %{!?1:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build %{?cabal_verbose}\
%{nil}
@ -141,8 +142,6 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
%cabal_install\
mkdir -p %{buildroot}%{_defaultlicensedir}/%{name}\
mv %{buildroot}%{ghc_pkgdocdir}/* %{buildroot}%{_defaultlicensedir}/%{name}/\
%{!?1:%ghc_strip_dynlinked}\
%{nil}