--- /dev/null
+cmake_minimum_required(VERSION 3.16)
+project(sessiond LANGUAGES C CXX)
+
+# The following is needed, as we have both "sessiond" and "libsessiond" in our project,
+# and we don't want "libsessiond" to become "liblibsessiond". That would be tragic.
+set(CMAKE_SHARED_LIBRARY_PREFIX "")
+
+add_subdirectory(libsessiond)
+add_subdirectory(sessiond)
--- /dev/null
+The MIT License
+
+Copyright (c) 2022 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.
--- /dev/null
+find_package(PkgConfig)
+pkg_check_modules(DEPS REQUIRED IMPORTED_TARGET capi-base-common)
+
+set(
+ libsessiond_SRCS
+ src/lib.c
+)
+add_library(libsessiond SHARED ${libsessiond_SRCS})
+target_link_libraries(libsessiond PRIVATE PkgConfig::DEPS)
+target_include_directories(libsessiond PUBLIC include)
+set_target_properties(
+ libsessiond PROPERTIES
+ SOVERSION "${VERSION}"
+ PUBLIC_HEADER "include/sessiond.h"
+)
+install(TARGETS libsessiond)
+
+configure_file(libsessiond.pc.in libsessiond.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libsessiond.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
--- /dev/null
+/* MIT License
+ *
+ * Copyright (c) 2022 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. */
+
+#pragma once
+
+#include <tizen.h>
+
+int test();
--- /dev/null
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: libsessiond
+Description: libsessiond
+Requires: capi-base-common
+Version: @VERSION@
+Libs: -L${libdir} -lsessiond
+Cflags: -I${includedir}
--- /dev/null
+/* MIT License
+ *
+ * Copyright (c) 2022 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. */
+
+#include "sessiond.h"
+
+int test() {
+ return 42;
+}
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+Name: sessiond
+Summary: TODO
+Version: 0.0
+Release: 1
+Group: System/Management
+License: MIT
+Source0: %{name}-%{version}.tar.gz
+Source1: %{name}.manifest
+BuildRequires: cmake
+BuildRequires: pkgconfig(capi-base-common)
+BuildRequires: pkgconfig(dlog)
+
+%description
+TODO
+
+%package -n libsessiond
+Summary: TODO
+Group: System/Libraries
+Requires: sessiond = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libsessiond
+TODO
+
+%package -n libsessiond-devel
+Summary: TODO
+Group: Development/Libraries
+Requires: libsessiond = %{version}-%{release}
+
+%description -n libsessiond-devel
+TODO
+
+%prep
+%setup -q
+
+%build
+mkdir -p build
+pushd build
+%cmake .. -DVERSION=%{version} -DCMAKE_BUILD_TYPE=Release
+make %{?jobs:-j%jobs}
+popd
+cp %{SOURCE1} .
+
+%post -n libsessiond -p /sbin/ldconfig
+%postun -n libsessiond -p /sbin/ldconfig
+
+%install
+rm -rf %{buildroot}
+pushd build
+%make_install
+popd
+
+%files
+%manifest sessiond.manifest
+%license LICENSE.MIT
+%{_bindir}/sessiond
+
+%files -n libsessiond
+%manifest sessiond.manifest
+%license LICENSE.MIT
+%{_libdir}/libsessiond.so.*
+
+%files -n libsessiond-devel
+%manifest sessiond.manifest
+%license LICENSE.MIT
+%{_libdir}/libsessiond.so
+%{_libdir}/pkgconfig/libsessiond.pc
+%{_includedir}/sessiond.h
--- /dev/null
+find_package(PkgConfig)
+pkg_check_modules(DEPS REQUIRED IMPORTED_TARGET dlog)
+
+set(
+ sessiond_SRCS
+ src/main.cpp
+)
+add_executable(sessiond ${sessiond_SRCS})
+target_compile_features(sessiond PUBLIC cxx_std_20)
+target_link_libraries(sessiond PRIVATE PkgConfig::DEPS)
+install(TARGETS sessiond)
--- /dev/null
+/* MIT License
+ *
+ * Copyright (c) 2022 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. */
+
+#include <stdio.h>
+#include <dlog.h>
+
+int main() {
+ dlog_print(DLOG_ERROR, "HI", "hello\n");
+}