From 8f2283db9cb47723911065c264b43011f4198c9d Mon Sep 17 00:00:00 2001 From: Yunmi Ha Date: Tue, 26 Jan 2021 10:21:16 +0900 Subject: Apply rpm macro of hal install path Change-Id: I3aab6da90dce81e08af4ba15ba51a6d32aac2136 Signed-off-by: Yunmi Ha --- CMakeLists.txt | 3 ++- hal-backend-device-common.pc.in | 2 +- packaging/hal-backend-device-common.spec | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fbc524..d13e5ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,8 +21,9 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-common_pkgs_LDFLAGS}) -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib/ COMPONENT RuntimeLibraries) +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.Apache-2.0 DESTINATION ${HAL_LICENSE_DIR}/${PROJECT_NAME}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hal-common-interface.h DESTINATION include/hal/device) CONFIGURE_FILE(hal-backend-device-common.pc.in hal-backend-device-common.pc @ONLY) diff --git a/hal-backend-device-common.pc.in b/hal-backend-device-common.pc.in index 08ee2fb..502f51d 100644 --- a/hal-backend-device-common.pc.in +++ b/hal-backend-device-common.pc.in @@ -3,4 +3,4 @@ Name: HAL backend device common Description: Library for HAL backend device modules Version: 1.1 -Libs: -L/hal/lib -Wl,-rpath,/hal/lib -lhal-backend-device-common +Libs: -L@HAL_LIB_DIR@ -Wl,-rpath,@HAL_LIB_DIR@ -lhal-backend-device-common diff --git a/packaging/hal-backend-device-common.spec b/packaging/hal-backend-device-common.spec index 6d6ce69..6e38281 100644 --- a/packaging/hal-backend-device-common.spec +++ b/packaging/hal-backend-device-common.spec @@ -30,7 +30,9 @@ Library for HAL backend device modules (devel) cp %{SOURCE1} . %build -%cmake . +%cmake . -DHAL_LIB_DIR=%{_hal_libdir} \ + -DHAL_LICENSE_DIR=%{_hal_licensedir} + make %{?jobs:-j%jobs} %install @@ -38,11 +40,11 @@ make %{?jobs:-j%jobs} %files %manifest %{name}.manifest -%license LICENSE.Apache-2.0 -/hal/lib/libhal-backend-device-common.so +%{_hal_licensedir}/%{name}/LICENSE.Apache-2.0 +%{_hal_libdir}/libhal-backend-device-common.so %files devel %manifest %{name}.manifest -%license LICENSE.Apache-2.0 +%{_hal_licensedir}/%{name}/LICENSE.Apache-2.0 %{_includedir}/hal/device/hal-common-interface.h %{_libdir}/pkgconfig/*.pc -- cgit v1.2.3