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(glib-2.0)
25 BuildRequires: pkgconfig(libsystemd-journal)
26 BuildRequires: pkgconfig(libsystemd-daemon)
27 BuildRequires: pkgconfig(sqlite3)
28 Requires(post): libcap-tools
29 Requires: bridge-utils
32 This package provides a daemon used to manage zones - start, stop and switch
33 between them. A process from inside a zone can request a switch of context
34 (display, input devices) to the other zone.
37 %manifest packaging/vasum.manifest
38 %defattr(644,root,root,755)
39 %attr(755,root,root) %{_bindir}/vasum-server
42 %dir /etc/vasum/lxc-templates
43 %dir /etc/vasum/templates
44 %config /etc/vasum/daemon.conf
45 %attr(755,root,root) /etc/vasum/lxc-templates/*.sh
46 %config /etc/vasum/templates/*.conf
47 %{_unitdir}/vasum.service
48 %{_unitdir}/vasum.socket
49 %{_unitdir}/multi-user.target.wants/vasum.service
50 %config /etc/dbus-1/system.d/org.tizen.vasum.host.conf
51 %dir %{_datadir}/.zones
57 %{!?build_type:%define build_type "RELEASE"}
59 %if %{build_type} == "DEBUG" || %{build_type} == "PROFILING"
60 CFLAGS="$CFLAGS -Wp,-U_FORTIFY_SOURCE"
61 CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE"
64 %cmake . -DVERSION=%{version} \
65 -DCMAKE_BUILD_TYPE=%{build_type} \
66 -DSCRIPT_INSTALL_DIR=%{script_dir} \
67 -DSYSTEMD_UNIT_DIR=%{_unitdir} \
68 -DDATA_DIR=%{_datadir} \
69 -DPYTHON_SITELIB=%{python_sitelib} \
70 -DVASUM_USER=%{vsm_user} \
71 -DINPUT_EVENT_GROUP=%{input_event_group} \
72 -DDISK_GROUP=%{disk_group} \
73 -DTTY_GROUP=%{tty_group}
74 make -k %{?jobs:-j%jobs}
78 mkdir -p %{buildroot}/%{_unitdir}/multi-user.target.wants
79 ln -s ../vasum.service %{buildroot}/%{_unitdir}/multi-user.target.wants/vasum.service
80 mkdir -p %{buildroot}/%{_datadir}/.zones
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 ## Zone Support Package ###################################################
154 # TODO move to a separate repository
155 %package zone-support
156 Summary: Vasum Support
157 Group: Security/Other
159 %description zone-support
160 Zones support installed inside every zone.
163 %manifest packaging/vasum-zone-support.manifest
164 %defattr(644,root,root,755)
165 %config /etc/dbus-1/system.d/org.tizen.vasum.zone.conf
168 ## Zone Daemon Package ####################################################
169 # TODO move to a separate repository
171 Summary: Vasum Zones Daemon
172 Group: Security/Other
173 Requires: vasum-zone-support = %{version}-%{release}
175 %description zone-daemon
176 Daemon running inside every zone.
179 %manifest packaging/vasum-zone-daemon.manifest
180 %defattr(644,root,root,755)
181 %attr(755,root,root) %{_bindir}/vasum-zone-daemon
182 %config /etc/dbus-1/system.d/org.tizen.vasum.zone.daemon.conf
185 ## Command Line Interface ######################################################
187 Summary: Vasum Command Line Interface
188 Group: Security/Other
189 Requires: vasum-client = %{version}-%{release}
192 Command Line Interface for vasum.
195 %defattr(644,root,root,755)
196 %attr(755,root,root) %{_bindir}/vasum-cli
198 %package cli-completion
199 Summary: Vasum Command Line Interface bash completion
200 Group: Security/Other
201 Requires: vasum-cli = %{version}-%{release}
202 #Requires: bash-completion
204 %description cli-completion
205 Command Line Interface bash completion.
207 %files cli-completion
208 %attr(755,root,root) %{_sysconfdir}/bash_completion.d/vasum-cli-completion.sh
210 ## Test Package ################################################################
213 Group: Development/Libraries
214 Requires: vasum = %{version}-%{release}
215 Requires: vasum-client = %{version}-%{release}
221 Unit tests for both: server and client and integration tests.
224 systemctl daemon-reload
225 systemctl enable vasum-socket-test.socket
226 systemctl start vasum-socket-test.socket
229 systemctl stop vasum-socket-test.socket
230 systemctl disable vasum-socket-test.socket
233 systemctl daemon-reload
236 %manifest packaging/vasum-server-tests.manifest
237 %defattr(644,root,root,755)
238 %attr(755,root,root) %{_bindir}/vasum-server-unit-tests
239 %attr(755,root,root) %{_bindir}/vasum-socket-test
240 %attr(755,root,root) %{script_dir}/vsm_all_tests.py
241 %attr(755,root,root) %{script_dir}/vsm_int_tests.py
242 %attr(755,root,root) %{script_dir}/vsm_launch_test.py
243 %{script_dir}/vsm_test_parser.py
244 %config /etc/vasum/tests
245 %attr(755,root,root) /etc/vasum/tests/lxc-templates
246 %{python_sitelib}/vsm_integration_tests
247 %config /etc/dbus-1/system.d/org.tizen.vasum.tests.conf
248 %{_unitdir}/vasum-socket-test.socket
249 %{_unitdir}/vasum-socket-test.service