VirtualBox

Ignore:
Timestamp:
Jun 26, 2020 3:38:55 PM (5 years ago)
Author:
vboxsync
Message:

Installer/linux: For RPM build, finish making the CHM docs optional, and also put all build files into the out directory. Finally no more rubbish in some random directories in the source code area.

Location:
trunk/src/VBox/Installer/linux/rpm
Files:
2 edited

Legend:

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

    • Property svn:ignore deleted
  • trunk/src/VBox/Installer/linux/rpm/rules

    r84960 r84974  
    5656vboxroot := $(shell while ! test -r configure && ! test "$PWD" = "/"; do cd ..; done; pwd)
    5757pkgdir   := $(if $(PKGDIR),$(PKGDIR),$(shell cd $(vboxroot)/..; pwd))
    58 builddir := $(vboxroot)/out/rpm/builddir
    59 stagedir := $(vboxroot)/src/VBox/Installer/linux/rpmbuild
     58bldbase  := $(vboxroot)/out/rpm
     59builddir := $(bldbase)/builddir
     60stagedir := $(bldbase)/rpmbuild
    6061rpmlib   := $(shell if [ `uname -m` = "x86_64" ]; then echo "lib64"; else echo "lib"; fi)
    6162chrarch  := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "x86"; fi)
     
    121122 # contrary to debian we need the verfile earlier to get the correct rpmname into the bld_flags
    122123 include $(verfile)
    123 $(verfile): rpm/configure-stamp
    124         . rpm/env.sh && kmk -C $(vboxroot) $(verfile) $(bld_flags)
     124$(verfile): $(bldbase)/configure-stamp
     125        . $(bldbase)/env.sh && kmk -C $(vboxroot) $(verfile) $(bld_flags)
    125126
    126127endif
     
    128129ver      := $(VBOX_VERSION_STRING)
    129130rpmver   :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(HEADLESS),_headless,)$(if $(DEBUG),_dbg,))
    130 archdir  := $(current)/rpm/VirtualBox-$(ver)
     131archdir  := $(bldbase)/VirtualBox-$(ver)
    131132rpmname  := $(verpkg)-$(rpmver)_$(rpmrel)
    132133
     
    165166             --disable-extpack
    166167
    167 bld_flags := AUTOCFG=$(current)/rpm/AutoConfig.kmk \
     168bld_flags := AUTOCFG=$(bldbase)/AutoConfig.kmk \
    168169             LOCALCFG=$(current)/rpm/LocalConfig.kmk \
    169170             PATH_OUT=$(builddir) \
     
    184185             $(if $(filter el5,$(rpmrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
    185186
    186 rpm/configure-stamp:
    187         cd $(vboxroot) && ./configure --odir=$(current)/rpm $(cfg_flags)
    188         touch rpm/configure-stamp
    189 
    190 rpm/build-stamp: rpm/configure-stamp
    191         . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
     187$(bldbase)/configure-stamp:
     188        mkdir -p $(bldbase)
     189        cd $(vboxroot) && ./configure --odir=$(bldbase) $(cfg_flags)
     190        touch $@
     191
     192$(bldbase)/build-stamp: $(bldbase)/configure-stamp
     193        . $(bldbase)/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
    192194        $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
    193195        $(if $(STAGEDCHM),cp $(STAGEDCHM)/VirtualBox*.chm $(builddir)/bin,)
     
    196198        mkdir -p $(builddir)/bin/additions
    197199        $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
    198         . rpm/env.sh && kmk -C $(vboxroot) $(bld_flags) \
     200        . $(bldbase)/env.sh && kmk -C $(vboxroot) $(bld_flags) \
    199201            VBOX_NO_LINUX_RUN_INSTALLER=1 \
    200202            VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86.tar.bz2 \
     
    203205            VBOX_PATH_ADDITIONS.linux.amd64=$(builddir)/bin/additions \
    204206            packing
    205         touch rpm/build-stamp
     207        touch $@
    206208
    207209clean:
     
    209211        rm -rf $(stagedir)
    210212        rm -rf $(builddir)
    211         rm -rf $(vboxroot)/rpm
    212         rm -rf rpm/VirtualBox-*
    213         rm -f rpm/VirtualBox.tar rpm/VirtualBox.tar.bz2
    214         rm -f rpm/VirtualBox.spec
    215         rm -f rpm/build-stamp rpm/configure-stamp rpm/configure.log
    216         rm -f rpm/AutoConfig.kmk rpm/env.sh
     213        rm -rf $(bldbase)/VirtualBox-*
     214        rm -f $(bldbase)/VirtualBox.tar $(bldbase)/VirtualBox.tar.bz2
     215        rm -f $(bldbase)/VirtualBox.spec
     216        rm -f $(bldbase)/build-stamp $(bldbase)/configure-stamp $(bldbase)/configure.log
     217        rm -f $(bldbase)/AutoConfig.kmk $(bldbase)/env.sh
     218        if [ -d $(bldbase) ]; then rmdir $(bldbase); fi
    217219
    218220ifeq ($(VBOX_VERSION_MAJOR),)
    219 binary: rpm/build-stamp $(verfile)
     221binary: $(bldbase)/build-stamp $(verfile)
    220222        $(MAKE) -f rpm/rules binary
    221223else
    222 binary: rpm/build-stamp
    223         rm -rf rpm/VirtualBox-*
    224         tar -xf $(builddir)/bin/VirtualBox.tar -C rpm
     224binary: $(bldbase)/build-stamp
     225        rm -rf $(bldbase)/VirtualBox-*
     226        tar -xf $(builddir)/bin/VirtualBox.tar -C $(bldbase)
    225227        sed \
    226228            -e 's|%VER%|$(ver)|g' \
     
    228230            -e 's|%BUILDVER%|$(rpmver)|g' \
    229231            -e 's|%BUILDREL%|$(rpmrel)|g' \
    230             -e 's|%BUILDROOT%|$(current)/rpm/buildroot|g' \
    231             -e 's|%LIB%|$(rpmlib)|g' \
     232            -e 's|%BUILDROOT%|$(bldbase)/buildroot|g' \
    232233            -e 's|%OSE%|$(if $(ose),is_ose,not_ose)|g' \
    233234            -e 's|%SPEC%|$(rpmspec)|g' \
    234             -e 's|%PYTHON%|$(if $(filter el5,$(rpmrel)),,with_python)|g' \
     235            -e 's|%CHM%|$(if $(STAGEDCHM),with_chm,without_chm)|g' \
     236            -e 's|%PYTHON%|$(if $(filter el5,$(rpmrel)),without_python,with_python)|g' \
    235237            -e 's|%MACROSPYTHON%|$(if $(wildcard /usr/lib/rpm/macros.d/macros.python3),,$(if $(wildcard /usr/lib/rpm/macros.python),%include /usr/lib/rpm/macros.python,))|g' \
    236238            -e 's|%INSTMOD%|$(instmod)|g' \
    237239            -e 's|%LIBASOUND%|$(if $(filter lib64,$(rpmlib)),libasound.so.2()(64bit),libasound.so.2)|g' \
    238240            -e 's|%INITSCRIPTS%|$(if $(filter fedora,$(rpmspec)),initscripts,)|g' \
    239             -e 's|%WEBSVC%|$(if $(NOWEBSVC),false,true)|g' \
    240241            -e 's|%NETTOOLS%|$(if $(filter fedora18 fedora19 fedora20 fedora21 el5 openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114,$(rpmrel)),net-tools,iproute)|g' \
    241             rpm/VirtualBox.tmpl.spec > $(archdir)/VirtualBox.spec
    242         mv rpm/VirtualBox-$(ver) rpm/$(rpmname)
    243         cp ../../../../tools/linux.$(chrarch)/bin/chrpath rpm/$(rpmname) || true
    244         tar -cf rpm/VirtualBox.tar -C rpm $(rpmname)
    245         rm -f rpmbuild/RPMS/*/VirtualBox*rpm
    246         rm -f rpmbuild/SPECS/*
    247         mkdir -p rpmbuild/BUILD rpmbuild/RPMS/i386 rpmbuild/RPMS/x86_64 rpmbuild/SOURCES rpmbuild/SPECS rpmbuild/SRPMS
    248         (cd rpm; rpmbuild --define '_topdir $(current)/rpmbuild' -tb --clean VirtualBox.tar)
    249         mv rpmbuild/RPMS/*/$(verpkg)-debug* $(pkgdir) || true
    250         file=`find rpmbuild/RPMS -name $(verpkg)*rpm -print`; \
     242            $(current)/rpm/VirtualBox.tmpl.spec > $(archdir)/VirtualBox.spec
     243        mv $(bldbase)/VirtualBox-$(ver) $(bldbase)/$(rpmname)
     244        cp ../../../../tools/linux.$(chrarch)/bin/chrpath $(bldbase)/$(rpmname) || true
     245        tar -cf $(bldbase)/VirtualBox.tar -C $(bldbase) $(rpmname)
     246        rm -f $(stagedir)/RPMS/*/VirtualBox*rpm
     247        rm -f $(stagedir)/SPECS/*
     248        mkdir -p $(stagedir)/BUILD $(stagedir)/RPMS/i386 $(stagedir)/RPMS/x86_64 $(stagedir)/SOURCES $(stagedir)/SPECS $(stagedir)/SRPMS
     249        (cd $(bldbase); rpmbuild --define '_topdir $(stagedir)' -tb --clean VirtualBox.tar)
     250        mv $(stagedir)/RPMS/*/$(verpkg)-debug* $(pkgdir) || true
     251        file=`find $(stagedir)/RPMS -name $(verpkg)*rpm -print`; \
    251252            mv $$file $(pkgdir)
    252253# Note! if rpmbuild fails: sudo chmod a+rw /usr/src/redhat/* /usr/src/redhat/RPMS/*
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