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