CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(device-manager-sc7730 C)
+PROJECT(device-manager-plugin-sc7730 C)
SET(CMAKE_VERBOSE_MAKEFILE OFF)
ADD_DEFINITIONS("-DFEATURE_DLOG")
ENDIF()
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.Apache-2.0 DESTINATION ${HAL_LICENSE_DIR}/${PROJECT_NAME})
+
ADD_SUBDIRECTORY(hw/battery)
ADD_SUBDIRECTORY(hw/display)
ADD_SUBDIRECTORY(hw/led)
ADD_LIBRARY(${PROJECT_NAME} MODULE battery.c ../udev.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-battery_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE board.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-board_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE display.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-display_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE external_connection.c ../udev.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-external-connection_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
ADD_LIBRARY(${PROJECT_NAME} MODULE ir.c)
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
ADD_LIBRARY(${PROJECT_NAME} MODULE led.c)
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE thermal.c ../udev.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-thermal_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE touchscreen.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-touchscreen_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE usb_gadget.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-usb-gadget_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
%build
%cmake \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
- -DENABLE_DLOG=on \
+ -DHAL_LIB_DIR=%{_hal_libdir} \
+ -DHAL_LICENSE_DIR=%{_hal_licensedir} \
+ -DENABLE_DLOG=on
make %{?jobs:-j%jobs}
%postun -p /sbin/ldconfig
%files
-/hal/lib/*.so*
+%{_hal_libdir}/*.so*
%manifest %{name}.manifest
-%license LICENSE.Apache-2.0
+%{_hal_licensedir}/%{name}/LICENSE.Apache-2.0
%{_prefix}/lib/udev/rules.d/61-video.rules