%define pck_majver %(echo %version | cut -d. -f1-3) %define pck_minver %(echo %version | cut -d. -f4) Name: virtualbox-extension-pack Version: @SRPMVERSION@ Release: @SRPMRELEASE@ Epoch: 1 Summary: VirtualBox Extension Pack Group: Applications/Emulators Vendor: @vendor@ Distribution: @distribution@ Packager: Silvan Calarco URL: http://www.virtualbox.org/ Source: LICENSE License: Not Distributable Requires(post):VirtualBox BuildRoot: %{_tmppath}/%{name}-%{version}-root %description VirtualBox Extension Pack. %prep %setup -c -n %{name}-%{version} -T [ -r /etc/sysconfig/@sysconfigfile@ ] || exit 1 declare -A SRPMVERSION SRPMRELEASE . /etc/sysconfig/@sysconfigfile@ [ "${VIRTUALBOX_EXTENSION_PACK_PCK}" ] || exit 1 [ "${VIRTUALBOX_EXTENSION_PACK_URL}" ] || exit 1 wget -nv --timeout=10 --tries=2 \ ${VIRTUALBOX_EXTENSION_PACK_URL}${VIRTUALBOX_EXTENSION_PACK_PCK} -O ${VIRTUALBOX_EXTENSION_PACK_PCK} [ -f ${VIRTUALBOX_EXTENSION_PACK_PCK} ] || exit 1 %build %install [ "%{buildroot}" != / ] && rm -rf %{buildroot} declare -A SRPMVERSION SRPMRELEASE . /etc/sysconfig/@sysconfigfile@ install -D -m0644 ${VIRTUALBOX_EXTENSION_PACK_PCK} %{buildroot}%{_libdir}/VirtualBox/extension/${VIRTUALBOX_EXTENSION_PACK_PCK} cp %{S:0} LICENSE %clean [ "%{buildroot}" != / ] && rm -rf %{buildroot} rm -rf %{_builddir}/%{name}-* : %post #VBoxManage extpack uninstall Oracle_VM_VirtualBox_Extension_Pack || true echo y | VBoxManage extpack install %{_libdir}/VirtualBox/extension/Oracle_VM_VirtualBox_Extension_Pack-%{pck_majver}%{?pck_minver:%pck_minver}.vbox-extpack --replace # not working : %files %defattr(-,root,root) %{_libdir}/VirtualBox/extension/Oracle_VM_VirtualBox_Extension_Pack-%{pck_majver}%{?pck_minver:%pck_minver}.vbox-extpack %doc LICENSE %changelog * Tue Aug 16 2011 Silvan Calarco 4.1.2.73507-1mamba - specfile created