From 84a7696ad1a0c5b31b2aa672cf44212ee1138e99 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 25 Aug 2016 19:10:58 +0200 Subject: [PATCH] move license handling from %ghc_libs_install to %ghc_gen_filelists --- ghc-rpm-macros.spec | 5 ++++- macros.ghc | 3 +++ macros.ghc-extra | 3 --- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 4884d36..a69961e 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -10,7 +10,7 @@ #%%global without_hscolour 1 Name: ghc-rpm-macros -Version: 1.6.4 +Version: 1.6.5 Release: 1%{?dist} Summary: RPM macros for building packages for GHC @@ -135,6 +135,9 @@ EOF %changelog +* Thu Aug 25 2016 Jens Petersen - 1.6.5-1 +- ghc_gen_filelists now handles license files automatically + * Wed Aug 17 2016 Jens Petersen - 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 diff --git a/macros.ghc b/macros.ghc index 2148caf..81ea105 100644 --- a/macros.ghc +++ b/macros.ghc @@ -80,6 +80,9 @@ fi\ if [ -d "%{buildroot}%{docdir}" ]; then\ echo "%{docdir}" >> %{basepkg}-devel.files\ fi\ +license_file=$(ls %{buildroot}%{_docdir}/%{basepkg}/)\ +echo "%%license %{pkgnamever}/$license_file" >> %{basepkg}.files\ +rm %{buildroot}%{_docdir}/ghc-$name/$license_file\ for i in %{basepkg}.files %{basepkg}-devel.files; do\ if [ -f "$i" ]; then\ sed -i -e "s!%{buildroot}!!g" $i\ diff --git a/macros.ghc-extra b/macros.ghc-extra index d1cb0e9..4da5c4d 100644 --- a/macros.ghc-extra +++ b/macros.ghc-extra @@ -85,9 +85,6 @@ name=$(echo $i | sed -e "s/\\(.*\\)-.*/\\1/")\ ver=$(echo $i | sed -e "s/.*-\\(.*\\)/\\1/")\ cd $name-$ver\ %ghc_lib_install $name $ver\ -LICENSE_FILE=$(ls %{buildroot}%{_docdir}/ghc-$name/)\ -echo "%%license $name-$ver/$LICENSE_FILE" >> ghc-$name.files\ -rm %{buildroot}%{_docdir}/ghc-$name/$LICENSE_FILE\ mv *.files ..\ cd ..\ done\