rules revision 49c9958a74e4a297fb7ec141ee764e872430f4ba
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews#!/usr/bin/make -f
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
6825f304c5f0cc2d4ba22fa2b6f7a431f9c1de59Tinderbox User#
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# Copyright (C) 2006-2011 Oracle Corporation
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User#
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# This file is part of VirtualBox Open Source Edition (OSE), as
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# available from http://www.virtualbox.org. This file is free software;
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# you can redistribute it and/or modify it under the terms of the GNU
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews# General Public License as published by the Free Software Foundation,
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# distribution. VirtualBox OSE is distributed in the hope that it will
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# be useful, but WITHOUT ANY WARRANTY of any kind.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifeq ($(wildcard rpm/rules),)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont$(error call rpm/rules from src/VBox/Installer/linux)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifneq ($(wildcard /usr/lib/rpm/find-requires.ksyms),)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# don't allow to check for kernel syms, otherwise we depend on specific kernel versions!
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(error /usr/lib/rpm/find-requires.ksyms must not be installed)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontendif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifneq ($(wildcard /usr/lib/rpm/find-supplements.ksyms),)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# same for openSUSE
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(error /usr/lib/rpm/find-supplements.ksyms must not be installed)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontendif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontifeq ($(shell if grep -q '^/usr/lib/virtualbox' /etc/permissions* 2>/dev/null; then echo yes; fi),yes)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# make sure openSUSE permissions fixes don't interfere with us
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(error Fix /etc/permissions*)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifeq ($(shell if grep -q '^%disttag' /usr/lib/rpm/macros.d/mandriva 2>/dev/null; then echo yes; fi),yes)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(error Fix /usr/lib/rpm/macros.d/mandriva)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userendif
de283bda6a902c2102a795192eeab3a769001c7dTinderbox User
de283bda6a902c2102a795192eeab3a769001c7dTinderbox Userverpkg := VirtualBox-4.1
de283bda6a902c2102a795192eeab3a769001c7dTinderbox Usercurrent := $(shell pwd)
de283bda6a902c2102a795192eeab3a769001c7dTinderbox Uservboxroot := $(shell cd ../../../../; pwd)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontpkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userbuilddir := $(current)/rpm/builddir
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userrpmlib := $(shell if [ `uname -m` = "x86_64" ]; then echo "lib64"; else echo "lib"; fi)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userarch := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "i386"; fi)
de283bda6a902c2102a795192eeab3a769001c7dTinderbox Userverfile := $(builddir)/version-generated.mk
de283bda6a902c2102a795192eeab3a769001c7dTinderbox User-include $(vboxroot)/SVN_REVISION
de283bda6a902c2102a795192eeab3a769001c7dTinderbox Usersvnrev :=$(if $(svn_revision),$(svn_revision),0)
de283bda6a902c2102a795192eeab3a769001c7dTinderbox User
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontifneq ($(MAKECMDGOALS),clean)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User rpmrel := $(shell cat /etc/distname)
de283bda6a902c2102a795192eeab3a769001c7dTinderbox User ifeq ($(rpmrel),)
de283bda6a902c2102a795192eeab3a769001c7dTinderbox User # look for fedora
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User rpmrel := $(shell cat /etc/fedora-release | sed -e 's/^Fedora *release *\([1-9][0-9]*\) .*/fedora\1/')
de283bda6a902c2102a795192eeab3a769001c7dTinderbox User endif
de283bda6a902c2102a795192eeab3a769001c7dTinderbox User ifeq ($(rpmrel),)
de283bda6a902c2102a795192eeab3a769001c7dTinderbox User $(error failed to detect the release type. Add /etc/distname or hack the detection.)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont endif
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User
de283bda6a902c2102a795192eeab3a769001c7dTinderbox User rpmdist := $(strip $(shell grep $(rpmrel) $(current)/distributions_rpm | cut -d'=' -f2))
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont ifeq ($(rpmdist),)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(error Cannot detect package distribution (rpmrel=$(rpmrel)))
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont endif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont ifeq ($(filter-out rhel4 rhel5 rhel6 ol4 ol5 ol6 centos4 centos5 centos6 fedora9 fedora11 fedora12 fedora13 fedora14 fedora15 fedora16 turbolinux11,$(rpmrel)),)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont rpmspec := rpm_redhat
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont endif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114 sles10.1 sles11.0,$(rpmrel)),)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User rpmspec := rpm_suse
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont endif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont ifeq ($(filter-out mdv2009.1 mdv2010.0 mdv2011.0,$(rpmrel)),)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont rpmspec := rpm_mdv
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont endif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont ifeq ($(rpmspec),)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(error failed to detect the .spec file (rpmrel=$(rpmrel)))
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont endif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User include $(verfile)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(verfile): rpm/configure-stamp
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) $(verfile)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userendif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontver := $(VBOX_VERSION_STRING)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontrpmver :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(DEBUG),_dbg,))$(if $(BLEEDING_EDGE),_$(BLEEDING_EDGE),)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontarchdir := $(current)/rpm/VirtualBox-$(ver)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userrpmname := $(verpkg)-$(rpmver)_$(rpmrel)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Fedora13/14 is bleeding edge, the other jails have outdated kernel headers
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userinstmod := $(if $(filter rhel4 rhel5 rhel6 ol4 ol5 ol6 centos4 centos5 centos6 sles10.1 sles11.0 fedora13 fedora14 fedora15 fedora16,$(rpmrel)),,install_rpm)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontifneq ($(STAGEDISO),)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User$(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontendif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontendif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifeq ($(wildcard /usr/share/doc/packages/bash),)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ifeq ($(wildcard /usr/share/doc/bash),)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # Mandriva 2007.1, Redhat
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(rpmname)\""
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont else
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont # Mandriva 2008.0
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\""
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User endif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontelse
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont # Novell (OpenSUSE, SLES)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User doc_dir := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/packages/$(verpkg)\""
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontendif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontcfg_flags := $(if $(filter rhel4 sles10.1,$(rpmrel)),--build-libxml2,) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(filter rhel4 sles10.1,$(rpmrel)),--build-libxslt,) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(filter rhel4,$(rpmrel)),--build-libssl,) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 sles10.1,$(rpmrel)),--build-libcurl,) \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(if $(filter rhel5 centos5 sles10.1,$(rpmrel)),--disable-sdl-ttf,) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(filter sles10.1 turbolinux11,$(rpmrel)),--disable-pulse,) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5,$(rpmrel)),--enable-pulse,) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 sles10.1 turbolinux11,$(rpmrel)),--with-qt4-dir=/home/vbox/Qt-4.7.4-stdc++6-$(arch)) \
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User $(if $(DEBUG),--build-debug,)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontbld_flags := AUTOCFG=$(current)/rpm/AutoConfig.kmk \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont LOCALCFG=$(current)/rpm/LocalConfig.kmk \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont PATH_OUT=$(builddir) \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont VBOX_DO_STRIP= \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont VBOX_WITH_MULTIVERSION_PYTHON= \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(doc_dir) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont VBOX_WITH_DOCS_CHM=1 \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User VBOX_PACKAGE_DIST=$(rpmdist) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont VBOX_SVN_REV=$(svnrev) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(NODOCS),VBOX_WITH_DOCS= ,) \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 fedora9 fedora10 sles10.1 turbolinux11,$(rpmrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontrpm/configure-stamp:
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User cd $(vboxroot) && ./configure --odir=$(current)/rpm $(cfg_flags)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont touch $(current)/rpm/configure-stamp
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userrpm/build-stamp: rpm/configure-stamp
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont . rpm/env.sh && kmk -C $(vboxroot) $(if $(NOPARALLEL),-j1,) $(bld_flags) all
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(if $(NODOCS),,. rpm/env.sh && kmk -C $(vboxroot)/src/VBox/Main $(bld_flags) docs)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI32.fd $(builddir)/bin,)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI64.fd $(builddir)/bin,)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User mkdir -p $(builddir)/bin/additions
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont VBOX_NO_LINUX_RUN_INSTALLER=1 \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User packing
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont touch rpm/build-stamp
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontclean:
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont rm -rf $(archdir)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User rm -rf $(builddir) rpm/VirtualBox-*
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont rm -f rpm/VirtualBox.tar.bz2
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User rm -f rpm/VirtualBox.spec
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont rm -f rpm/build-stamp rpm/configure-stamp rpm/configure.log
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont rm -f rpm/AutoConfig.kmk rpm/env.sh
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
ea640e04eae220b5e569f188563eb1f204c7c77eTinderbox Userifeq ($(VBOX_VERSION_MAJOR),)
ea640e04eae220b5e569f188563eb1f204c7c77eTinderbox Userbinary: rpm/build-stamp $(verfile)
ea640e04eae220b5e569f188563eb1f204c7c77eTinderbox User $(MAKE) -f rpm/rules binary
ea640e04eae220b5e569f188563eb1f204c7c77eTinderbox Userelse
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontbinary: rpm/build-stamp
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User rm -rf rpm/VirtualBox-*
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont tar -xjf $(builddir)/bin/VirtualBox.tar.bz2 -C rpm
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont sed \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%VER%|$(ver)|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%NAME%|$(verpkg)|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%BUILDVER%|$(rpmver)|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%BUILDREL%|$(rpmrel)|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%BUILDROOT%|$(current)/rpm/buildroot|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%LIB%|$(rpmlib)|g' \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -e 's|%SPEC%|$(rpmspec)|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%MACROSPYTHON%|$(if $(wildcard /usr/lib/rpm/macros.python),%include /usr/lib/rpm/macros.python,)|g' \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -e 's|%INSTMOD%|$(instmod)|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%LIBASOUND%|$(if $(filter lib64,$(rpmlib)),libasound.so.2()(64bit),libasound.so.2)|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%INITSCRIPTS%|$(if $(filter fedora,$(rpmspec)),initscripts,)|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e '/#include installer-utils.sh/ {' \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -e "r $(vboxroot)/src/VBox/Installer/linux/installer-utils.sh" \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 'd' \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -e '}' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont rpm/VirtualBox.tmpl.spec > $(archdir)/VirtualBox.spec
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont sed \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%NOLSB%|yes|g' \
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User -e 's|%DEBIAN%||g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%PACKAGE%|virtualbox|g' \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont vboxdrv.sh.in > $(archdir)/vboxdrv.init
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User sed \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%NOLSB%|yes|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%DEBIAN%||g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%PACKAGE%|virtualbox|g' \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User vboxballoonctrl-service.sh.in > $(archdir)/vboxballoonctrl-service.init
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont sed \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -e 's|%NOLSB%|yes|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%DEBIAN%||g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -e 's|%PACKAGE%|virtualbox|g' \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont vboxweb-service.sh.in > $(archdir)/vboxweb-service.init
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont cp debian/VBox.sh $(archdir)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User mv rpm/VirtualBox-$(ver) rpm/$(rpmname)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont tar -cjf rpm/VirtualBox.tar.bz2 -C rpm $(rpmname)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User rm -f /usr/src/packages/RPMS/*/VirtualBox*rpm
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont rm -f /usr/src/packages/SPECS/*
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont (cd rpm; rpmbuild -tb --clean VirtualBox.tar.bz2)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User mv /usr/src/packages/RPMS/*/$(verpkg)-debug* $(pkgdir) || true
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont file=`find /usr/src/packages/RPMS -name $(verpkg)*rpm -print`; \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User mv $$file $(pkgdir)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# Note! if rpmbuild fails: sudo chmod a+rw /usr/src/redhat/* /usr/src/redhat/RPMS/*
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# Note! if find/mv fails: sudo ln -s redhat/ /usr/src/packages
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontendif
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont.PHONY: binary clean
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont