- Timestamp:
- Jul 27, 2021 11:57:54 AM (4 years ago)
- Location:
- trunk/src/VBox/Installer/linux
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/debian
- Property svn:ignore deleted
-
trunk/src/VBox/Installer/linux/debian/compat
r32008 r90354 1 5 1 9 -
trunk/src/VBox/Installer/linux/debian/rules
r90118 r90354 23 23 24 24 #export DH_VERBOSE=1 25 export DH_COMPAT=526 25 27 26 # possible overrides: … … 33 32 # NOSUBVER=1 disable generation of the sub-version field (which is 34 33 # either the subversion rev [if available] or the build date) 35 # NODOCS=1 don't build docs, use precompiled UserManual .pdf and36 # maybe VirtualBox.qch and VirtualBox.qhc from $(vboxroot)/prebuild34 # NODOCS=1 don't build docs, use precompiled UserManual*.pdf and 35 # maybe UserManual*.qch and UserManual*.qhc from $(vboxroot)/prebuild 37 36 # NOMODS=1 don't build any module 38 37 # NOQT=1 don't build the Qt GUI … … 42 41 # HEADLESS=1 build the headless version 43 42 # VNC=1 build VNC code 44 # NOWEBSVC=1 don't build the webservice API , default for OSE43 # NOWEBSVC=1 don't build the webservice API 45 44 # STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso 46 # STAGEDQHELP=<path> use VirtualBox*.qch and VirtualBox*.qhc from this directory47 45 # PKGDIR=<path> where to store the final package(s) 48 # 49 # NODOCS will be set if UserManual*.pdf is placed in $(vboxroot)/prebuild. 46 # svn_revision=xxx do not depend on subversion being available, but use this 47 # hard-coded revision number instead 48 # 49 # NODOCS will be set if UserManual*.pdf, UserManual*.qch and UserManual*.qhc are 50 # placed in $(vboxroot)/prebuild. 50 51 # STAGEDISO will be set if VBoxGuestAdditions.iso is placed there. 51 # STAGEDQHELP will be set if VirtualBox*.qch and VirtualBox*.qhc is placed there. 52 # VirtualBox*.qch and VirtualBox*.qhc are used if they are provided, but never 53 # attempted to be built. 54 # 55 # Wine will not be required if either NODOCS or STAGEDISO are set. 52 # 53 # Wine will not be required if STAGEDISO is set. 56 54 57 55 package := virtualbox 58 56 verpkg := virtualbox-6.1 59 current := $(shell pwd) 60 vboxroot := $(shell while ! test -r configure && ! test "$PWD" = "/"; do cd ..; done; pwd) 57 vboxroot := $(shell while ! test -r configure && ! test "$$PWD" = "/"; do cd ..; done; pwd) 58 debroot := $(vboxroot)/src/VBox/Installer/linux 59 instlin := $(vboxroot)/src/VBox/Installer/linux 61 60 pkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd $(vboxroot)/..; pwd)) 62 bldbase := $(if $(PATH_OUT_BASE),$(PATH_OUT_BASE),$(vboxroot))/out/debian 61 outdir := $(if $(PATH_OUT_BASE),$(PATH_OUT_BASE),$(vboxroot))/out 62 bldbase := $(outdir)/debian 63 63 builddir := $(bldbase)/builddir 64 64 moddir := $(bldbase)/modules 65 prefix := $( current)/debian/$(verpkg)65 prefix := $(bldbase)/$(verpkg) 66 66 arch := $(shell dpkg --print-architecture) 67 67 verfile := $(builddir)/version-generated.mk … … 69 69 chrarch := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "x86"; fi) 70 70 -include $(vboxroot)/SVN_REVISION 71 svnrev := $(if $(svn_revision),$(svn_revision),)71 svnrev := $(if $(svn_revision),$(svn_revision),) 72 72 73 73 NOMODS ?= $(ose) 74 74 NOQT ?= $(HEADLESS) 75 75 NOSDL ?= $(HEADLESS) 76 NOWEBSVC ?= $(ose) 77 NODOCS ?= $(if $(wildcard $(vboxroot)/prebuild/UserManual*.pdf),1,) 76 NOWEBSVC ?= 77 EFI ?= $(if $(wildcard $(vboxroot)/prebuild/VBoxEFI32.fd $(vboxroot)/prebuild/VBoxEFI64.fd),1,) 78 NODOCS ?= $(if $(wildcard $(addprefix $(vboxroot)/prebuild/,UserManual*.pdf UserManual*.qch UserManual.qhc)),1,) 78 79 STAGEDISO ?= $(if $(wildcard $(vboxroot)/prebuild/VBoxGuestAdditions.iso),$(vboxroot)/prebuild,) 79 STAGEDQHELP ?= $(if $(and $(wildcard $(vboxroot)/prebuild/VirtualBox*.qch),$(wildcard $(vboxroot)/prebuild/VirtualBox*.qhc)),$(vboxroot)/prebuild,) 80 NOWINE := $(if $(NODOCS),1,$(if $(STAGEDISO),1,$(ose))) 81 PYTHON := $(firstword $(shell which python) $(shell which python3)) 82 83 ifneq ($(wildcard $(verfile)),) 84 include $(verfile) 85 ver := $(VBOX_VERSION_STRING) 86 svnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \ 87 svn info > /dev/null 2>&1; then \ 88 svn info|sed -e "s/^Revision: \(.*\)/-\1/;t;d"; else \ 89 date +"-%Y%m%d"; fi))) 90 debver :=$(subst _ALPHA,~alpha,$(subst _BETA,~beta,$(subst _RC,~rc,$(subst _OSE,~ose,$(ver)))))$(svnver)$(VERSUFFIX)$(if $(HEADLESS),~headless,)$(if $(DEBUG),~dbg,) 91 archdir := $(prefix)/opt/VirtualBox-$(ver) 92 endif 80 NOWINE := $(if $(STAGEDISO),1,$(ose)) 81 PYTHON := $(firstword $(shell which python3) $(shell which python)) 82 83 DEBPKGFILES := changelog compat control dirs postinst postrm preinst prerm rules templates 93 84 94 85 ifneq ($(STAGEDISO),) … … 98 89 endif 99 90 100 debrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown) 91 # Replicate debian package buildfiles to $(bldbase) 92 ifneq ($(shell pwd),$(outdir)) 93 cmd := $(filter-out all Makefile,$(MAKECMDGOALS)) 94 all: 95 mkdir -p $(bldbase) 96 ln -sf $(addprefix $(debroot)/debian/,$(DEBPKGFILES)) $(bldbase) 97 +$(MAKE) -C $(outdir) -f debian/rules $(cmd) 98 99 Makefile: 100 101 $(cmd): all 102 103 .PHONY: all $(MAKECMDGOALS) 104 105 else 106 ifneq ($(wildcard $(verfile)),) 107 include $(verfile) 108 ver := $(VBOX_VERSION_STRING) 109 svnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \ 110 svn info $(vboxroot) > /dev/null 2>&1; then \ 111 svn info $(vboxroot)|sed -e "s/^Revision: \(.*\)/-\1/;t;d"; else \ 112 date +"-%Y%m%d"; fi))) 113 debver := $(subst _ALPHA,~alpha,$(subst _BETA,~beta,$(subst _RC,~rc,$(subst _OSE,~ose,$(ver)))))$(svnver)$(VERSUFFIX)$(if $(HEADLESS),~headless,)$(if $(DEBUG),~dbg,) 114 archdir := $(prefix)/opt/VirtualBox-$(ver) 115 endif 116 101 117 102 118 ifneq ($(MAKECMDGOALS),clean) 103 debdist := $(strip $(shell grep $(debrel) $(current)/distributions_deb | cut -d'=' -f2)) 119 debrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown) 120 debdist := $(strip $(shell grep $(debrel) $(debroot)/distributions_deb | cut -d'=' -f2)) 104 121 ifeq ($(debdist),) 105 122 debdist := $(if $(shell which lsb_release),_$(shell lsb_release -si | tr a-z A-Z)_$(shell lsb_release -sr | sed -e 's/\./_/g' -e 's/\([^_]*\)\(_[^_]*\).*/\1\2/'),unknown) … … 109 126 110 127 cfg_flags := $(if $(NOQT),--disable-qt,) \ 111 $(if $(NOSDL),--disable-vboxsdl,) \ 112 $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \ 113 $(if $(HEADLESS),--build-headless,) \ 114 $(if $(DEBUG),--build-debug,) \ 115 $(if $(NOWINE),,--setup-wine) \ 116 $(if $(NOWEBSVC),,$(if $(ose),--enable-webservice,)) \ 117 $(if $(VNC),--enable-vnc,) \ 118 $(if $(PATH_OUT_BASE),--out-base-dir=$(PATH_OUT_BASE),) \ 119 --disable-extpack 120 121 bld_flags := AUTOCFG=$(current)/debian/AutoConfig.kmk \ 122 LOCALCFG=$(current)/debian/LocalConfig.kmk \ 123 PATH_OUT=$(builddir) \ 124 VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \ 125 VBOX_WITHOUT_EXTPACK_VNC_PACKING=1 \ 126 VBOX_WITH_VMSVGA3D=1 \ 127 VBOX_DO_STRIP= \ 128 VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \ 129 $(if $(STAGEDQHELP),VBOX_WITH_DOCS_QHELP=1,) \ 130 VBOX_PACKAGE_DIST=$(debdist) \ 131 $(if $(svnrev),VBOX_SVN_REV=$(svnrev),) \ 132 $(if $(NODOCS),VBOX_WITH_DOCS= ,) \ 133 $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \ 134 $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) 135 136 configure: debian/configure-stamp 137 debian/configure-stamp: 128 $(if $(NOSDL),--disable-vboxsdl,) \ 129 $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \ 130 $(if $(HEADLESS),--build-headless,) \ 131 $(if $(DEBUG),--build-debug,) \ 132 $(if $(NOWINE),,--setup-wine) \ 133 $(if $(VNC),--enable-vnc,) \ 134 $(if $(PATH_OUT_BASE),--out-base-dir=$(PATH_OUT_BASE),) \ 135 --disable-extpack 136 137 bld_flags := AUTOCFG=$(bldbase)/AutoConfig.kmk \ 138 LOCALCFG=$(debroot)/debian/LocalConfig.kmk \ 139 PATH_OUT=$(builddir) \ 140 VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \ 141 VBOX_WITHOUT_EXTPACK_VNC_PACKING=1 \ 142 VBOX_WITH_VMSVGA3D=1 \ 143 VBOX_DO_STRIP= \ 144 VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \ 145 VBOX_PACKAGE_DIST=$(debdist) \ 146 $(if $(svnrev),VBOX_SVN_REV=$(svnrev),) \ 147 $(if $(NODOCS),VBOX_WITH_DOCS= ,) \ 148 $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \ 149 $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) 150 151 configure: $(bldbase)/configure-stamp 152 $(bldbase)/configure-stamp: 138 153 dh_testdir 154 mkdir -p $(bldbase) 139 155 cd $(vboxroot) && ./configure --odir=$(bldbase) $(cfg_flags) 140 touch debian/configure-stamp141 142 build: debian/configure-stamp debian/build-stamp143 debian/build-stamp $(verfile): 156 touch $@ 157 158 build: $(bldbase)/configure-stamp $(bldbase)/build-stamp 159 $(bldbase)/build-stamp $(verfile): $(bldbase)/configure-stamp 144 160 dh_testdir 145 . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all 146 $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,) 147 $(if $(STAGEDQHELP),cp $(STAGEDQHELP)/VirtualBox*.qch $(STAGEDQHELP)/VirtualBox*.qhc $(builddir)/bin,) 161 . $(bldbase)/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all 162 # Files from prebuild go to (builddir)/bin to be used during the 163 # packing stage, overriding what the build did/would produce. 164 $(if $(NODOCS),cp $(addprefix $(vboxroot)/prebuild/,UserManual*.pdf UserManual*.qch UserManual.qhc) $(builddir)/bin,) 148 165 $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI32.fd $(builddir)/bin,) 149 166 $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI64.fd $(builddir)/bin,) 150 167 mkdir -p $(builddir)/bin/additions 151 168 $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,) 152 . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) \169 . $(bldbase)/env.sh && kmk -C $(vboxroot) $(bld_flags) \ 153 170 VBOX_NO_LINUX_RUN_INSTALLER=1 \ 154 171 VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86.tar.bz2 \ … … 157 174 VBOX_PATH_ADDITIONS.linux.amd64=$(builddir)/bin/additions \ 158 175 packing 159 touch debian/build-stamp176 touch $(bldbase)/build-stamp 160 177 161 178 # Build modules for every kernel we find in /lib/modules/* 162 modules: debian/build-stamp debian/modules-stamp 163 debian/modules-stamp: debian/build-stamp 179 $(bldbase)/modules-stamp: $(bldbase)/build-stamp 164 180 rm -rf $(moddir) 165 181 mkdir $(moddir) … … 180 196 fi; \ 181 197 done 182 touch debian/modules-stamp198 touch $@ 183 199 184 200 clean: 185 201 dh_testdir 186 202 dh_testroot 187 rm -f debian/changelog188 rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh189 rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp190 rm -f debian/virtualbox-*.substvars debian/virtualbox*.debhelper191 rm -f debian/$(verpkg).mime192 rm -rf $(builddir) $(moddir)193 rm -rf debian/wine.*194 203 dh_clean 195 196 ifeq ($(VBOX_VERSION_MAJOR),) 197 binary binary-arch binary-indep: build $(verfile) 198 $(MAKE) -f debian/rules binary 199 else 204 rm -rf $(archdir) 205 rm -rf $(builddir) 206 rm -rf $(moddir) 207 rm -rf $(bldbase)/wine.* 208 rm -rf $(bldbase)/VirtualBox-* 209 rm -f $(bldbase)/VirtualBox.tar $(bldbase)/VirtualBox.tar.bz2 210 rm -f $(bldbase)/virtualbox-*.substvars $(bldbase)/virtualbox*.debhelper 211 rm -f $(bldbase)/$(verpkg).mime $(bldbase)/$(verpkg).sharedmimeinfo 212 rm -f $(bldbase)/modules-stamp $(bldbase)/build-stamp $(bldbase)/configure-stamp 213 rm -f $(bldbase)/AutoConfig.kmk $(bldbase)/configure.log $(bldbase)/env.sh 214 rm -f $(addprefix $(bldbase)/,$(DEBPKGFILES)) 215 if [ -d $(bldbase) ]; then rmdir $(bldbase); fi 216 217 ifeq ($(VBOX_VERSION_MAJOR),) 218 binary: build $(verfile) 219 +$(MAKE) -f debian/rules binary 220 221 else 200 222 # Build architecture-dependent files here. 201 binary binary-arch binary-indep: build $(if $(NOMODS),,modules)223 binary: build $(if $(NOMODS),,$(bldbase)/modules-stamp) 202 224 dh_testdir 203 225 dh_testroot 204 dh_ clean -k226 dh_prep 205 227 dh_installdirs 206 228 tar -xC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar … … 231 253 done) 232 254 $(if $(NOQT),,rmdir $(archdir)/icons) 233 $(if $(NOQT),,mv $(archdir)/virtualbox.xml debian/$(verpkg).sharedmimeinfo)255 $(if $(NOQT),,mv $(archdir)/virtualbox.xml $(bldbase)/$(verpkg).sharedmimeinfo) 234 256 install -d -g 0 -o 0 $(prefix)/usr/share/lintian/overrides 235 257 sed \ 236 258 -e 's|%VERPKG%|$(verpkg)|g' \ 237 debian/lintian-override.in > \259 $(vboxroot)/debian/lintian-override.in > \ 238 260 $(prefix)/usr/share/lintian/overrides/$(verpkg) 239 261 mv $(archdir)/VBox.png \ … … 241 263 mv $(archdir)/src $(prefix)/usr/share/$(package) 242 264 rm $(archdir)/VBox.sh 243 install -D -g 0 -o 0 -m 644 $( vboxroot)/src/VBox/Installer/linux/VBox.sh $(prefix)/usr/bin/VBox265 install -D -g 0 -o 0 -m 644 $(instlin)/VBox.sh $(prefix)/usr/bin/VBox 244 266 mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package) 245 267 if [ -r $(archdir)/VBoxDTrace ]; then \ … … 261 283 fi \ 262 284 done) 263 ifeq ($(ose),) 264 dh_installdocs \ 265 $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.qch VirtualBox*.qhc \ 266 LICENSE) 267 rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.qch VirtualBox*.qhc \ 268 LICENSE) 269 for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \ 270 mv $(archdir)/$$i $(prefix)/usr/share/$(package); done 285 dh_installdocs $(addprefix $(archdir)/,UserManual*.pdf LICENSE) 286 mv $(addprefix $(archdir)/,$(if $(HEADLESS),,rdesktop-vrdp.tar.gz) additions/VBoxGuestAdditions.iso) $(prefix)/usr/share/$(package) 271 287 $(if $(HEADLESS),,mv $(archdir)/rdesktop-vrdp $(prefix)/usr/bin) 272 288 $(if $(HEADLESS),,mv $(archdir)/rdesktop-vrdp-keymaps $(prefix)/usr/share/$(package)) 273 else274 dh_installdocs \275 $(archdir)/UserManual*.pdf276 rm $(addprefix $(archdir)/,UserManual*.pdf)277 for i in additions/VBoxGuestAdditions.iso; do \278 mv $(archdir)/$$i $(prefix)/usr/share/$(package); done279 endif280 289 mv $(archdir) $(prefix)/usr/lib/$(package) 281 290 if [ -f $(prefix)/usr/lib/$(package)/libQt5CoreVBox.so.5 ]; then \ … … 306 315 $(if $(NOSDL),,usr/bin/VBox usr/bin/VBoxSDL) \ 307 316 $(if $(NOSDL),,usr/bin/VBox usr/bin/vboxsdl) \ 308 $(if $(ose),,usr/bin/VBox usr/bin/VBoxVRDP) \309 317 usr/bin/VBox usr/bin/VBoxHeadless \ 310 318 usr/bin/VBox usr/bin/vboxheadless \ … … 320 328 usr/share/virtualbox/src/vboxhost usr/src/vboxhost-$(ver) 321 329 $(if $(NOMODS),,dh_installmodules) 330 rm -f $(bldbase)/changelog 322 331 sed -e 's|%VER%|$(debver)|g' \ 323 332 -e 's|%DATE%|$(shell date -R)|g' \ 324 333 -e 's|%DEBREL%|$(subst _,~,$(debrel))|g' \ 325 334 -e 's|%VERPKG%|$(verpkg)|g' \ 326 debian/changelog.in > debian/changelog335 $(debroot)/debian/changelog.in > $(bldbase)/changelog 327 336 dh_installdebconf 328 337 dh_installchangelogs … … 330 339 dh_installmime 331 340 dh_link 332 ifeq ($(DEBUG),)341 ifeq ($(DEBUG),) 333 342 dh_strip --keep-debug \ 334 343 $(addprefix --exclude=lib,$(addsuffix VBox.so.5,\ 335 Qt5Core Qt5Gui Qt5Widgets Qt5PrintSupport Qt5OpenGL Qt5DBus Qt5XcbQpa Qt5X11Extras)) \ 336 --exclude=libqxcb.so --exclude=libqsqlite.so --exclude=libqxcb-glx-integration.so 337 endif 338 mkdir -p $(current)/debian/$(verpkg)-dbg/usr/lib/$(package) 339 mv $(prefix)/usr/lib/$(package)/*.debug $(current)/debian/$(verpkg)-dbg/usr/lib/$(package) 340 ifeq ($(DEBUG),) 341 mv $(prefix)/usr/lib/debug $(current)/debian/$(verpkg)-dbg/usr/lib 342 endif 343 $(firstword $(shell which dh_python2) $(shell which dh_python3)) 344 dh_compress -X.pdf -X LICENSE -X.py 344 Qt5Core Qt5Gui Qt5Widgets Qt5PrintSupport Qt5OpenGL Qt5DBus Qt5XcbQpa Qt5X11Extras)) 345 endif 346 mkdir -p $(bldbase)/$(verpkg)-dbg/usr/lib/$(package) 347 mv $(prefix)/usr/lib/$(package)/*.debug $(bldbase)/$(verpkg)-dbg/usr/lib/$(package) 348 ifeq ($(DEBUG),) 349 mv $(prefix)/usr/lib/debug $(bldbase)/$(verpkg)-dbg/usr/lib 350 endif 351 $(firstword $(shell which dh_python3) $(shell which dh_python2)) 352 dh_compress -X.pdf -X.qch -X.qhc -X LICENSE -X.py 345 353 dh_fixperms 346 354 dh_makeshlibs … … 355 363 dh_md5sums 356 364 dh_builddeb --destdir $(pkgdir) -- -Zxz 365 endif 366 367 .PHONY: binary configure build clean 357 368 endif 358 359 .PHONY: binary modules binary-arch binary-indep clean checkroot -
trunk/src/VBox/Installer/linux/rpm/rules
r90118 r90354 25 25 # NOSUBVER=1 disable generation of the sub-version field (which is 26 26 # either the subversion rev [if available] or the build date) 27 # NODOCS=1 don't build docs, use precompiled UserManual .pdf and28 # maybe VirtualBox.qch and VirtualBox.qhc from $(vboxroot)/prebuild27 # NODOCS=1 don't build docs, use precompiled UserManual*.pdf and 28 # maybe UserManual*.qch and UserManual*.qhc from $(vboxroot)/prebuild 29 29 # NOMODS=1 don't build any module 30 30 # NOQT=1 don't build the Qt GUI … … 34 34 # HEADLESS=1 build the headless version 35 35 # VNC=1 build VNC code 36 # NOWEBSVC=1 don't build the webservice API , default for OSE36 # NOWEBSVC=1 don't build the webservice API 37 37 # STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso 38 # STAGEDQHELP=<path> use VirtualBox*.qch and VirtualBox*.qhc from this directory39 38 # PKGDIR=<path> where to store the final package(s) 40 39 # svn_revision=xxx do not depend on subversion being available, but use this 41 40 # hard-coded revision number instead 42 41 # 43 # NODOCS will be set if UserManual*.pdf is placed in $(vboxroot)/prebuild. 42 # NODOCS will be set if UserManual*.pdf, UserManual*.qch and UserManual*.qhc are 43 # placed in $(vboxroot)/prebuild. 44 44 # STAGEDISO will be set if VBoxGuestAdditions.iso is placed there. 45 # STAGEDQHELP will be set if VirtualBox*.qch and VirtualBox*.qhc is placed there. 46 # VirtualBox*.qch and VirtualBox*.qhc are used if they are provided, but never 47 # attempted to be built. 48 # 49 # Wine will not be required if either NODOCS or STAGEDISO are set. 50 51 ifeq ($(wildcard rpm/rules),) 52 $(error call rpm/rules from src/VBox/Installer/linux) 53 endif 45 # 46 # Wine will not be required if STAGEDISO is set. 54 47 55 48 verpkg := VirtualBox-6.1 56 current := $(shellpwd)57 vboxroot := $(shell while ! test -r configure && ! test "$PWD" = "/"; do cd ..; done; pwd) 49 vboxroot := $(shell while ! test -r configure && ! test "$$PWD" = "/"; do cd ..; done; pwd) 50 instlin := $(vboxroot)/src/VBox/Installer/linux 58 51 pkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd $(vboxroot)/..; pwd)) 59 bldbase := $(if $(PATH_OUT_BASE),$(PATH_OUT_BASE),$(vboxroot))/out/rpm 52 outdir := $(if $(PATH_OUT_BASE),$(PATH_OUT_BASE),$(vboxroot))/out 53 bldbase := $(outdir)/rpm 60 54 builddir := $(bldbase)/builddir 61 55 stagedir := $(bldbase)/rpmbuild 62 56 rpmlib := $(shell if [ `uname -m` = "x86_64" ]; then echo "lib64"; else echo "lib"; fi) 63 chrarch := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "x86"; fi)64 57 verfile := $(builddir)/version-generated.mk 65 58 ose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1)) 59 chrarch := $(shell if [ `uname -m` = "x86_64" ]; then echo "amd64"; else echo "x86"; fi) 66 60 -include $(vboxroot)/SVN_REVISION 67 svnrev := $(if $(svn_revision),$(svn_revision),)61 svnrev := $(if $(svn_revision),$(svn_revision),) 68 62 69 63 NOMODS ?= $(ose) 70 64 NOQT ?= $(HEADLESS) 71 NOWEBSVC ?= $(ose) 72 NODOCS ?= $(if $(wildcard $(vboxroot)/prebuild/UserManual*.pdf),1,) 65 NOSDL ?= $(HEADLESS) 66 NOWEBSVC ?= 67 EFI ?= $(if $(wildcard $(vboxroot)/prebuild/VBoxEFI32.fd $(vboxroot)/prebuild/VBoxEFI64.fd),1,) 68 NODOCS ?= $(if $(wildcard $(addprefix $(vboxroot)/prebuild/,UserManual*.pdf UserManual*.qch UserManual.qhc)),1,) 73 69 STAGEDISO ?= $(if $(wildcard $(vboxroot)/prebuild/VBoxGuestAdditions.iso),$(vboxroot)/prebuild,) 74 STAGEDQHELP ?= $(if $(and $(wildcard $(vboxroot)/prebuild/VirtualBox*.qch),$(wildcard $(vboxroot)/prebuild/VirtualBox*.qhc)),$(vboxroot)/prebuild,) 75 NOWINE := $(if $(NODOCS),1,$(if $(STAGEDISO),1,$(ose))) 70 NOWINE := $(if $(STAGEDISO),1,$(ose)) 71 72 ifneq ($(STAGEDISO),) 73 ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),) 74 $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found) 75 endif 76 endif 77 78 ifeq ($(wildcard rpm/rules),) 79 $(error call rpm/rules from src/VBox/Installer/linux) 80 endif 76 81 77 82 ifneq ($(MAKECMDGOALS),clean) … … 106 111 endif 107 112 108 rpmdist := $(strip $(shell grep $(rpmrel) $( current)/distributions_rpm | cut -d'=' -f2))113 rpmdist := $(strip $(shell grep $(rpmrel) $(instlin)/distributions_rpm | cut -d'=' -f2)) 109 114 ifeq ($(rpmdist),) 110 115 $(error Cannot detect package distribution (rpmrel=$(rpmrel))) … … 120 125 $(error failed to detect the .spec file (rpmrel=$(rpmrel))) 121 126 endif 122 123 # contrary to debian we need the verfile earlier to get the correct rpmname into the bld_flags 124 include $(verfile) 125 $(verfile): $(bldbase)/configure-stamp 126 . $(bldbase)/env.sh && kmk -C $(vboxroot) $(verfile) $(bld_flags) 127 128 endif 129 127 endif 128 129 ifneq ($(wildcard $(verfile)),) 130 include $(verfile) 130 131 ver := $(VBOX_VERSION_STRING) 131 rpmver :=$(ver)$(if $(NOSUBVER),,$(if $(svn_revision),_$(svn_revision),)$(VERSUFFIX)$(if $(HEADLESS),_headless,)$(if $(DEBUG),_dbg,)) 132 svnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \ 133 svn info $(vboxroot) > /dev/null 2>&1; then \ 134 svn info $(vboxroot)|sed -e "s/^Revision: \(.*\)/-\1/;t;d"; else \ 135 date +"-%Y%m%d"; fi))) 136 rpmver := $(ver)$(subst -,_,$(svnver))$(VERSUFFIX)$(if $(HEADLESS),_headless,)$(if $(DEBUG),_dbg,) 132 137 archdir := $(bldbase)/VirtualBox-$(ver) 133 138 rpmname := $(verpkg)-$(rpmver)_$(rpmrel) 139 endif 134 140 135 141 # never ship any modules 136 142 instmod := 137 138 ifneq ($(STAGEDISO),)139 ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)140 $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)141 endif142 endif143 143 144 144 ifeq ($(wildcard /usr/share/doc/packages/bash),) … … 157 157 # EL5 ships Python 2.4 while our Python support requires Python 2.6 or later 158 158 cfg_flags := $(if $(NOQT),--disable-qt,) \ 159 $(if $(NOSDL),--disable-vboxsdl,) \ 160 $(if $(filter el5 el6,$(rpmrel)),--build-libvpx,) \ 161 $(if $(filter el5 el6,$(rpmrel)),--build-libopus,) \ 162 $(if $(filter el5 el6,$(rpmrel)),--build-libssl,) \ 163 $(if $(filter el5,$(rpmrel)),--build-libcurl,) \ 164 $(if $(filter el5,$(rpmrel)),--disable-sdl-ttf,) \ 165 $(if $(filter el5,$(rpmrel)),--disable-pulse,) \ 166 $(if $(filter el5,$(rpmrel)),--disable-python,) \ 167 $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \ 168 $(if $(HEADLESS),--build-headless,) \ 169 $(if $(DEBUG),--build-debug,) \ 170 $(if $(NOWINE),,--setup-wine) \ 171 $(if $(NOWEBSVC),,$(if $(ose),--enable-webservice,)) \ 172 $(if $(VNC),--enable-vnc,) \ 173 $(if $(PATH_OUT_BASE),--out-base-dir=$(PATH_OUT_BASE),) \ 174 --disable-extpack 159 $(if $(NOSDL),--disable-vboxsdl,) \ 160 $(if $(filter el5 el6,$(rpmrel)),--build-libvpx,) \ 161 $(if $(filter el5 el6,$(rpmrel)),--build-libopus,) \ 162 $(if $(filter el5 el6,$(rpmrel)),--build-libssl,) \ 163 $(if $(filter el5,$(rpmrel)),--build-libcurl,) \ 164 $(if $(filter el5,$(rpmrel)),--disable-sdl-ttf,) \ 165 $(if $(filter el5,$(rpmrel)),--disable-pulse,) \ 166 $(if $(filter el5,$(rpmrel)),--disable-python,) \ 167 $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \ 168 $(if $(HEADLESS),--build-headless,) \ 169 $(if $(DEBUG),--build-debug,) \ 170 $(if $(NOWINE),,--setup-wine) \ 171 $(if $(VNC),--enable-vnc,) \ 172 $(if $(PATH_OUT_BASE),--out-base-dir=$(PATH_OUT_BASE),) \ 173 --disable-extpack 175 174 176 175 bld_flags := AUTOCFG=$(bldbase)/AutoConfig.kmk \ 177 LOCALCFG=$(current)/rpm/LocalConfig.kmk \ 178 PATH_OUT=$(builddir) \ 179 VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \ 180 VBOX_WITHOUT_EXTPACK_VNC_PACKING=1 \ 181 $(if $(filter el5 el6,$(rpmrel)),,VBOX_WITH_VMSVGA3D=1) \ 182 VBOX_DO_STRIP= \ 183 $(if $(filter el5,$(rpmrel)),VBOX_BLD_PYTHON=$(strip \ 184 $(firstword $(wildcard /usr/local/bin/python2.7) $(wildcard /usr/bin/python2.7) \ 185 $(wildcard /usr/bin/python2.6) $(wildcard /usr/bin/python2) $(wildcard /usr/bin/python))),) \ 186 $(doc_dir) \ 187 $(if $(STAGEDQHELP),VBOX_WITH_DOCS_QHELP=1,) \ 188 VBOX_PACKAGE_DIST=$(rpmdist) \ 189 $(if $(svnrev),VBOX_SVN_REV=$(svnrev),) \ 190 $(if $(NODOCS),VBOX_WITH_DOCS= ,) \ 191 $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \ 192 $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \ 193 $(if $(filter el5,$(rpmrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1) 194 176 LOCALCFG=$(instlin)/rpm/LocalConfig.kmk \ 177 PATH_OUT=$(builddir) \ 178 VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \ 179 VBOX_WITHOUT_EXTPACK_VNC_PACKING=1 \ 180 $(if $(filter el5 el6,$(rpmrel)),,VBOX_WITH_VMSVGA3D=1) \ 181 VBOX_DO_STRIP= \ 182 $(if $(filter el5,$(rpmrel)),VBOX_BLD_PYTHON=$(firstword $(wildcard \ 183 /usr/local/bin/python2.7 /usr/bin/python2.7 /usr/bin/python2.6 /usr/bin/python2 /usr/bin/python)),) \ 184 $(if $(filter el5,$(rpmrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1) \ 185 $(doc_dir) \ 186 VBOX_PACKAGE_DIST=$(rpmdist) \ 187 $(if $(svnrev),VBOX_SVN_REV=$(svnrev),) \ 188 $(if $(NODOCS),VBOX_WITH_DOCS= ,) \ 189 $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \ 190 $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) 191 192 configure: $(bldbase)/configure-stamp 195 193 $(bldbase)/configure-stamp: 196 194 mkdir -p $(bldbase) … … 198 196 touch $@ 199 197 200 $(bldbase)/build-stamp: $(bldbase)/configure-stamp 198 build: $(bldbase)/configure-stamp $(bldbase)/build-stamp 199 $(bldbase)/build-stamp $(verfile): $(bldbase)/configure-stamp 201 200 . $(bldbase)/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all 202 $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,) 203 $(if $(STAGEDQHELP),cp $(STAGEDQHELP)/VirtualBox*.qch $(STAGEDQHELP)/VirtualBox*.qhc $(builddir)/bin,) 201 # Files from prebuild go to (builddir)/bin to be used during the 202 # packing stage, overriding what the build did/would produce. 203 $(if $(NODOCS),cp $(addprefix $(vboxroot)/prebuild/,UserManual*.pdf UserManual*.qch UserManual.qhc) $(builddir)/bin,) 204 204 $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI32.fd $(builddir)/bin,) 205 205 $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI64.fd $(builddir)/bin,) … … 213 213 VBOX_PATH_ADDITIONS.linux.amd64=$(builddir)/bin/additions \ 214 214 packing 215 touch $ @215 touch $(bldbase)/build-stamp 216 216 217 217 clean: … … 219 219 rm -rf $(stagedir) 220 220 rm -rf $(builddir) 221 rm -rf $(bldbase)/wine.* 221 222 rm -rf $(bldbase)/VirtualBox-* 222 223 rm -f $(bldbase)/VirtualBox.tar $(bldbase)/VirtualBox.tar.bz2 224 rm -f $(bldbase)/build-stamp $(bldbase)/configure-stamp 225 rm -f $(bldbase)/AutoConfig.kmk $(bldbase)/configure.log $(bldbase)/env.sh 223 226 rm -f $(bldbase)/VirtualBox.spec 224 rm -f $(bldbase)/build-stamp $(bldbase)/configure-stamp $(bldbase)/configure.log225 rm -f $(bldbase)/AutoConfig.kmk $(bldbase)/env.sh226 227 if [ -d $(bldbase) ]; then rmdir $(bldbase); fi 227 228 228 229 ifeq ($(VBOX_VERSION_MAJOR),) 229 binary: $(bldbase)/build-stamp $(verfile) 230 $(MAKE) -f rpm/rules binary 230 binary: build $(verfile) 231 +$(MAKE) -f rpm/rules binary 232 231 233 else 232 binary: $(bldbase)/build-stamp234 binary: build 233 235 rm -rf $(bldbase)/VirtualBox-* 234 236 tar -xf $(builddir)/bin/VirtualBox.tar -C $(bldbase) … … 248 250 -e 's|%INITSCRIPTS%|$(if $(filter fedora,$(rpmspec)),initscripts,)|g' \ 249 251 -e 's|%NETTOOLS%|$(if $(filter fedora18 fedora19 fedora20 fedora21 el5 openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114,$(rpmrel)),net-tools,iproute)|g' \ 250 $( current)/rpm/VirtualBox.tmpl.spec > $(archdir)/VirtualBox.spec252 $(instlin)/rpm/VirtualBox.tmpl.spec > $(archdir)/VirtualBox.spec 251 253 mv $(bldbase)/VirtualBox-$(ver) $(bldbase)/$(rpmname) 252 254 cp ../../../../tools/linux.$(chrarch)/bin/chrpath $(bldbase)/$(rpmname) || true … … 263 265 endif 264 266 265 .PHONY: binary c lean267 .PHONY: binary configure build clean
Note:
See TracChangeset
for help on using the changeset viewer.