1 %define script_dir %{_sbindir}
2 # Vasum Server's user info - it should already exist in the system
3 %define vsm_user security-containers
4 # The group that has read and write access to /dev/input/event* devices.
5 # It may vary between platforms.
6 %define input_event_group input
7 # The group has access to /dev/loop* devices.
8 %define disk_group disk
9 # The group that has write access to /dev/tty* devices.
15 Source0: %{name}-%{version}.tar.gz
18 Summary: Daemon for managing containers
20 BuildRequires: boost-devel
21 BuildRequires: libjson-devel >= 0.10
22 BuildRequires: libcap-ng-devel
23 BuildRequires: lxc-devel
24 BuildRequires: pkgconfig(libConfig)
25 BuildRequires: pkgconfig(libLogger)
26 BuildRequires: pkgconfig(libSimpleDbus)
27 BuildRequires: pkgconfig(glib-2.0)
28 BuildRequires: pkgconfig(libsystemd-journal)
29 BuildRequires: pkgconfig(libsystemd-daemon)
30 BuildRequires: pkgconfig(sqlite3)
31 Requires(post): libcap-tools
32 Requires: bridge-utils
35 This package provides a daemon used to manage containers - start, stop and switch
36 between them. A process from inside a container can request a switch of context
37 (display, input devices) to the other container.
40 %manifest packaging/vasum.manifest
41 %defattr(644,root,root,755)
42 %attr(755,root,root) %{_bindir}/vasum-server
44 %dir /etc/vasum/containers
45 %dir /etc/vasum/lxc-templates
46 %dir /etc/vasum/templates
47 %config /etc/vasum/daemon.conf
48 %config /etc/vasum/containers/*.conf
49 %attr(755,root,root) /etc/vasum/lxc-templates/*.sh
50 %config /etc/vasum/templates/*.conf
51 %{_unitdir}/vasum.service
52 %{_unitdir}/multi-user.target.wants/vasum.service
53 /etc/dbus-1/system.d/org.tizen.containers.host.conf
59 %{!?build_type:%define build_type "RELEASE"}
61 %if %{build_type} == "DEBUG" || %{build_type} == "PROFILING"
62 CFLAGS="$CFLAGS -Wp,-U_FORTIFY_SOURCE"
63 CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE"
66 %cmake . -DVERSION=%{version} \
67 -DCMAKE_BUILD_TYPE=%{build_type} \
68 -DSCRIPT_INSTALL_DIR=%{script_dir} \
69 -DSYSTEMD_UNIT_DIR=%{_unitdir} \
70 -DPYTHON_SITELIB=%{python_sitelib} \
71 -DVASUM_USER=%{vsm_user} \
72 -DINPUT_EVENT_GROUP=%{input_event_group} \
73 -DDISK_GROUP=%{disk_group} \
74 -DTTY_GROUP=%{tty_group}
75 make -k %{?jobs:-j%jobs}
79 mkdir -p %{buildroot}/%{_unitdir}/multi-user.target.wants
80 ln -s ../vasum.service %{buildroot}/%{_unitdir}/multi-user.target.wants/vasum.service
86 # Refresh systemd services list after installation
88 systemctl daemon-reload || :
90 # set needed caps on the binary to allow restart without loosing them
91 setcap CAP_SYS_ADMIN,CAP_MAC_OVERRIDE,CAP_SYS_TTY_CONFIG+ei %{_bindir}/vasum-server
94 # Stop the service before uninstall
96 systemctl stop vasum.service || :
100 # Refresh systemd services list after uninstall/upgrade
101 systemctl daemon-reload || :
102 if [ $1 -ge 1 ]; then
103 # TODO: at this point an appropriate notification should show up
104 eval `systemctl show vasum --property=MainPID`
105 if [ -n "$MainPID" -a "$MainPID" != "0" ]; then
108 echo "Vasum updated. Reboot is required for the changes to take effect..."
110 echo "Vasum removed. Reboot is required for the changes to take effect..."
113 ## Client Package ##############################################################
115 Summary: Vasum Client
116 Group: Development/Libraries
117 Requires: vasum = %{version}-%{release}
118 Requires(post): /sbin/ldconfig
119 Requires(postun): /sbin/ldconfig
122 Library interface to the vasum daemon
125 %manifest packaging/libvasum-client.manifest
126 %defattr(644,root,root,755)
127 %attr(755,root,root) %{_libdir}/libvasum.so.0.0.1
128 %{_libdir}/libvasum.so.0
130 %post client -p /sbin/ldconfig
132 %postun client -p /sbin/ldconfig
135 ## Devel Package ###############################################################
137 Summary: Vasum Client Devel
138 Group: Development/Libraries
139 Requires: vasum = %{version}-%{release}
140 Requires: vasum-client = %{version}-%{release}
143 Development package including the header files for the client library
146 %manifest packaging/vasum.manifest
147 %defattr(644,root,root,755)
148 %{_libdir}/libvasum.so
150 %{_libdir}/pkgconfig/*.pc
153 ## Container Support Package ###################################################
154 # TODO move to a separate repository
155 %package container-support
156 Summary: Vasum Support
157 Group: Security/Other
160 %description container-support
161 Containers support installed inside every container.
163 %files container-support
164 %manifest packaging/vasum-container-support.manifest
165 %defattr(644,root,root,755)
166 /etc/dbus-1/system.d/org.tizen.containers.zone.conf
169 ## Container Daemon Package ####################################################
170 # TODO move to a separate repository
171 %package container-daemon
172 Summary: Vasum Containers Daemon
173 Group: Security/Other
174 Requires: vasum-container-support = %{version}-%{release}
176 %description container-daemon
177 Daemon running inside every container.
179 %files container-daemon
180 %manifest packaging/vasum-container-daemon.manifest
181 %defattr(644,root,root,755)
182 %attr(755,root,root) %{_bindir}/vasum-container-daemon
183 /etc/dbus-1/system.d/org.tizen.containers.zone.daemon.conf
186 ## Command Line Interface ######################################################
188 Summary: Vasum Command Line Interface
189 Group: Security/Other
190 Requires: vasum-client = %{version}-%{release}
193 Command Line Interface for vasum.
196 %defattr(644,root,root,755)
197 %attr(755,root,root) %{_bindir}/vasum-cli
200 ## Test Package ################################################################
203 Group: Development/Libraries
204 Requires: vasum = %{version}-%{release}
205 Requires: vasum-client = %{version}-%{release}
211 Unit tests for both: server and client and integration tests.
214 %manifest packaging/vasum-server-tests.manifest
215 %defattr(644,root,root,755)
216 %attr(755,root,root) %{_bindir}/vasum-server-unit-tests
217 %attr(755,root,root) %{script_dir}/vsm_all_tests.py
218 %attr(755,root,root) %{script_dir}/vsm_int_tests.py
219 %attr(755,root,root) %{script_dir}/vsm_launch_test.py
220 %{script_dir}/vsm_test_parser.py
221 %{_datadir}/vasum/tests
222 %attr(755,root,root) %{_datadir}/vasum/lxc-templates
223 %{python_sitelib}/vsm_integration_tests
224 /etc/dbus-1/system.d/org.tizen.containers.tests.conf