1 |
%define name smeserver-virtualbox |
%define name smeserver-virtualbox |
2 |
%define version 5.2 |
%define version 5.2 |
3 |
%define release 1 |
%define release 2 |
4 |
%define rpmver 5.2 |
%define rpmver 5.2 |
5 |
Summary: smserver rpm to install VirtualBox |
Summary: smserver rpm to install VirtualBox |
6 |
Name: %{name} |
Name: %{name} |
19 |
Requires: kernel-devel |
Requires: kernel-devel |
20 |
Requires: gcc |
Requires: gcc |
21 |
AutoReqProv: no |
AutoReqProv: no |
22 |
|
Patch0: smeserver-virtualbox-5.2-move_vbox_dir.patch |
23 |
|
|
24 |
%description |
%description |
25 |
smserver rpm to install VirtualBox-5.2 |
smserver rpm to install VirtualBox-5.2 |
26 |
|
|
27 |
%changelog |
%changelog |
28 |
* Tue Oct 11 2022 Trevor Batley <trevor@batley.id.au> 5.2-0 |
* Wed Oct 19 2022 Trevor Batley <trevor@batley.id.au> 5.2-2.sme |
29 |
|
- change vbox user to system user and change the home directory |
30 |
|
|
31 |
|
* Tue Oct 11 2022 Trevor Batley <trevor@batley.id.au> 5.2-1.sme |
32 |
- first import to sme10 |
- first import to sme10 |
33 |
- requires VirtualBox-5.2 |
- requires VirtualBox-5.2 |
34 |
- create vbox user and run vboxweb-service as vbox user |
- create vbox user and run vboxweb-service as vbox user |
58 |
%prep |
%prep |
59 |
|
|
60 |
%setup |
%setup |
61 |
|
%patch0 -p1 |
62 |
|
|
63 |
%build |
%build |
64 |
perl createlinks |
perl createlinks |
75 |
rm -rf %{name}-%{version} |
rm -rf %{name}-%{version} |
76 |
|
|
77 |
%pre |
%pre |
78 |
/usr/lib/virtualbox/vboxdrv.sh stop >/dev/null 2>&1 |
/sbin/e-smith/systemctl stop vboxdrv >/dev/null 2>&1 |
79 |
if /sbin/e-smith/db accounts get vbox >/dev/null |
if /sbin/e-smith/db accounts get vbox >/dev/null |
80 |
then |
then |
81 |
echo "the vbox user already exists - we'll use this" |
echo "the vbox user already exists - we'll use this" |
82 |
else |
else |
83 |
/sbin/e-smith/db accounts set vbox user PasswordSet yes |
/sbin/e-smith/db accounts set vboxusers group Description "VBox users" Members "admin" |
|
/sbin/e-smith/signal-event user-create vbox |
|
|
usermod -s /bin/bash vbox |
|
|
/sbin/e-smith/db accounts set vboxusers group Description "VBox users" Members "admin,vbox" |
|
84 |
/sbin/e-smith/signal-event group-create vboxusers |
/sbin/e-smith/signal-event group-create vboxusers |
85 |
mkdir /home/e-smith/files/users/vbox/.virtualbox |
/sbin/e-smith/db accounts set vbox system Description "VBox runtime user" |
86 |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 32 > /home/e-smith/files/users/vbox/.virtualbox/vbox.passwd |
useradd -c "VBox runtime user" -d /home/vbox -m -N -s /bin/bash -g vboxusers vbox |
87 |
cat /home/e-smith/files/users/vbox/.virtualbox/vbox.passwd | passwd --stdin vbox |
mkdir /home/vbox/.virtualbox |
88 |
|
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 32 > /home/vbox/.virtualbox/vbox.passwd |
89 |
|
cat /home/vbox/.virtualbox/vbox.passwd | passwd --stdin vbox |
90 |
fi |
fi |
91 |
|
|
92 |
%preun |
%preun |
94 |
/sbin/e-smith/systemctl stop vboxdrv |
/sbin/e-smith/systemctl stop vboxdrv |
95 |
|
|
96 |
%post |
%post |
97 |
/usr/lib/virtualbox/vboxdrv.sh start >/dev/null 2>&1 |
/sbin/e-smith/systemctl start vboxdrv |
98 |
/usr/bin/vboxmanage setproperty websrvauthlibrary null |
su vbox -c "/usr/bin/vboxmanage setproperty websrvauthlibrary null" |
99 |
|
|
100 |
%postun |
%postun |
101 |
#uninstall |
#uninstall |