rules revision f1517b3016a7e68a8edb55ea82c704af7386c9ad
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync#!/usr/bin/make -f
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync#
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# Copyright (C) 2006-2012 Oracle Corporation
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync#
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# available from http://www.virtualbox.org. This file is free software;
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# you can redistribute it and/or modify it under the terms of the GNU
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# General Public License as published by the Free Software Foundation,
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync#
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# possible overrides:
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# OSE=1 force VBOX_OSE
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# NOPARALLEL=1 compile with -j1
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# LINUX=<dir> compile vboxdrv against Linux found in <dir>
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# VERBOSE=1 verbose build
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# DEBUG=1 debug build
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# NOSUBVER=1 disable generation of the sub-version field (which is
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# either the subversion rev [if available] or the build date)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# VirtualBox.chm from $HOME
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# NOMODS=1 don't build any module
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# NOQT=1 don't build the Qt GUI
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# EFI=1 include the EFI binary from prebuild
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# HEADLESS=1 build the headless version
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# VNC=1 build VNC code
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# NOWEBSVC=1 don't build the webservice API, default for OSE
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# PKGDIR=<path> where to store the final package(s)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# BLEEDING_EDGE=xyz
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifeq ($(wildcard rpm/rules),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync$(error call rpm/rules from src/VBox/Installer/linux)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifneq ($(wildcard /usr/lib/rpm/find-requires.ksyms),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# don't allow to check for kernel syms, otherwise we depend on specific kernel versions!
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync$(error /usr/lib/rpm/find-requires.ksyms must not be installed)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifneq ($(wildcard /usr/lib/rpm/find-supplements.ksyms),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# same for openSUSE
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync$(error /usr/lib/rpm/find-supplements.ksyms must not be installed)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifeq ($(shell if grep -q '^/usr/lib/virtualbox' /etc/permissions* 2>/dev/null; then echo yes; fi),yes)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# make sure openSUSE permissions fixes don't interfere with us
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync$(error Fix /etc/permissions*)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifeq ($(shell if grep -q '^%disttag' /usr/lib/rpm/macros.d/mandriva 2>/dev/null; then echo yes; fi),yes)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync$(error Fix /usr/lib/rpm/macros.d/mandriva)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncverpkg := VirtualBox-4.1
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsynccurrent := $(shell pwd)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncvboxroot := $(shell cd ../../../..; pwd)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncpkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncbuilddir := $(current)/rpm/builddir
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncrpmlib := $(shell if [ `uname -m` = "x86_64" ]; then echo "lib64"; else echo "lib"; fi)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncarch := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "i386"; fi)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncverfile := $(builddir)/version-generated.mk
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync-include $(vboxroot)/SVN_REVISION
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncsvnrev :=$(if $(svn_revision),$(svn_revision),0)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncNOMODS ?= $(ose)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncNOQT ?= $(HEADLESS)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncNOWEBSVC ?= $(ose)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifneq ($(MAKECMDGOALS),clean)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rpmrel := $(shell cat /etc/distname)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync ifeq ($(rpmrel),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync # look for fedora
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rpmrel := $(shell cat /etc/fedora-release | sed -e 's/^Fedora *release *\([1-9][0-9]*\) .*/fedora\1/')
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync endif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync ifeq ($(rpmrel),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(error failed to detect the release type. Add /etc/distname or hack the detection.)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync endif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rpmdist := $(strip $(shell grep $(rpmrel) $(current)/distributions_rpm | cut -d'=' -f2))
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync ifeq ($(rpmdist),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(error Cannot detect package distribution (rpmrel=$(rpmrel)))
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync endif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync ifeq ($(filter-out rhel4 rhel5 rhel6 ol4 ol5 ol6 centos4 centos5 centos6 fedora9 fedora11 fedora12 fedora13 fedora14 fedora15 fedora16 fedora17 turbolinux11,$(rpmrel)),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rpmspec := rpm_redhat
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync endif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114 sles10.1 sles11.0,$(rpmrel)),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rpmspec := rpm_suse
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync endif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync ifeq ($(filter-out mdv2009.1 mdv2010.0 mdv2011.0,$(rpmrel)),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rpmspec := rpm_mdv
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync endif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync ifeq ($(rpmspec),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(error failed to detect the .spec file (rpmrel=$(rpmrel)))
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync endif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifneq ($(wildcard $(verfile)),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncinclude $(verfile)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncver := $(VBOX_VERSION_STRING)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncrpmver :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(HEADLESS),_headless,)$(if $(DEBUG),_dbg,))$(if $(BLEEDING_EDGE),_$(BLEEDING_EDGE),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncarchdir := $(current)/rpm/VirtualBox-$(ver)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncrpmname := $(verpkg)-$(rpmver)_$(rpmrel)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# Fedora13/14 is bleeding edge, the other jails have outdated kernel headers
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncinstmod := $(if $(filter rhel4 rhel5 rhel6 ol4 ol5 ol6 centos4 centos5 centos6 sles10.1 sles11.0 fedora13 fedora14 fedora15 fedora16 fedora17,$(rpmrel)),,install_rpm)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifneq ($(STAGEDISO),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync endif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifeq ($(wildcard /usr/share/doc/packages/bash),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync ifeq ($(wildcard /usr/share/doc/bash),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync # Mandriva 2007.1, Redhat
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(rpmname)\""
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync else
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync # Mandriva 2008.0
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\""
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync endif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncelse
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync # Novell (OpenSUSE, SLES)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/packages/$(verpkg)\""
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsynccfg_flags := $(if $(NOQT),--disable-qt,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(filter rhel4 sles10.1,$(rpmrel)),--build-libxml2,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(filter rhel4,$(rpmrel)),--build-libssl,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 sles10.1,$(rpmrel)),--build-libcurl,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(filter rhel5 centos5 sles10.1,$(rpmrel)),--disable-sdl-ttf,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(filter sles10.1 turbolinux11,$(rpmrel)),--disable-pulse,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5,$(rpmrel)),--enable-pulse,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 sles10.1 turbolinux11,$(rpmrel)),--with-qt4-dir=/home/vbox/Qt-4.7.4-stdc++6-$(arch)) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(HEADLESS),--build-headless,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(DEBUG),--build-debug,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(NOWINE),,--setup-wine) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(NOWEBSVC),,--enable-webservice) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(VNC),--enable-vnc,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync --disable-extpack
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncbld_flags := AUTOCFG=$(current)/rpm/AutoConfig.kmk \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync LOCALCFG=$(current)/rpm/LocalConfig.kmk \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync PATH_OUT=$(builddir) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_WITHOUT_EXTPACK_VNC_PACKING=1 \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_DO_STRIP= \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_DO_STRIP_MODULES= \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_WITH_MULTIVERSION_PYTHON= \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(doc_dir) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(ose),,VBOX_WITH_DOCS_CHM=1) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_PACKAGE_DIST=$(rpmdist) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_SVN_REV=$(svnrev) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(NODOCS),VBOX_WITH_DOCS= ,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 fedora9 fedora10 sles10.1 turbolinux11,$(rpmrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncrpm/configure-stamp:
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync cd $(vboxroot) && ./configure --odir=$(current)/rpm $(cfg_flags)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync touch rpm/configure-stamp
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncrpm/build-stamp $(verfile): rpm/configure-stamp
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI32.fd $(builddir)/bin,)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI64.fd $(builddir)/bin,)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync mkdir -p $(builddir)/bin/additions
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_NO_LINUX_RUN_INSTALLER=1 \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86-r$(svnrev).tar.bz2 \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_LNX_ADD_ARCHIVE.amd64=$(builddir)/bin/additions/VBoxGuestAdditions-amd64-r$(svnrev).tar.bz2 \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_PATH_ADDITIONS.linux.x86=$(builddir)/bin/additions \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync VBOX_PATH_ADDITIONS.linux.amd64=$(builddir)/bin/additions \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync packing
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync touch rpm/build-stamp
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncclean:
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rm -rf $(archdir)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rm -rf $(builddir) rpm/VirtualBox-*
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rm -f rpm/VirtualBox.tar.bz2
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rm -f rpm/VirtualBox.spec
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rm -f rpm/build-stamp rpm/configure-stamp rpm/configure.log
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rm -f rpm/AutoConfig.kmk rpm/env.sh
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncifeq ($(VBOX_VERSION_MAJOR),)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncbinary: rpm/build-stamp $(verfile)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync $(MAKE) -f rpm/rules binary
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncelse
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncbinary: rpm/build-stamp
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rm -rf rpm/VirtualBox-*
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync tar -xjf $(builddir)/bin/VirtualBox.tar.bz2 -C rpm
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync sed \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%VER%|$(ver)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%NAME%|$(verpkg)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%BUILDVER%|$(rpmver)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%BUILDREL%|$(rpmrel)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%BUILDROOT%|$(current)/rpm/buildroot|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%LIB%|$(rpmlib)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%OSE%|$(if $(ose),is_ose,not_ose)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%SPEC%|$(rpmspec)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%MACROSPYTHON%|$(if $(wildcard /usr/lib/rpm/macros.python),%include /usr/lib/rpm/macros.python,)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%INSTMOD%|$(instmod)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%LIBASOUND%|$(if $(filter lib64,$(rpmlib)),libasound.so.2()(64bit),libasound.so.2)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%INITSCRIPTS%|$(if $(filter fedora,$(rpmspec)),initscripts,)|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e "s|%WEBSVC%|$(if $(NOWEBSVC),false,true)|g" \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e '/#include installer-common.sh/ {' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e "r $(vboxroot)/src/VBox/Installer/linux/installer-common.sh" \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 'd' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e '}' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rpm/VirtualBox.tmpl.spec > $(archdir)/VirtualBox.spec
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync sed \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%NOLSB%|yes|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%DEBIAN%||g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%PACKAGE%|virtualbox|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync vboxdrv.sh.in > $(archdir)/vboxdrv.init
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync sed \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%NOLSB%|yes|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%DEBIAN%||g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%PACKAGE%|virtualbox|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync vboxballoonctrl-service.sh.in > $(archdir)/vboxballoonctrl-service.init
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync sed \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%NOLSB%|yes|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%DEBIAN%||g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync -e 's|%PACKAGE%|virtualbox|g' \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync vboxweb-service.sh.in > $(archdir)/vboxweb-service.init
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync cp debian/VBox.sh $(archdir)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync mv rpm/VirtualBox-$(ver) rpm/$(rpmname)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync tar -cjf rpm/VirtualBox.tar.bz2 -C rpm $(rpmname)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rm -f /usr/src/packages/RPMS/*/VirtualBox*rpm
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync rm -f /usr/src/packages/SPECS/*
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync (cd rpm; rpmbuild -tb --clean VirtualBox.tar.bz2)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync mv /usr/src/packages/RPMS/*/$(verpkg)-debug* $(pkgdir) || true
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync file=`find /usr/src/packages/RPMS -name $(verpkg)*rpm -print`; \
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync mv $$file $(pkgdir)
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# Note! if rpmbuild fails: sudo chmod a+rw /usr/src/redhat/* /usr/src/redhat/RPMS/*
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync# Note! if find/mv fails: sudo ln -s redhat/ /usr/src/packages
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncendif
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync.PHONY: binary clean
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync