Initial template 94/272094/5
authorMateusz Majewski <m.majewski2@samsung.com>
Tue, 8 Mar 2022 11:16:46 +0000 (12:16 +0100)
committerMateusz Majewski <m.majewski2@samsung.com>
Mon, 14 Mar 2022 09:54:40 +0000 (10:54 +0100)
Change-Id: I943df0532a6a9ca76a68b461a23714a349ee4ab7

CMakeLists.txt [new file with mode: 0644]
LICENSE.MIT [new file with mode: 0644]
libsessiond/CMakeLists.txt [new file with mode: 0644]
libsessiond/include/sessiond.h [new file with mode: 0644]
libsessiond/libsessiond.pc.in [new file with mode: 0644]
libsessiond/src/lib.c [new file with mode: 0644]
packaging/sessiond.manifest [new file with mode: 0644]
packaging/sessiond.spec [new file with mode: 0644]
sessiond/CMakeLists.txt [new file with mode: 0644]
sessiond/src/main.cpp [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2934644
--- /dev/null
@@ -0,0 +1,9 @@
+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)
diff --git a/LICENSE.MIT b/LICENSE.MIT
new file mode 100644 (file)
index 0000000..80b056d
--- /dev/null
@@ -0,0 +1,9 @@
+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.
diff --git a/libsessiond/CMakeLists.txt b/libsessiond/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3f139d6
--- /dev/null
@@ -0,0 +1,19 @@
+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)
diff --git a/libsessiond/include/sessiond.h b/libsessiond/include/sessiond.h
new file mode 100644 (file)
index 0000000..4a9f60d
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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();
diff --git a/libsessiond/libsessiond.pc.in b/libsessiond/libsessiond.pc.in
new file mode 100644 (file)
index 0000000..28938c7
--- /dev/null
@@ -0,0 +1,11 @@
+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}
diff --git a/libsessiond/src/lib.c b/libsessiond/src/lib.c
new file mode 100644 (file)
index 0000000..2a14662
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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;
+}
diff --git a/packaging/sessiond.manifest b/packaging/sessiond.manifest
new file mode 100644 (file)
index 0000000..75b0fa5
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+    <request>
+        <domain name="_"/>
+    </request>
+</manifest>
diff --git a/packaging/sessiond.spec b/packaging/sessiond.spec
new file mode 100644 (file)
index 0000000..9675f8f
--- /dev/null
@@ -0,0 +1,69 @@
+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
diff --git a/sessiond/CMakeLists.txt b/sessiond/CMakeLists.txt
new file mode 100644 (file)
index 0000000..aad6d25
--- /dev/null
@@ -0,0 +1,11 @@
+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)
diff --git a/sessiond/src/main.cpp b/sessiond/src/main.cpp
new file mode 100644 (file)
index 0000000..2f62773
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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");
+}