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 zones
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 zones - start, stop and switch
36 between them. A process from inside a zone can request a switch of context
37 (display, input devices) to the other zone.
40 %manifest packaging/vasum.manifest
41 %defattr(644,root,root,755)
42 %attr(755,root,root) %{_bindir}/vasum-server
45 %dir /etc/vasum/lxc-templates
46 %dir /etc/vasum/templates
47 %config /etc/vasum/daemon.conf
48 %attr(755,root,root) /etc/vasum/lxc-templates/*.sh
49 %config /etc/vasum/templates/*.conf
50 %{_unitdir}/vasum.service
51 %{_unitdir}/vasum.socket
52 %{_unitdir}/multi-user.target.wants/vasum.service
53 /etc/dbus-1/system.d/org.tizen.vasum.host.conf
54 %dir %{_datadir}/.zones
60 %{!?build_type:%define build_type "RELEASE"}
62 %if %{build_type} == "DEBUG" || %{build_type} == "PROFILING"
63 CFLAGS="$CFLAGS -Wp,-U_FORTIFY_SOURCE"
64 CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE"
67 %cmake . -DVERSION=%{version} \
68 -DCMAKE_BUILD_TYPE=%{build_type} \
69 -DSCRIPT_INSTALL_DIR=%{script_dir} \
70 -DSYSTEMD_UNIT_DIR=%{_unitdir} \
71 -DDATA_DIR=%{_datadir} \
72 -DPYTHON_SITELIB=%{python_sitelib} \
73 -DVASUM_USER=%{vsm_user} \
74 -DINPUT_EVENT_GROUP=%{input_event_group} \
75 -DDISK_GROUP=%{disk_group} \
76 -DTTY_GROUP=%{tty_group}
77 make -k %{?jobs:-j%jobs}
81 mkdir -p %{buildroot}/%{_unitdir}/multi-user.target.wants
82 ln -s ../vasum.service %{buildroot}/%{_unitdir}/multi-user.target.wants/vasum.service
83 mkdir -p %{buildroot}/%{_datadir}/.zones
89 # Refresh systemd services list after installation
91 systemctl daemon-reload || :
93 # set needed caps on the binary to allow restart without loosing them
94 setcap CAP_SYS_ADMIN,CAP_MAC_OVERRIDE,CAP_SYS_TTY_CONFIG+ei %{_bindir}/vasum-server
97 # Stop the service before uninstall
99 systemctl stop vasum.service || :
103 # Refresh systemd services list after uninstall/upgrade
104 systemctl daemon-reload || :
105 if [ $1 -ge 1 ]; then
106 # TODO: at this point an appropriate notification should show up
107 eval `systemctl show vasum --property=MainPID`
108 if [ -n "$MainPID" -a "$MainPID" != "0" ]; then
111 echo "Vasum updated. Reboot is required for the changes to take effect..."
113 echo "Vasum removed. Reboot is required for the changes to take effect..."
116 ## Client Package ##############################################################
118 Summary: Vasum Client
119 Group: Development/Libraries
120 Requires: vasum = %{version}-%{release}
121 Requires(post): /sbin/ldconfig
122 Requires(postun): /sbin/ldconfig
125 Library interface to the vasum daemon
128 %manifest packaging/libvasum-client.manifest
129 %defattr(644,root,root,755)
130 %attr(755,root,root) %{_libdir}/libvasum.so.0.0.1
131 %{_libdir}/libvasum.so.0
133 %post client -p /sbin/ldconfig
135 %postun client -p /sbin/ldconfig
138 ## Devel Package ###############################################################
140 Summary: Vasum Client Devel
141 Group: Development/Libraries
142 Requires: vasum = %{version}-%{release}
143 Requires: vasum-client = %{version}-%{release}
146 Development package including the header files for the client library
149 %manifest packaging/vasum.manifest
150 %defattr(644,root,root,755)
151 %{_libdir}/libvasum.so
153 %{_libdir}/pkgconfig/*.pc
156 ## Zone Support Package ###################################################
157 # TODO move to a separate repository
158 %package zone-support
159 Summary: Vasum Support
160 Group: Security/Other
162 %description zone-support
163 Zones support installed inside every zone.
166 %manifest packaging/vasum-zone-support.manifest
167 %defattr(644,root,root,755)
168 /etc/dbus-1/system.d/org.tizen.vasum.zone.conf
171 ## Zone Daemon Package ####################################################
172 # TODO move to a separate repository
174 Summary: Vasum Zones Daemon
175 Group: Security/Other
176 Requires: vasum-zone-support = %{version}-%{release}
178 %description zone-daemon
179 Daemon running inside every zone.
182 %manifest packaging/vasum-zone-daemon.manifest
183 %defattr(644,root,root,755)
184 %attr(755,root,root) %{_bindir}/vasum-zone-daemon
185 /etc/dbus-1/system.d/org.tizen.vasum.zone.daemon.conf
188 ## Command Line Interface ######################################################
190 Summary: Vasum Command Line Interface
191 Group: Security/Other
192 Requires: vasum-client = %{version}-%{release}
195 Command Line Interface for vasum.
198 %defattr(644,root,root,755)
199 %attr(755,root,root) %{_bindir}/vasum-cli
202 ## Test Package ################################################################
205 Group: Development/Libraries
206 Requires: vasum = %{version}-%{release}
207 Requires: vasum-client = %{version}-%{release}
213 Unit tests for both: server and client and integration tests.
216 systemctl daemon-reload
217 systemctl enable vasum-socket-test.socket
218 systemctl start vasum-socket-test.socket
221 systemctl stop vasum-socket-test.socket
222 systemctl disable vasum-socket-test.socket
225 systemctl daemon-reload
228 %manifest packaging/vasum-server-tests.manifest
229 %defattr(644,root,root,755)
230 %attr(755,root,root) %{_bindir}/vasum-server-unit-tests
231 %attr(755,root,root) %{_bindir}/vasum-socket-test
232 %attr(755,root,root) %{script_dir}/vsm_all_tests.py
233 %attr(755,root,root) %{script_dir}/vsm_int_tests.py
234 %attr(755,root,root) %{script_dir}/vsm_launch_test.py
235 %{script_dir}/vsm_test_parser.py
236 %{_datadir}/vasum/tests
237 %attr(755,root,root) %{_datadir}/vasum/lxc-templates
238 %{python_sitelib}/vsm_integration_tests
239 /etc/dbus-1/system.d/org.tizen.vasum.tests.conf
240 %{_unitdir}/vasum-socket-test.socket
241 %{_unitdir}/vasum-socket-test.service