INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src/shared)
ADD_SUBDIRECTORY(src/plugin-api/common)
ADD_SUBDIRECTORY(src/plugin-api/resourced)
+ADD_SUBDIRECTORY(src/plugin-api/deviced)
# ADD_SUBDIRECTORY(src/libgdbus)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
%define libsyscommon_version 5.0.0
%define plugin_api_common_version 0.1.0
%define plugin_api_resourced_version 0.1.0
+%define plugin_api_deviced_version 0.1.0
Name: libsyscommon
Summary: System Libraries
%description -n plugin-api-resourced-devel
Development header files for plugin APIs for the resourced.
+%package -n plugin-api-deviced
+Summary: Plugin APIs for the deviced
+Version: %{plugin_api_deviced_version}
+License: MIT
+
+%description -n plugin-api-deviced
+Plugin APIs for the deviced.
+
+%package -n plugin-api-deviced-devel
+Summary: Header files for plugin APIs for the deviced
+Version: %{plugin_api_deviced_version}
+License: MIT
+
+%description -n plugin-api-deviced-devel
+Development header files for plugin APIs for the deviced.
+
+
+######
+
+
%prep
%setup -q
cp %{SOURCE1001} .
%build
PLUGIN_API_COMMON_MAJORVER=$(echo %{plugin_api_common_version} | cut -d'.' -f1)
PLUGIN_API_RESOURCED_MAJORVER=$(echo %{plugin_api_resourced_version} | cut -d'.' -f1)
+PLUGIN_API_DEVICED_MAJORVER=$(echo %{plugin_api_deviced_version} | cut -d'.' -f1)
%cmake . -DFULLVER=%{libsyscommon_version} \
-DPLUGIN_API_COMMON_VERSION=%{plugin_api_common_version} \
-DPLUGIN_API_COMMON_MAJORVER=${PLUGIN_API_COMMON_MAJORVER} \
-DPLUGIN_API_RESOURCED_VERSION=%{plugin_api_resourced_version} \
-DPLUGIN_API_RESOURCED_MAJORVER=${PLUGIN_API_RESOURCED_MAJORVER} \
+ -DPLUGIN_API_DEVICED_VERSION=%{plugin_api_deviced_version} \
+ -DPLUGIN_API_DEVICED_MAJORVER=${PLUGIN_API_DEVICED_MAJORVER} \
-DPLUGIN_API_COMMON_ENABLE_DLOG=1 \
- -DPLUGIN_API_RESOURCED_ENABLE_DLOG=1
+ -DPLUGIN_API_RESOURCED_ENABLE_DLOG=1 \
+ -DPLUGIN_API_DEVICEDD_ENABLE_DLOG=1
make %{?_smp_mflags}
%install
%{_includedir}/plugin/plugin-resourced*.h
%{_libdir}/pkgconfig/plugin-api-resourced.pc
%{_libdir}/libplugin-api-resourced.so
+
+%files -n plugin-api-deviced
+%defattr(-,root,root,-)
+%license LICENSE.MIT
+%{_libdir}/libplugin-api-deviced.so.*
+
+%files -n plugin-api-deviced-devel
+%defattr(-,root,root,-)
+%license LICENSE.MIT
+%{_includedir}/plugin/plugin-deviced*.h
+%{_libdir}/pkgconfig/plugin-api-deviced.pc
+%{_libdir}/libplugin-api-deviced.so
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(plugin-api-deviced)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "${PREFIX}/bin")
+SET(LIBDIR ${LIB_INSTALL_DIR})
+SET(INCLUDEDIR "${PREFIX}/include/plugin")
+SET(VERSION ${PLUGIN_API_DEVICED_VERSION})
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+# Including below should be removed if the repository of plugin-api-common is
+# separated.
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../common/include)
+
+if (${PLUGIN_API_DEVICED_ENABLE_DLOG})
+ SET(PKG_MODULES
+ glib-2.0
+ dlog)
+ ADD_DEFINITIONS("-DENABLE_DLOG")
+ ADD_DEFINITIONS("-DLOG_TAG=\"PLUGIN_API_DEVICED\"")
+else()
+ SET(PKG_MODULES
+ glib-2.0)
+endif()
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED ${PKG_MODULES})
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -fPIC")
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functions")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -lrt")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+
+# plugin-api-common.c and plugin-api-conf.c are unnecessary if the repository of
+# plugin-api-common is separated.
+# Please remove them from SRCS and add 'plugin-api-common' to PKG_MODULES.
+SET(SRCS src/plugin-deviced-display.c
+ ../common/src/plugin-api-common.c
+ ../common/src/plugin-api-conf.c)
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS}
+ -ldl -Wl,-z,nodelete,--no-undefined)
+
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${PLUGIN_API_DEVICED_VERSION})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PLUGIN_API_DEVICED_MAJORVER})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
+ DESTINATION ${INCLUDEDIR}
+ FILES_MATCHING PATTERN "*.h"
+)
+
+# CONFIGURE .pc FILE
+FOREACH(include_dirs ${pkgs_INCLUDE_DIRS})
+ SET(PLUGIN_DEVICED_INCLUDEDIR "${PLUGIN_DEVICED_INCLUDEDIR} -I${include_dirs}")
+ENDFOREACH(include_dirs)
+FOREACH(libraries ${pkgs_LIBRARIES})
+ SET(PLUGIN_DEVICED_LIBS "${PLUGIN_DEVICED_LIBS} -l${libraries}")
+ENDFOREACH(libraries)
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
--- /dev/null
+/**
+ * MIT License
+ *
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is furnished
+ * to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef __PLUGIN_DEVICED_DISPLAY_INTERFACE_H__
+#define __PLUGIN_DEVICED_DISPLAY_INTERFACE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__PLUGIN_DEVICED_DISPLAY_INTERFACE_H__
--- /dev/null
+/**
+ * MIT License
+ *
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is furnished
+ * to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef __PLUGIN_DEVICED_DISPLAY_H__
+#define __PLUGIN_DEVICED_DISPLAY_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__PLUGIN_DEVICED_DISPLAY_H__
--- /dev/null
+# Package Information for pkg-config
+#
+# Copyright (c) 2023 Samsung Electronics Co., Ltd.
+# All rights reserved.
+#
+
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: plugin-api-deviced
+Description: Plugin APIs for the deviced
+Version: @VERSION@
+Requires.private: plugin-api-common
+Cflags: -I${includedir} @PLUGIN_DEVICED_INCLUDEDIR@
+Libs: -L${libdir} -lplugin-api-deviced @PLUGIN_DEVICED_LIBS@
--- /dev/null
+/**
+ * MIT License
+ *
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is furnished
+ * to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */