Install stuff from CMake, not from Tizen spec file 21/38921/5
authorRafal Krypa <r.krypa@samsung.com>
Thu, 7 May 2015 08:55:53 +0000 (10:55 +0200)
committerLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tue, 12 May 2015 16:30:47 +0000 (09:30 -0700)
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
conf/CMakeLists.txt [new file with mode: 0644]
packaging/cynara.manifest
packaging/cynara.spec
src/client/CMakeLists.txt
src/service/CMakeLists.txt
test/CMakeLists.txt

index 11f770a..ab2cf62 100644 (file)
@@ -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 (file)
index 0000000..2a2b53b
--- /dev/null
@@ -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 <r.krypa@samsung.com>
+#
+
+INSTALL(FILES creds.conf DESTINATION ${SYS_CONFIG_DIR}/${PROJECT_NAME})
index a76fdba..c72c273 100644 (file)
@@ -2,4 +2,7 @@
        <request>
                <domain name="_" />
        </request>
+       <assign>
+               <filesystem path="/var/cynara/" label="System" />
+       </assign>
 </manifest>
index d780253..1413a71 100644 (file)
@@ -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
index 7b33f69..e74c3e8 100644 (file)
@@ -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)
index e691e97..cb0f6ed 100644 (file)
@@ -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)
index ff7d9ae..8cc7a6f 100644 (file)
@@ -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)