VirtualBox

Ignore:
Timestamp:
Mar 7, 2012 1:58:08 PM (13 years ago)
Author:
vboxsync
Message:

deb/rpm: fix package building, VNC extension pack is integrated if requested, various other cleanups in this area

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/rpm/rules

    r40264 r40390  
    11#!/usr/bin/make -f
    2 
    32#
    4 # Copyright (C) 2006-2011 Oracle Corporation
     3# Copyright (C) 2006-2012 Oracle Corporation
    54#
    65# This file is part of VirtualBox Open Source Edition (OSE), as
     
    1312#
    1413
     14# possible overrides:
     15#  OSE=1            force VBOX_OSE
     16#  NOPARALLEL=1     compile with -j1
     17#  LINUX=<dir>      compile vboxdrv against Linux found in <dir>
     18#  VERBOSE=1        verbose build
     19#  DEBUG=1          debug build
     20#  NOSUBVER=1       disable generation of the sub-version field (which is
     21#                   either the subversion rev [if available] or the build date)
     22#  NODOCS=1         don't build docs, use precompiled UserManual.pdf and
     23#                   VirtualBox.chm from $HOME
     24#  NOMODS=1         don't build any module
     25#  NOQT=1           don't build the Qt GUI
     26#  EFI=1            include the EFI binary from prebuild
     27#  VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
     28#  HEADLESS=1       build the headless version
     29#  VNC=1            build VNC code
     30#  NOWEBSVC=1       don't build the webservice API, default for OSE
     31#  STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
     32#  PKGDIR=<path>    where to store the final package(s)
     33#  BLEEDING_EDGE=xyz
     34
    1535ifeq ($(wildcard rpm/rules),)
    1636$(error call rpm/rules from src/VBox/Installer/linux)
     
    3555verpkg   := VirtualBox-4.1
    3656current  := $(shell pwd)
    37 vboxroot := $(shell cd ../../../../; pwd)
     57vboxroot := $(shell cd ../../../..; pwd)
    3858pkgdir   := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
    3959builddir := $(current)/rpm/builddir
     
    4161arch     := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "i386"; fi)
    4262verfile  := $(builddir)/version-generated.mk
     63ose      := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
    4364-include $(vboxroot)/SVN_REVISION
    4465svnrev   :=$(if $(svn_revision),$(svn_revision),0)
     66
     67NOMODS   ?= $(ose)
     68NOQT     ?= $(HEADLESS)
     69NOWEBSVC ?= $(ose)
     70NOWINE   := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
    4571
    4672ifneq ($(MAKECMDGOALS),clean)
     
    7197  $(error failed to detect the .spec file (rpmrel=$(rpmrel)))
    7298 endif
    73 
    74  include $(verfile)
    75 $(verfile): rpm/configure-stamp
    76         . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) $(verfile)
    77 endif
    78 
     99endif
     100
     101ifneq ($(wildcard $(verfile)),)
     102include $(verfile)
    79103ver      := $(VBOX_VERSION_STRING)
    80 rpmver   :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(DEBUG),_dbg,))$(if $(BLEEDING_EDGE),_$(BLEEDING_EDGE),)
     104rpmver   :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(HEADLESS),_headless,)$(if $(DEBUG),_dbg,))$(if $(BLEEDING_EDGE),_$(BLEEDING_EDGE),)
    81105archdir  := $(current)/rpm/VirtualBox-$(ver)
    82106rpmname  := $(verpkg)-$(rpmver)_$(rpmrel)
     107endif
    83108
    84109# Fedora13/14 is bleeding edge, the other jails have outdated kernel headers
     
    104129endif
    105130
    106 cfg_flags := $(if $(filter rhel4 sles10.1,$(rpmrel)),--build-libxml2,) \
     131cfg_flags := $(if $(NOQT),--disable-qt,) \
     132             $(if $(filter rhel4 sles10.1,$(rpmrel)),--build-libxml2,) \
    107133             $(if $(filter rhel4,$(rpmrel)),--build-libssl,) \
    108134             $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 sles10.1,$(rpmrel)),--build-libcurl,) \
     
    111137             $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5,$(rpmrel)),--enable-pulse,) \
    112138             $(if $(filter rhel4 rhel5 ol4 ol5 centos4 centos5 sles10.1 turbolinux11,$(rpmrel)),--with-qt4-dir=/home/vbox/Qt-4.7.4-stdc++6-$(arch)) \
     139             $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
     140             $(if $(HEADLESS),--build-headless,) \
    113141             $(if $(DEBUG),--build-debug,) \
     142             $(if $(NOWINE),,--setup-wine) \
     143             $(if $(NOWEBSVC),,--enable-webservice) \
     144             $(if $(VNC),--enable-vnc,) \
    114145             --disable-extpack
    115146
     
    118149             PATH_OUT=$(builddir) \
    119150             VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \
     151             VBOX_WITHOUT_EXTPACK_VNC_PACKING=1 \
    120152             VBOX_DO_STRIP= \
     153             VBOX_DO_STRIP_MODULES= \
    121154             VBOX_WITH_MULTIVERSION_PYTHON= \
    122155             $(doc_dir) \
    123              VBOX_WITH_DOCS_CHM=1 \
     156             $(if $(ose),,VBOX_WITH_DOCS_CHM=1) \
    124157             VBOX_PACKAGE_DIST=$(rpmdist) \
    125158             VBOX_SVN_REV=$(svnrev) \
     
    132165rpm/configure-stamp:
    133166        cd $(vboxroot) && ./configure --odir=$(current)/rpm $(cfg_flags)
    134         touch $(current)/rpm/configure-stamp
    135 
    136 rpm/build-stamp: rpm/configure-stamp
    137         . rpm/env.sh && kmk -C $(vboxroot) $(if $(NOPARALLEL),-j1,) $(bld_flags) all
    138         $(if $(NODOCS),,. rpm/env.sh && kmk -C $(vboxroot)/src/VBox/Main $(bld_flags) docs)
     167        touch rpm/configure-stamp
     168
     169rpm/build-stamp $(verfile): rpm/configure-stamp
     170        . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
    139171        $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
    140172        $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
     
    181213           rpm/VirtualBox.tmpl.spec > $(archdir)/VirtualBox.spec
    182214        sed \
    183            -e 's|%NOLSB%|yes|g' \
    184            -e 's|%DEBIAN%||g' \
    185            -e 's|%PACKAGE%|virtualbox|g' \
    186            -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
    187            -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
    188            vboxdrv.sh.in > $(archdir)/vboxdrv.init
    189         sed \
    190            -e 's|%NOLSB%|yes|g' \
    191            -e 's|%DEBIAN%||g' \
    192            -e 's|%PACKAGE%|virtualbox|g' \
    193            vboxballoonctrl-service.sh.in > $(archdir)/vboxballoonctrl-service.init
    194         sed \
    195            -e 's|%NOLSB%|yes|g' \
    196            -e 's|%DEBIAN%||g' \
    197            -e 's|%PACKAGE%|virtualbox|g' \
    198            vboxweb-service.sh.in > $(archdir)/vboxweb-service.init
     215            -e 's|%NOLSB%|yes|g' \
     216            -e 's|%DEBIAN%||g' \
     217            -e 's|%PACKAGE%|virtualbox|g' \
     218            -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
     219            -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
     220            vboxdrv.sh.in > $(archdir)/vboxdrv.init
     221        sed \
     222            -e 's|%NOLSB%|yes|g' \
     223            -e 's|%DEBIAN%||g' \
     224            -e 's|%PACKAGE%|virtualbox|g' \
     225            vboxballoonctrl-service.sh.in > $(archdir)/vboxballoonctrl-service.init
     226        sed \
     227            -e 's|%NOLSB%|yes|g' \
     228            -e 's|%DEBIAN%||g' \
     229            -e 's|%PACKAGE%|virtualbox|g' \
     230            vboxweb-service.sh.in > $(archdir)/vboxweb-service.init
    199231        cp debian/VBox.sh $(archdir)
    200232        mv rpm/VirtualBox-$(ver) rpm/$(rpmname)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette