rules revision b723b174d7132ab6bbff3abcd83c92530065f7da
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#!/usr/bin/make -f
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Copyright (C) 2006-2010 Oracle Corporation
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# available from http://www.virtualbox.org. This file is free software;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# you can redistribute it and/or modify it under the terms of the GNU
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# General Public License as published by the Free Software Foundation,
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync#
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(wildcard rpm/rules),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync$(error call rpm/rules from src/VBox/Installer/linux)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifneq ($(wildcard /usr/lib/rpm/find-requires.ksyms),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# don't allow to check for kernel syms, otherwise we depend on specific kernel versions!
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync$(error /usr/lib/rpm/find-requires.ksyms must not be installed)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifneq ($(wildcard /usr/lib/rpm/find-supplements.ksyms),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# same for openSUSE
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync$(error /usr/lib/rpm/find-supplements.ksyms must not be installed)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(shell if grep -q '^/usr/lib/virtualbox' /etc/permissions* 2>/dev/null; then echo yes; fi),yes)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# make sure openSUSE permissions fixes don't interfere with us
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync$(error Fix /etc/permissions*)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
24df09922f68ca6b53d3b8052e589d3b790f7c17vboxsyncverpkg := VirtualBox-4.0
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynccurrent := $(shell pwd)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncvboxroot := $(shell cd ../../../../; pwd)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncpkgdir := $(shell cd ../../../../..; pwd)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncbuilddir := $(current)/rpm/builddir
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncrpmlib := $(shell if [ `uname -m` = "x86_64" ]; then echo "lib64"; else echo "lib"; fi)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncarch := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "i386"; fi)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncverfile := $(builddir)/version-generated.mk
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync-include $(vboxroot)/SVN_REVISION
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncsvnrev :=$(if $(svn_revision),$(svn_revision),0)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifneq ($(MAKECMDGOALS),clean)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rpmrel := $(shell cat /etc/distname)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync ifeq ($(rpmrel),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync # look for fedora
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rpmrel := $(shell cat /etc/fedora-release | sed -e 's/^Fedora *release *\([1-9][0-9]*\) .*/fedora\1/')
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync ifeq ($(rpmrel),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(error failed to detect the release type. Add /etc/distname or hack the detection.)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rpmdist := $(strip $(shell grep $(rpmrel) $(current)/distributions_rpm | cut -d'=' -f2))
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync ifeq ($(rpmdist),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(error Cannot detect package distribution (rpmrel=$(rpmrel)))
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
802293f690252d458abe85d83c07b2422d9b5e17vboxsync ifeq ($(filter-out rhel4 rhel5 rhel6 fedora9 fedora11 fedora12 fedora13 fedora14 pclinuxos2007 turbolinux11,$(rpmrel)),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rpmspec := rpm_redhat
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 sles10.1 sles11.0,$(rpmrel)),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rpmspec := rpm_suse
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync ifeq ($(filter-out mdv2009.1 mdv2010.0,$(rpmrel)),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rpmspec := rpm_mdv
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync ifeq ($(rpmspec),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(error failed to detect the .spec file (rpmrel=$(rpmrel)))
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync include $(verfile)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync$(verfile): rpm/configure-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) $(verfile)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncver := $(VBOX_VERSION_STRING)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncrpmver :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(DEBUG),_dbg,))$(if $(BLEEDING_EDGE),_$(BLEEDING_EDGE),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncarchdir := $(current)/rpm/VirtualBox-$(ver)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncrpmname := $(verpkg)-$(rpmver)_$(rpmrel)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
c679f5c447cd6925763c50493cd83bd9aa032d17vboxsync# Fedora13/14 is bleeding edge, the other jails have outdated kernel headers
802293f690252d458abe85d83c07b2422d9b5e17vboxsyncinstmod := $(if $(filter rhel4 rhel5 rhel6 sles10.1 sles11.0 pclinuxos2007 fedora13 fedora14,$(rpmrel)),,install_rpm)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifneq ($(STAGEDISO),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync$(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(wildcard /usr/share/doc/packages/bash),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync ifeq ($(wildcard /usr/share/doc/bash),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync # Mandriva 2007.1, Redhat
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(rpmname)\""
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync else
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync # Mandriva 2008.0
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\""
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync endif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncelse
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync # Novell (OpenSUSE, SLES)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/packages/$(verpkg)\""
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynccfg_flags := $(if $(filter rhel4 sles10.1,$(rpmrel)),--build-libxml2,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(filter rhel4 sles10.1,$(rpmrel)),--build-libxslt,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(filter rhel4,$(rpmrel)),--build-libssl,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(filter rhel4 rhel5 sles10.1,$(rpmrel)),--build-libcurl,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(filter rhel5 sles10.1,$(rpmrel)),--disable-sdl-ttf,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(filter sles10.1 turbolinux11,$(rpmrel)),--disable-pulse,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(filter rhel4 rhel5,$(rpmrel)),--enable-pulse,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(filter rhel4 rhel5 sles10.1 turbolinux11,$(rpmrel)),--with-qt4-dir=/home/vbox/Qt-4.4.3-stdc++6-$(arch)) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(DEBUG),--build-debug,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncbld_flags := AUTOCFG=$(current)/rpm/AutoConfig.kmk \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync LOCALCFG=$(current)/rpm/LocalConfig.kmk \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync PATH_OUT=$(builddir) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_DO_STRIP= \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_WITH_MULTIVERSION_PYTHON= \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(doc_dir) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_WITH_DOCS_CHM=1 \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_PACKAGE_DIST=$(rpmdist) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_SVN_REV=$(svnrev) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(NODOCS),VBOX_WITH_DOCS= ,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(filter rhel4 rhel5 fedora9 fedora10 sles10.1 turbolinux11,$(rpmrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncrpm/configure-stamp:
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync cd $(vboxroot) && ./configure --odir=$(current)/rpm $(cfg_flags)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync touch $(current)/rpm/configure-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncrpm/build-stamp: rpm/configure-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync . rpm/env.sh && kmk -C $(vboxroot) $(if $(NOPARALLEL),-j1,) $(bld_flags) all
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(NODOCS),,. rpm/env.sh && kmk -C $(vboxroot)/src/VBox/Main $(bld_flags) docs)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI32.fd $(builddir)/bin,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI64.fd $(builddir)/bin,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync mkdir -p $(builddir)/bin/additions
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync VBOX_NO_LINUX_RUN_INSTALLER=1 \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync packing
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync touch rpm/build-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncclean:
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -rf $(archdir)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -rf $(builddir) rpm/VirtualBox-*
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -f rpm/VirtualBox.tar.bz2
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -f rpm/VirtualBox.spec
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -f rpm/build-stamp rpm/configure-stamp rpm/configure.log
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -f rpm/AutoConfig.kmk rpm/env.sh
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncifeq ($(VBOX_VERSION_MAJOR),)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncbinary: rpm/build-stamp $(verfile)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync $(MAKE) -f rpm/rules binary
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncelse
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncbinary: rpm/build-stamp
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -rf rpm/VirtualBox-*
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync tar -xjf $(builddir)/bin/VirtualBox.tar.bz2 -C rpm
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync sed \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%VER%|$(ver)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%NAME%|$(verpkg)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%BUILDVER%|$(rpmver)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%BUILDREL%|$(rpmrel)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%BUILDROOT%|$(current)/rpm/buildroot|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%LIB%|$(rpmlib)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%LICENSE%|$(notdir $(wildcard $(builddir)/bin/License-*.html))|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%SPEC%|$(rpmspec)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%MACROSPYTHON%|$(if $(wildcard /usr/lib/rpm/macros.python),%include /usr/lib/rpm/macros.python,)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%INSTMOD%|$(instmod)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%LIBASOUND%|$(if $(filter lib64,$(rpmlib)),libasound.so.2()(64bit),libasound.so.2)|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rpm/VirtualBox.tmpl.spec > $(archdir)/VirtualBox.spec
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync sed \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%NOLSB%|yes|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%DEBIAN%||g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%PACKAGE%|virtualbox|g' \
b723b174d7132ab6bbff3abcd83c92530065f7davboxsync -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync vboxdrv.sh.in > $(archdir)/vboxdrv.init
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync sed \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%NOLSB%|yes|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%DEBIAN%||g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -e 's|%PACKAGE%|virtualbox|g' \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync vboxweb-service.sh.in > $(archdir)/vboxweb-service.init
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync cp debian/VBox.sh $(archdir)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync mv rpm/VirtualBox-$(ver) rpm/$(rpmname)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync tar -cjf rpm/VirtualBox.tar.bz2 -C rpm $(rpmname)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -f /usr/src/packages/RPMS/*/VirtualBox*rpm
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rm -f /usr/src/packages/SPECS/*
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync rpmbuild -tb --clean rpm/VirtualBox.tar.bz2
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync mv /usr/src/packages/RPMS/*/$(verpkg)-debug* $(vboxroot)/.. || true
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync file=`find /usr/src/packages/RPMS -name $(verpkg)*rpm -print`; \
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync mv $$file $(pkgdir)
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Note! if rpmbuild fails: sudo chmod a+rw /usr/src/redhat/* /usr/src/redhat/RPMS/*
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync# Note! if find/mv fails: sudo ln -s redhat/ /usr/src/packages
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncendif
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync.PHONY: binary clean