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