File vboxtool.spec of Package vboxtool
# norootforbuild
Name: vboxtool
BuildRequires: unzip
Version: 0.4
Release: 0
Summary: VirtualBox Tool to manage headless VMs
Source: %{name}-%{version}.zip
Source1: machines.conf
Source2: vboxtool.conf
Patch: vboxtoolinit-0.3.patch
Url: http://vboxtool.sourceforge.net/
Group: System/Emulators/PC
License: GPL-3.0-or-later
Requires(pre): %insserv_prereq
BuildArch: noarch
%description
At the heart of the framework is a script which can do several actions (start, save, backup, etc.) on all registered VirtualBox sessions in batch mode. It is a wrapper around VBoxManage (the command line interface of VirtualBox), so execution is also by command line.
%prep
%setup -c %{name}-%{version}
%patch
%build
%install
%{__chmod} a-x *.txt
%{__install} -D script/vboxtool $RPM_BUILD_ROOT/%{_bindir}/vboxtool
%{__install} -D script/vboxtoolinit $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/vboxtool
%{__install} -d $RPM_BUILD_ROOT/%{_sbindir}
%{__ln_s} %{_sysconfdir}/init.d/vboxtool $RPM_BUILD_ROOT/%{_sbindir}/rcvboxtool
%{__install} -D %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/vboxtool/machines.conf
%{__install} -D %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/vboxtool/vboxtool.conf
%postun
%insserv_cleanup
%preun
%stop_on_removal
%files
%doc *.txt
%dir %{_sysconfdir}/vboxtool
%attr(640,root,root) %config(noreplace) %{_sysconfdir}/vboxtool/*.conf
%{_sysconfdir}/init.d/vboxtool
%{_bindir}/vboxtool
%{_sbindir}/rcvboxtool
%changelog