From 10bbfb1cd3bfe80d8d3272f9c00a6ced3b7991c6 Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Thu, 6 Oct 2016 11:29:15 +0200 Subject: [PATCH] tizen: Scan for licences to be shipped in package It's important to have this generated at buildtime, specially if tree is patched with missing dependencies, like those mentionned at: https://wiki.iotivity.org/build Change-Id: Ie8d9dc0685ddc2df37545e92da4a662ee496bd07 Credit-to: Jaehong Jo Signed-off-by: Philippe Coval Reviewed-on: https://gerrit.iotivity.org/gerrit/8177 Tested-by: jenkins-iotivity Reviewed-by: Jaehong Jo Reviewed-by: Ziran Sun --- tools/tizen/iotivity.spec | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/tools/tizen/iotivity.spec b/tools/tizen/iotivity.spec index 91e7c29..16b8a74 100644 --- a/tools/tizen/iotivity.spec +++ b/tools/tizen/iotivity.spec @@ -80,7 +80,24 @@ developing applications that use %{name}. %setup -q chmod g-w %_sourcedir/* -cp LICENSE.md LICENSE.APLv2 +find . \ + -iname "LICEN*E*" \ + -o -name "*BSD*" \ + -o -name "*COPYING*" \ + -o -name "*GPL*" \ + -o -name "*MIT*" \ + | sort | uniq \ + | while read file ; do \ + dir=$(dirname -- "$file") + echo "Files: ${dir}/*" + echo "License: ${file}" + sed 's/^/ /' "${file}" + echo "" + echo "" + done > tmp.tmp && mv tmp.tmp LICENSE + +cat LICENSE + cp %{SOURCE1001} . %if 0%{?tizen_version_major} < 3 cp %{SOURCE1002} . @@ -181,10 +198,12 @@ cp ./resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat %if 0%{?tizen_version_major} < 3 mkdir -p %{buildroot}/%{_datadir}/license -cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name} -cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-service -cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-test +cp LICENSE %{buildroot}/%{_datadir}/license/%{name} +cp LICENSE %{buildroot}/%{_datadir}/license/%{name}-devel +cp LICENSE %{buildroot}/%{_datadir}/license/%{name}-service +cp LICENSE %{buildroot}/%{_datadir}/license/%{name}-test %endif + cp resource/c_common/*.h %{buildroot}%{_includedir} cp resource/csdk/stack/include/*.h %{buildroot}%{_includedir} cp resource/csdk/logger/include/*.h %{buildroot}%{_includedir} @@ -214,7 +233,7 @@ ln -fs ../c_common %{buildroot}%{_includedir}/iotivity/ %if 0%{?tizen_version_major} < 3 %{_datadir}/license/%{name} %else -%license LICENSE.APLv2 +%license LICENSE %endif %files service @@ -241,7 +260,7 @@ ln -fs ../c_common %{buildroot}%{_includedir}/iotivity/ %if 0%{?tizen_version_major} < 3 %{_datadir}/license/%{name}-service %else -%license LICENSE.APLv2 +%license LICENSE %endif %files test @@ -251,11 +270,12 @@ ln -fs ../c_common %{buildroot}%{_includedir}/iotivity/ %if 0%{?tizen_version_major} < 3 %{_datadir}/license/%{name}-test %else -%license LICENSE.APLv2 +%license LICENSE %endif %files devel %defattr(-,root,root,-) +%license LICENSE %{_libdir}/lib*.a %{_libdir}/pkgconfig/%{name}.pc %{_includedir}/* -- 2.7.4