Changeset 90354 in vbox for trunk/src/VBox/Installer/linux/debian
- Timestamp:
- Jul 27, 2021 11:57:54 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145918
- Location:
- trunk/src/VBox/Installer/linux/debian
- Files:
-
- 3 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
Note:
See TracChangeset
for help on using the changeset viewer.