phpvirtualbox/phpvirtualbox.spec

195 lines
6.7 KiB
RPMSpec
Raw Normal View History

%define serverdir %(apxs -q htdocsdir 2>/dev/null)
# To create a customized installation of phpvirtualbox:
# autospec -u phpvirtualbox -a5 \
# -d "installdir=%serverdir/../www.example.com, sitename=example"
%if "%{?installdir}" == ""
%define installdir %{serverdir}/%{name}
%endif
# themes
%define theme_version 2.10
%define theme_Grid_version %{theme_version}b
%define theme_Paradice_version %{theme_version}a
%define theme_Verysmall_version %{theme_version}a
%define majver %(echo %version | cut -d. -f1-2)
%define pkgver %(echo %version | tr _ -)
%define gittag %(echo %version | cut -d. -f4)
Name: %{?sitename:%sitename-}phpvirtualbox
Version: 6.1.20210127git.cf82d58
Release: 2mamba
Summary: An open source, AJAX implementation of the VirtualBox user interface written in PHP
Group: Applications/Web
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/phpvirtualbox/phpvirtualbox
Source: https://github.com/phpvirtualbox/phpvirtualbox.git/master@%{gittag}/phpvirtualbox-%{version}.tar.bz2
License: GPL
BuildArch: noarch
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
#BuildRequires: apache
#Requires(post):apache-mod_php >= 4.3
Requires: php-mysql
#Requires: mysql > 4.1.1
Requires: VirtualBox-web >= %{majver}
Requires(pre): php
%description
An open source, AJAX implementation of the VirtualBox user interface written in PHP. As a modern web interface, it allows you to access and control remote VirtualBox instances. Much of its verbage and some of its code is based on the (inactive) vboxweb project. phpVirtualBox was designed to allow users to administer VirtualBox in a headless environment - mirroring the VirtualBox GUI through its web interface.
phpVirtualBox:
* is designed to be a web interface replacement of the VirtualBox GUI program
* is not designed to run in a "hosting" environment where the concept of VM ownership is required - when you are logged in to phpVirtualBox, you have full control over all VMs in the VirtualBox installation
aims to perform all VirtualBox administration actions through vboxwebsrv (a SOAP server distributed with VirtualBox)
* does not directly interact with any files on the VirtualBox host
* does not have automatic VM start / stop functionality on system boot / shutdown - this functionality is not provided by the VirtualBox API
%prep
%setup -q
%build
mv config.php-example config.php
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d %{buildroot}%{installdir}
cp -a * %{buildroot}%{installdir}
# create lists of files
find %{buildroot}%{installdir}/themes \
-mindepth 1 -maxdepth 1 -type d | sed "s,^%{buildroot},," > .themes
for corefile in $(grep themes .core); do
sed -i "s,^$corefile$,," .themes
done
find %{buildroot}%{installdir} \
-mindepth 1 -maxdepth 1 \
! -name themes | sed "s,^%{buildroot},," >> .core
install -d %{buildroot}%{_sysconfdir}/httpd/httpd.d
cat > %{buildroot}%{_sysconfdir}/httpd/httpd.d/%{name}.conf << EOF
%{?!sitename:Alias /%name %installdir}
<Directory %{installdir}>
Allow from All
<IfModule mod_php5.c>
php_flag session.auto_start 0
php_admin_flag register_globals off
php_admin_flag magic_quotes_gpc off
php_admin_flag allow_url_include off
php_admin_flag allow_url_fopen off
php_admin_value open_basedir "%{installdir}:/tmp"
</IfModule>
</Directory>
<Directory %{installdir}/libraries>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
EOF
rm -f %{buildroot}%{installdir}/themes/.gitignore
%pre
if [ $1 -ge 1 ]; then
sed -i "s|^;extension=soap.so$|extension=soap.so|" /etc/php/php.ini
fi
:
%post
if [ $1 -eq 1 ]; then
password=`mkpasswd -s 0`
sed -i "s|\$username = 'vbox';|\$username = 'admin';|" %{installdir}/config.php
sed -i "s|\$password = 'pass';|\$password = '${password}';|" %{installdir}/config.php
fi
if [ $1 -ge 1 ]; then
service httpd reload
fi
:
%postun
# uninstall
if [ $1 -eq 0 ]; then
service httpd reload
fi
:
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files -f .core
%defattr(-, root, root)
%config(noreplace) %{_sysconfdir}/httpd/httpd.d/%{name}.conf
%config(noreplace) %{installdir}/config.php
%dir %{installdir}
%doc LICENSE.txt
%changelog
* Sat Feb 19 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 6.1.20210127git.cf82d58-2mamba
- fix version requirement for VirtualBox-web
* Tue Jan 11 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 6.1.20210127git.cf82d58-1mamba
- update to 6.1.20210127git.cf82d58
* Sat Nov 09 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 5.2_1-1mamba
- update to 5.2_1
* Sat Nov 09 2019 Automatic Build System <autodist@mambasoft.it> 5.2_1-1mamba
- automatic version update by autodist
* Fri Jan 29 2016 Automatic Build System <autodist@mambasoft.it> 5.0_5-1mamba
- automatic version update by autodist
* Sat Jan 16 2016 Automatic Build System <autodist@mambasoft.it> 5.0_4-1mamba
- automatic version update by autodist
* Wed Sep 16 2015 Automatic Build System <autodist@mambasoft.it> 5.0_3-1mamba
- automatic version update by autodist
* Wed Aug 26 2015 Automatic Build System <autodist@mambasoft.it> 5.0_2-2mamba
- automatic version update by autodist
* Wed Aug 26 2015 Automatic Build System <autodist@mambasoft.it> 5.0_2-1mamba
- automatic version update by autodist
* Tue Aug 04 2015 Automatic Build System <autodist@mambasoft.it> 5.0_0-1mamba
- automatic version update by autodist
* Fri Jul 24 2015 Automatic Build System <autodist@mambasoft.it> 4.3_3-1mamba
- automatic version update by autodist
* Mon Feb 09 2015 Automatic Build System <autodist@mambasoft.it> 4.3_2-1mamba
- automatic version update by autodist
* Sat May 03 2014 Automatic Build System <autodist@mambasoft.it> 4.3_1-1mamba
- automatic version update by autodist
* Sun Oct 27 2013 Automatic Build System <autodist@mambasoft.it> 4.3_0-1mamba
- automatic version update by autodist
* Thu Sep 26 2013 Automatic Build System <autodist@mambasoft.it> 4.2_7-1mamba
- update to 4.2_7
* Mon Jul 29 2013 Automatic Build System <autodist@mambasoft.it> 4.2_6-1mamba
- automatic version update by autodist
* Wed Jul 17 2013 Automatic Build System <autodist@mambasoft.it> 4.2_5-1mamba
- automatic version update by autodist
* Sun Apr 28 2013 Automatic Build System <autodist@mambasoft.it> 4.2_4-1mamba
- update to 4.2_4
* Wed Sep 26 2012 Automatic Build System <autodist@mambasoft.it> 4.2.0-1mamba
- update to 4.2.0
* Tue Nov 01 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.4-2mamba
- Change requirement for VirtualBox in VirtualBox-web
* Sun Oct 23 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.4-1mamba
- initial packaging