Use rpm macro instead of user define macro in spec file (#3406)
author윤지영/동작제어Lab(SR)/Engineer/삼성전자 <jy910.yun@samsung.com>
Wed, 31 Oct 2018 01:22:27 +0000 (10:22 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 31 Oct 2018 01:22:27 +0000 (10:22 +0900)
%{install_prefix} -> %{_prefix}
%{install_prefix}/lib -> %{_libdir}

Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
packaging/nnfw.spec

index 733f54c..0682729 100644 (file)
@@ -33,7 +33,6 @@ Requires: nnfw
 %description test
 NNFW test rpm. It does not depends on nnfw rpm since it contains nnfw runtime.
 
-%define install_prefix /usr
 %define test_install_prefix /opt/usr/nnfw-test
 
 %ifarch %{arm}
@@ -50,7 +49,7 @@ NNFW test rpm. It does not depends on nnfw rpm since it contains nnfw runtime.
 %if %{coverage_build} == 1
 %define build_options COVERAGE_BUILD=1 OBS_BUILD=1 BUILD_TYPE=Debug TARGET_ARCH=%{target_arch} TARGET_OS=tizen UPDATE_MODULE=0
 %else
-%define build_options OBS_BUILD=1 BUILD_TYPE=%{build_type} INSTALL_PATH=%{buildroot}%{install_prefix} TARGET_ARCH=%{target_arch} TARGET_OS=tizen UPDATE_MODULE=0
+%define build_options OBS_BUILD=1 BUILD_TYPE=%{build_type} INSTALL_PATH=%{buildroot}%{_prefix} TARGET_ARCH=%{target_arch} TARGET_OS=tizen UPDATE_MODULE=0
 %endif
 
 %prep
@@ -66,14 +65,18 @@ cp %{SOURCE1} .
 %ifarch arm armv7l aarch64
 %{build_options} make install
 
+%ifarch aarch64
+mv %{buildroot}%{_prefix}/lib %{buildroot}%{_libdir}
+%endif
+
 %if %{coverage_build} == 0
 # nnfw-test rpm(like test-suite on cross build)
 ## install Product
 mkdir -p %{buildroot}%{test_install_prefix}/Product/out
-mv %{buildroot}%{install_prefix}/unittest %{buildroot}%{test_install_prefix}/Product/out
-mv %{buildroot}%{install_prefix}/bin %{buildroot}%{test_install_prefix}/Product/out
-cp -rf %{buildroot}%{install_prefix}/lib %{buildroot}%{test_install_prefix}/Product/out
-rm -rf %{buildroot}%{install_prefix}/lib/pureacl
+mv %{buildroot}%{_prefix}/unittest %{buildroot}%{test_install_prefix}/Product/out
+mv %{buildroot}%{_prefix}/bin %{buildroot}%{test_install_prefix}/Product/out
+cp -rf %{buildroot}%{_libdir} %{buildroot}%{test_install_prefix}/Product/out
+rm -rf %{buildroot}%{_libdir}/pureacl
 ## install tests
 cp -rf ./tests %{buildroot}%{test_install_prefix}/.
 ## install tools
@@ -95,10 +98,10 @@ rm -rf %{buildroot}%{test_install_prefix}/coverage-suite.tar.gz
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
 %ifarch arm armv7l aarch64
-%{install_prefix}/lib/*
-%exclude %{install_prefix}/bin/*
-%exclude %{install_prefix}/unittest/*
-%exclude %{install_prefix}/lib/debug
+%{_libdir}/*
+%exclude %{_prefix}/bin/*
+%exclude %{_prefix}/unittest/*
+%exclude %{_libdir}/debug
 %endif
 
 %files test
@@ -106,7 +109,7 @@ rm -rf %{buildroot}%{test_install_prefix}/coverage-suite.tar.gz
 %defattr(-,root,root,-)
 %ifarch arm armv7l aarch64
 %{test_install_prefix}/*
-%exclude %{install_prefix}/lib/debug
+%exclude %{_libdir}/debug
 %endif
 
 %changelog