phpvirtualbox/phpvirtualbox.spec

159 lines
5.3 KiB
RPMSpec
Raw Permalink 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)
%define pkgver %(echo %version | tr _ -)
Name: %{?sitename:%sitename-}phpvirtualbox
Version: 4.3_1
Release: 1mamba
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: http://code.google.com/p/phpvirtualbox/
Source: http://downloads.sourceforge.net/project/phpvirtualbox/phpvirtualbox-%{pkgver}.zip
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
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%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 -n phpvirtualbox-%{pkgver}
%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 README.txt LICENSE.txt
%changelog
* 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