From c795e004a472a814b1ffdb9686c8d6a9dda5202c Mon Sep 17 00:00:00 2001 From: Aleksander Zdyb Date: Tue, 9 Dec 2014 12:23:37 +0100 Subject: [PATCH] Introduce Cyad A command-line tool for managing Cynara's database. Change-Id: I3731f0c3166469c2e4e43dff9e4593adfc66106e --- CMakeLists.txt | 1 + packaging/cyad.manifest | 5 +++++ packaging/cynara.spec | 12 ++++++++++++ src/CMakeLists.txt | 1 + src/cyad/CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++ src/cyad/main.cpp | 25 +++++++++++++++++++++++++ 6 files changed, 81 insertions(+) create mode 100644 packaging/cyad.manifest create mode 100644 src/cyad/CMakeLists.txt create mode 100644 src/cyad/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index c7a802c..048d098 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,7 @@ SET(TARGET_LIB_CREDS_DBUS "cynara-creds-dbus") SET(TARGET_LIB_CREDS_SOCKET "cynara-creds-socket") SET(TARGET_LIB_SESSION "cynara-session") SET(TARGET_LIB_CYNARA_STORAGE "cynara-storage") +SET(TARGET_CYAD "cyad") ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(pkgconfig) diff --git a/packaging/cyad.manifest b/packaging/cyad.manifest new file mode 100644 index 0000000..a76fdba --- /dev/null +++ b/packaging/cyad.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/cynara.spec b/packaging/cynara.spec index c057aa1..f62aed9 100644 --- a/packaging/cynara.spec +++ b/packaging/cynara.spec @@ -17,6 +17,7 @@ Source1008: libcynara-creds-dbus.manifest Source1009: libcynara-creds-socket.manifest Source1010: libcynara-session.manifest Source1011: cynara-db-migration.manifest +Source1012: cyad.manifest Requires: default-ac-domains Requires(pre): pwdutils Requires(pre): cynara-db-migration >= %{version}-%{release} @@ -149,6 +150,12 @@ Summary: Migration tools for Cynara's database %description -n cynara-db-migration Migration tools for Cynara's database +%package -n cyad +Summary: Cynara's command-line tool + +%description -n cyad +Command-line tool to manage Cynara's database + %prep %setup -q cp -a %{SOURCE1001} . @@ -162,6 +169,7 @@ cp -a %{SOURCE1008} . cp -a %{SOURCE1009} . cp -a %{SOURCE1010} . cp -a %{SOURCE1011} . +cp -a %{SOURCE1012} . cp -a test/db/db* . %build @@ -358,3 +366,7 @@ fi %files -n cynara-db-migration %manifest cynara-db-migration.manifest %attr(700,root,root) %{_sbindir}/cynara/cynara-db-migration.sh + +%files -n cyad +%manifest cyad.manifest +%attr(700,root,root) %{_sbindir}/cyad diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 60a8a40..4bcf18c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,6 +48,7 @@ ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(client-async) ADD_SUBDIRECTORY(client-common) +ADD_SUBDIRECTORY(cyad) ADD_SUBDIRECTORY(admin) ADD_SUBDIRECTORY(agent) ADD_SUBDIRECTORY(storage) diff --git a/src/cyad/CMakeLists.txt b/src/cyad/CMakeLists.txt new file mode 100644 index 0000000..1e379da --- /dev/null +++ b/src/cyad/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# @file CMakeLists.txt +# @author Aleksander Zdyb +# + +SET(CYAD_PATH ${CYNARA_PATH}/cyad) + +SET(CYAD_SOURCES + ${CYAD_PATH}/main.cpp + ) + +INCLUDE_DIRECTORIES( + ${CYNARA_PATH} + ${CYNARA_PATH}/include + ) + +ADD_EXECUTABLE(${TARGET_CYAD} ${CYAD_SOURCES}) + +TARGET_LINK_LIBRARIES(${TARGET_CYAD} + ${TARGET_LIB_CYNARA_ADMIN} + ${TARGET_LIB_CYNARA_STORAGE} + ) + +INSTALL(TARGETS ${TARGET_CYAD} DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/cyad/main.cpp b/src/cyad/main.cpp new file mode 100644 index 0000000..ab4a0a8 --- /dev/null +++ b/src/cyad/main.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file src/cyad/main.cpp + * @author Aleksander Zdyb + * @version 1.0 + * @brief A commandline tool for managing Cynara's database + */ + +int main(int, char **) { + return 0; +} -- 2.7.4