Introduced Container Daemon
[platform/core/security/vasum.git] / packaging / security-containers.spec
1 %define script_dir %{_sbindir}
2
3 Name:          security-containers
4 Version:       0.1.0
5 Release:       0
6 Source0:       %{name}-%{version}.tar.gz
7 License:       Apache-2.0
8 Group:         Security/Other
9 Summary:       Daemon for managing containers
10 BuildRequires: cmake
11 BuildRequires: libvirt-devel
12 BuildRequires: libjson-devel
13 BuildRequires: pkgconfig(glib-2.0)
14 BuildRequires: pkgconfig(libsystemd-journal)
15
16 %description
17 This package provides a daemon used to manage containers - start, stop and switch
18 between them. A process from inside a container can request a switch of context
19 (display, input devices) to the other container.
20
21 %files
22 %defattr(644,root,root,755)
23 %attr(755,root,root) %{_bindir}/security-containers-server
24 %dir /etc/security-containers
25 %dir /etc/security-containers/containers
26 %dir /etc/security-containers/libvirt-config
27 %config /etc/security-containers/daemon.conf
28 %config /etc/security-containers/containers/*.conf
29 %config %attr(400,root,root) /etc/security-containers/libvirt-config/*.xml
30 /etc/security-containers/image-skel
31
32 %prep
33 %setup -q
34
35 %build
36 %{!?build_type:%define build_type "RELEASE"}
37
38 %if %{build_type} == "DEBUG" || %{build_type} == "PROFILING"
39     CFLAGS="$CFLAGS -Wp,-U_FORTIFY_SOURCE"
40     CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE"
41 %endif
42
43 %cmake . -DVERSION=%{version} \
44          -DCMAKE_BUILD_TYPE=%{build_type} \
45          -DSCRIPT_INSTALL_DIR=%{script_dir}
46 make -k %{?jobs:-j%jobs}
47
48 %install
49 %make_install
50
51 %clean
52 rm -rf %{buildroot}
53
54
55 ## Client Package ##############################################################
56 %package client
57 Summary:          Security Containers Client
58 Group:            Development/Libraries
59 Requires:         security-containers = %{version}-%{release}
60 Requires(post):   /sbin/ldconfig
61 Requires(postun): /sbin/ldconfig
62
63 %description client
64 Library interface to the security-containers daemon
65
66 %files client
67 %attr(644,root,root) %{_libdir}/libsecurity-containers-client.so
68
69
70 ## Devel Package ###############################################################
71 %package devel
72 Summary:          Security Containers Client Devel
73 Group:            Development/Libraries
74 Requires:         security-containers = %{version}-%{release}
75 Requires:         security-containers-client = %{version}-%{release}
76
77 %description devel
78 Development package including the header files for the client library
79
80 %files devel
81 %defattr(644,root,root,755)
82 %{_includedir}/security-containers
83 %{_libdir}/pkgconfig/*
84
85
86 ## Container Daemon Package ####################################################
87 %package container-daemon
88 Summary:          Security Containers Containers Daemon
89 Group:            Security/Other
90 Requires:         security-containers = %{version}-%{release}
91 BuildRequires:    pkgconfig(glib-2.0)
92 BuildRequires:    pkgconfig(libsystemd-journal)
93
94 %description container-daemon
95 Daemon running inside every container.
96
97 %files container-daemon
98 %defattr(644,root,root,755)
99 %attr(755,root,root) %{_bindir}/security-containers-container-daemon
100 /etc/dbus-1/system.d/com.samsung.container.daemon.conf
101
102
103 ## Test Package ################################################################
104 %package unit-tests
105 Summary:          Security Containers Unit Tests
106 Group:            Development/Libraries
107 Requires:         security-containers = %{version}-%{release}
108 Requires:         security-containers-client = %{version}-%{release}
109 Requires:         python
110 Requires:         boost-test
111 BuildRequires:    boost-devel
112
113 %description unit-tests
114 Unit tests for both: server and client.
115
116 %files unit-tests
117 %defattr(644,root,root,755)
118 %attr(755,root,root) %{_bindir}/security-containers-server-unit-tests
119 %attr(755,root,root) %{script_dir}/sc_all_tests.py
120 %attr(755,root,root) %{script_dir}/sc_launch_test.py
121 %{script_dir}/sc_test_parser.py
122 %{_datadir}/security-containers