From 98acef307eb7fd3daf3675d8a107e025b1a2f5c2 Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Thu, 7 May 2015 10:55:53 +0200 Subject: [PATCH] Install stuff from CMake, not from Tizen spec file Move to CMake installation of the following components: - creds.conf configuration file - db* directories for tests - empty_db directory for tests - plugin/client and plugin/service directories for loadable plugins - creation of /var/cynara directory (and move its Smack labeling to manifest) Change-Id: I00d3d853715f57d1b3cde94e7d665281e264432a --- CMakeLists.txt | 1 + conf/CMakeLists.txt | 19 +++++++++++++++++++ packaging/cynara.manifest | 3 +++ packaging/cynara.spec | 12 ------------ src/client/CMakeLists.txt | 2 ++ src/service/CMakeLists.txt | 3 +++ test/CMakeLists.txt | 4 ++++ 7 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 conf/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 11f770a..ab2cf62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,6 +155,7 @@ SET(TARGET_CHSGEN "cynara-db-chsgen") ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(pkgconfig) +ADD_SUBDIRECTORY(conf) IF (BUILD_WITH_SYSTEMD) ADD_SUBDIRECTORY(systemd) diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt new file mode 100644 index 0000000..2a2b53b --- /dev/null +++ b/conf/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2015 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 Rafal Krypa +# + +INSTALL(FILES creds.conf DESTINATION ${SYS_CONFIG_DIR}/${PROJECT_NAME}) diff --git a/packaging/cynara.manifest b/packaging/cynara.manifest index a76fdba..c72c273 100644 --- a/packaging/cynara.manifest +++ b/packaging/cynara.manifest @@ -2,4 +2,7 @@ + + + diff --git a/packaging/cynara.spec b/packaging/cynara.spec index d780253..1413a71 100644 --- a/packaging/cynara.spec +++ b/packaging/cynara.spec @@ -188,7 +188,6 @@ cp -a %{SOURCE1011} . cp -a %{SOURCE1012} . cp -a %{SOURCE1013} . cp -a %{SOURCE1014} . -cp -a test/db/db* . %build %if 0%{?sec_build_binary_debug_enable} @@ -221,16 +220,7 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install -mkdir -p %{buildroot}/%{_sysconfdir}/%{name} -cp ./conf/creds.conf %{buildroot}/%{_sysconfdir}/%{name}/creds.conf - mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants -mkdir -p %{buildroot}/%{_localstatedir}/%{name} -mkdir -p %{buildroot}/%{_datarootdir}/%{name}/tests/empty_db -mkdir -p %{buildroot}/%{_libdir}/%{name}/plugin/client -mkdir -p %{buildroot}/%{_libdir}/%{name}/plugin/service - -cp -a db* %{buildroot}/%{_datarootdir}/%{name}/tests/ ln -s ../cynara.socket %{buildroot}%{_unitdir}/sockets.target.wants/cynara.socket ln -s ../cynara-admin.socket %{buildroot}%{_unitdir}/sockets.target.wants/cynara-admin.socket ln -s ../cynara-agent.socket %{buildroot}%{_unitdir}/sockets.target.wants/cynara-agent.socket @@ -265,8 +255,6 @@ if [ $1 = 1 ]; then systemctl enable %{name}.service fi -chsmack -a System %{_localstatedir}/%{name} - systemctl restart %{name}.service %preun diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 7b33f69..e74c3e8 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -47,3 +47,5 @@ TARGET_LINK_LIBRARIES(${TARGET_LIB_CYNARA} ) INSTALL(TARGETS ${TARGET_LIB_CYNARA} DESTINATION ${LIB_DIR}) + +INSTALL(DIRECTORY DESTINATION ${LIB_DIR}/${PROJECT_NAME}/plugin/client) diff --git a/src/service/CMakeLists.txt b/src/service/CMakeLists.txt index e691e97..cb0f6ed 100644 --- a/src/service/CMakeLists.txt +++ b/src/service/CMakeLists.txt @@ -45,3 +45,6 @@ TARGET_LINK_LIBRARIES(${TARGET_CYNARA} ) INSTALL(TARGETS ${TARGET_CYNARA} DESTINATION ${BIN_DIR}) + +INSTALL(DIRECTORY DESTINATION ${LOCAL_STATE_DIR}/${PROJECT_NAME}) +INSTALL(DIRECTORY DESTINATION ${LIB_DIR}/${PROJECT_NAME}/plugin/service) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ff7d9ae..8cc7a6f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -135,3 +135,7 @@ TARGET_LINK_LIBRARIES(${TARGET_CYNARA_TESTS} INSTALL(TARGETS ${TARGET_CYNARA_TESTS} DESTINATION ${BIN_DIR}) INSTALL(FILES ${CYNARA_MIGRATION_TOOL_TESTS} DESTINATION ${BIN_DIR}) + +FILE(GLOB TEST_DB_DIRS db/db*/) +INSTALL(DIRECTORY ${TEST_DB_DIRS} DESTINATION ${DATA_ROOT_DIR}/${PROJECT_NAME}/tests) +INSTALL(DIRECTORY DESTINATION ${DATA_ROOT_DIR}/${PROJECT_NAME}/tests/empty_db) -- 2.7.4