Changeset 90354 in vbox for trunk/debian/rules
- Timestamp:
- Jul 27, 2021 11:57:54 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145918
- Location:
- trunk/debian
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/debian
- Property svn:ignore deleted
-
trunk/debian/rules
r90118 r90354 18 18 19 19 #export DH_VERBOSE=1 20 export DH_COMPAT=521 20 22 21 # possible overrides: … … 28 27 # NOSUBVER=1 disable generation of the sub-version field (which is 29 28 # either the subversion rev [if available] or the build date) 30 # NODOCS=1 don't build docs, use precompiled UserManual .pdf and31 # maybe VirtualBox.qch and VirtualBox.qhc from $(vboxroot)/prebuild29 # NODOCS=1 don't build docs, use precompiled UserManual*.pdf and 30 # maybe UserManual*.qch and UserManual*.qhc from $(vboxroot)/prebuild 32 31 # NOMODS=1 don't build any module 33 32 # NOQT=1 don't build the Qt GUI … … 36 35 # HEADLESS=1 build the headless version 37 36 # VNC=1 build VNC code 38 # NOWEBSVC=1 don't build the webservice API , default for OSE37 # NOWEBSVC=1 don't build the webservice API 39 38 # STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso 40 # STAGEDQHELP=<path> use VirtualBox*.qch and VirtualBox*.qhc from this directory41 39 # PKGDIR=<path> where to store the final package(s) 42 # 43 # NODOCS will be set if UserManual*.pdf is placed in $(vboxroot)/prebuild. 40 # svn_revision=xxx do not depend on subversion being available, but use this 41 # hard-coded revision number instead 42 # 43 # NODOCS will be set if UserManual*.pdf, UserManual*.qch and UserManual*.qhc are 44 # placed in $(vboxroot)/prebuild. 44 45 # 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. 46 # 47 # Wine will not be required if STAGEDISO is set. 50 48 51 49 package := virtualbox 52 50 verpkg := virtualbox-ose 53 current := $(shell pwd) 54 vboxroot := $(shell pwd) 55 pkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ..; pwd)) 56 bldbase := $(if $(PATH_OUT_BASE),$(PATH_OUT_BASE),$(vboxroot))/out/debian 51 vboxroot := $(shell while ! test -r configure && ! test "$$PWD" = "/"; do cd ..; done; pwd) 52 debroot := $(vboxroot) 53 instlin := $(vboxroot)/src/VBox/Installer/linux 54 pkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd $(vboxroot)/..; pwd)) 55 outdir := $(if $(PATH_OUT_BASE),$(PATH_OUT_BASE),$(vboxroot))/out 56 bldbase := $(outdir)/debian 57 57 builddir := $(bldbase)/builddir 58 58 moddir := $(bldbase)/modules 59 prefix := $( current)/debian/$(verpkg)59 prefix := $(bldbase)/$(verpkg) 60 60 arch := $(shell dpkg --print-architecture) 61 61 verfile := $(builddir)/version-generated.mk … … 65 65 NOQT ?= $(HEADLESS) 66 66 NOSDL ?= $(HEADLESS) 67 NOWEBSVC ?= $(ose) 68 NODOCS ?= $(if $(wildcard $(vboxroot)/prebuild/UserManual*.pdf),1,) 67 NOWEBSVC ?= 68 EFI ?= $(if $(wildcard $(vboxroot)/prebuild/VBoxEFI32.fd $(vboxroot)/prebuild/VBoxEFI64.fd),1,) 69 NODOCS ?= $(if $(wildcard $(addprefix $(vboxroot)/prebuild/,UserManual*.pdf UserManual*.qch UserManual.qhc)),1,) 69 70 STAGEDISO ?= $(if $(wildcard $(vboxroot)/prebuild/VBoxGuestAdditions.iso),$(vboxroot)/prebuild,) 70 STAGEDQHELP ?= $(if $(and $(wildcard $(vboxroot)/prebuild/VirtualBox*.qch),$(wildcard $(vboxroot)/prebuild/VirtualBox*.qhc)),$(vboxroot)/prebuild,) 71 NOWINE := $(if $(NODOCS),1,$(if $(STAGEDISO),1,$(ose))) 72 PYTHON := $(firstword $(shell which python) $(shell which python3)) 73 74 ifneq ($(wildcard $(verfile)),) 75 include $(verfile) 76 ver := $(VBOX_VERSION_STRING) 77 archdir := $(prefix)/opt/VirtualBox-$(ver) 78 endif 71 NOWINE := $(if $(STAGEDISO),1,$(ose)) 72 PYTHON := $(firstword $(shell which python3) $(shell which python)) 73 74 DEBPKGFILES := changelog compat control dirs postinst postrm preinst prerm rules templates 79 75 80 76 ifneq ($(STAGEDISO),) … … 84 80 endif 85 81 86 debrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown) 82 # Replicate debian package buildfiles to $(bldbase) 83 ifneq ($(shell pwd),$(outdir)) 84 cmd := $(filter-out all Makefile,$(MAKECMDGOALS)) 85 all: 86 mkdir -p $(bldbase) 87 ln -sf $(addprefix $(debroot)/debian/,$(DEBPKGFILES)) $(bldbase) 88 +$(MAKE) -C $(outdir) -f debian/rules $(cmd) 89 90 Makefile: 91 92 $(cmd): all 93 94 .PHONY: all $(MAKECMDGOALS) 95 96 else 97 ifneq ($(wildcard $(verfile)),) 98 include $(verfile) 99 ver := $(VBOX_VERSION_STRING) 100 archdir := $(prefix)/opt/VirtualBox-$(ver) 101 endif 87 102 88 103 cfg_flags := $(if $(NOQT),--disable-qt,) \ 89 $(if $(NOSDL),--disable-vboxsdl,) \ 90 $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \ 91 $(if $(HEADLESS),--build-headless,) \ 92 $(if $(DEBUG),--build-debug,) \ 93 $(if $(NOWINE),,--setup-wine) \ 94 $(if $(NOWEBSVC),,$(if $(ose),--enable-webservice,)) \ 95 $(if $(VNC),--enable-vnc,) \ 96 $(if $(PATH_OUT_BASE),--out-base-dir=$(PATH_OUT_BASE),) \ 97 --disable-extpack 98 99 bld_flags := AUTOCFG=$(current)/debian/AutoConfig.kmk \ 100 LOCALCFG=$(current)/debian/LocalConfig.kmk \ 101 PATH_OUT=$(builddir) \ 102 VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \ 103 VBOX_WITHOUT_EXTPACK_VNC_PACKING=1 \ 104 VBOX_WITH_VMSVGA3D=1 \ 105 VBOX_DO_STRIP= \ 106 VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \ 107 $(if $(STAGEDQHELP),VBOX_WITH_DOCS_QHELP=1,) \ 108 $(if $(svnrev),VBOX_SVN_REV=$(svnrev),) \ 109 $(if $(NODOCS),VBOX_WITH_DOCS= ,) \ 110 $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \ 111 $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) 112 113 configure: debian/configure-stamp 114 debian/configure-stamp: 104 $(if $(NOSDL),--disable-vboxsdl,) \ 105 $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \ 106 $(if $(HEADLESS),--build-headless,) \ 107 $(if $(DEBUG),--build-debug,) \ 108 $(if $(NOWINE),,--setup-wine) \ 109 $(if $(VNC),--enable-vnc,) \ 110 $(if $(PATH_OUT_BASE),--out-base-dir=$(PATH_OUT_BASE),) \ 111 --disable-extpack 112 113 bld_flags := AUTOCFG=$(bldbase)/AutoConfig.kmk \ 114 LOCALCFG=$(debroot)/debian/LocalConfig.kmk \ 115 PATH_OUT=$(builddir) \ 116 VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \ 117 VBOX_WITHOUT_EXTPACK_VNC_PACKING=1 \ 118 VBOX_WITH_VMSVGA3D=1 \ 119 VBOX_DO_STRIP= \ 120 VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \ 121 $(if $(svnrev),VBOX_SVN_REV=$(svnrev),) \ 122 $(if $(NODOCS),VBOX_WITH_DOCS= ,) \ 123 $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \ 124 $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) 125 126 configure: $(bldbase)/configure-stamp 127 $(bldbase)/configure-stamp: 115 128 dh_testdir 129 mkdir -p $(bldbase) 116 130 cd $(vboxroot) && ./configure --odir=$(bldbase) $(cfg_flags) 117 touch debian/configure-stamp118 119 build: debian/configure-stamp debian/build-stamp120 debian/build-stamp $(verfile): 131 touch $@ 132 133 build: $(bldbase)/configure-stamp $(bldbase)/build-stamp 134 $(bldbase)/build-stamp $(verfile): $(bldbase)/configure-stamp 121 135 dh_testdir 122 . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all 123 $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,) 124 $(if $(STAGEDQHELP),cp $(STAGEDQHELP)/VirtualBox*.qch $(STAGEDQHELP)/VirtualBox*.qhc $(builddir)/bin,) 136 . $(bldbase)/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all 137 # Files from prebuild go to (builddir)/bin to be used during the 138 # packing stage, overriding what the build did/would produce. 139 $(if $(NODOCS),cp $(addprefix $(vboxroot)/prebuild/,UserManual*.pdf UserManual*.qch UserManual.qhc) $(builddir)/bin,) 125 140 $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI32.fd $(builddir)/bin,) 126 141 $(if $(EFI),cp $(vboxroot)/prebuild/VBoxEFI64.fd $(builddir)/bin,) 127 142 mkdir -p $(builddir)/bin/additions 128 143 $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,) 129 . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) \144 . $(bldbase)/env.sh && kmk -C $(vboxroot) $(bld_flags) \ 130 145 VBOX_NO_LINUX_RUN_INSTALLER=1 \ 131 146 VBOX_LNX_ADD_ARCHIVE.x86=$(builddir)/bin/additions/VBoxGuestAdditions-x86.tar.bz2 \ … … 134 149 VBOX_PATH_ADDITIONS.linux.amd64=$(builddir)/bin/additions \ 135 150 packing 136 touch debian/build-stamp151 touch $(bldbase)/build-stamp 137 152 138 153 # Build modules for every kernel we find in /lib/modules/* 139 modules: debian/build-stamp debian/modules-stamp 140 debian/modules-stamp: debian/build-stamp 154 $(bldbase)/modules-stamp: $(bldbase)/build-stamp 141 155 rm -rf $(moddir) 142 156 mkdir $(moddir) … … 157 171 fi; \ 158 172 done 159 touch debian/modules-stamp173 touch $@ 160 174 161 175 clean: 162 176 dh_testdir 163 177 dh_testroot 164 rm -f debian/AutoConfig.kmk debian/configure.log debian/env.sh165 rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp166 rm -f debian/virtualbox-*.substvars debian/virtualbox*.debhelper167 rm -f debian/$(verpkg).mime168 rm -rf $(builddir) $(moddir)169 rm -rf debian/wine.*170 178 dh_clean 171 172 ifeq ($(VBOX_VERSION_MAJOR),) 173 binary binary-arch binary-indep: build $(verfile) 174 $(MAKE) -f debian/rules binary 175 else 179 rm -rf $(archdir) 180 rm -rf $(builddir) 181 rm -rf $(moddir) 182 rm -rf $(bldbase)/wine.* 183 rm -rf $(bldbase)/VirtualBox-* 184 rm -f $(bldbase)/VirtualBox.tar $(bldbase)/VirtualBox.tar.bz2 185 rm -f $(bldbase)/virtualbox-*.substvars $(bldbase)/virtualbox*.debhelper 186 rm -f $(bldbase)/$(verpkg).mime $(bldbase)/$(verpkg).sharedmimeinfo 187 rm -f $(bldbase)/modules-stamp $(bldbase)/build-stamp $(bldbase)/configure-stamp 188 rm -f $(bldbase)/AutoConfig.kmk $(bldbase)/configure.log $(bldbase)/env.sh 189 rm -f $(addprefix $(bldbase)/,$(DEBPKGFILES)) 190 if [ -d $(bldbase) ]; then rmdir $(bldbase); fi 191 192 ifeq ($(VBOX_VERSION_MAJOR),) 193 binary: build $(verfile) 194 +$(MAKE) -f debian/rules binary 195 196 else 176 197 # Build architecture-dependent files here. 177 binary binary-arch binary-indep: build $(if $(NOMODS),,modules)198 binary: build $(if $(NOMODS),,$(bldbase)/modules-stamp) 178 199 dh_testdir 179 200 dh_testroot 180 dh_ clean -k201 dh_prep 181 202 dh_installdirs 182 203 tar -xC $(prefix)/opt -f $(builddir)/bin/VirtualBox.tar … … 207 228 done) 208 229 $(if $(NOQT),,rmdir $(archdir)/icons) 209 $(if $(NOQT),,mv $(archdir)/virtualbox.xml debian/$(verpkg).sharedmimeinfo)230 $(if $(NOQT),,mv $(archdir)/virtualbox.xml $(bldbase)/$(verpkg).sharedmimeinfo) 210 231 install -d -g 0 -o 0 $(prefix)/usr/share/lintian/overrides 211 232 sed \ 212 233 -e 's|%VERPKG%|$(verpkg)|g' \ 213 debian/lintian-override.in > \234 $(vboxroot)/debian/lintian-override.in > \ 214 235 $(prefix)/usr/share/lintian/overrides/$(verpkg) 215 236 mv $(archdir)/VBox.png \ … … 217 238 mv $(archdir)/src $(prefix)/usr/share/$(package) 218 239 rm $(archdir)/VBox.sh 219 install -D -g 0 -o 0 -m 644 $( vboxroot)/src/VBox/Installer/linux/VBox.sh $(prefix)/usr/bin/VBox240 install -D -g 0 -o 0 -m 644 $(instlin)/VBox.sh $(prefix)/usr/bin/VBox 220 241 mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package) 221 242 if [ -r $(archdir)/VBoxDTrace ]; then \ … … 237 258 fi \ 238 259 done) 239 ifeq ($(ose),) 240 dh_installdocs \ 241 $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.qch VirtualBox*.qhc \ 242 LICENSE) 243 rm $(addprefix $(archdir)/,UserManual*.pdf VirtualBox*.qch VirtualBox*.qhc \ 244 LICENSE) 245 for i in rdesktop-vrdp.tar.gz additions/VBoxGuestAdditions.iso; do \ 246 mv $(archdir)/$$i $(prefix)/usr/share/$(package); done 260 dh_installdocs $(addprefix $(archdir)/,UserManual*.pdf LICENSE) 261 mv $(addprefix $(archdir)/,$(if $(HEADLESS),,rdesktop-vrdp.tar.gz) additions/VBoxGuestAdditions.iso) $(prefix)/usr/share/$(package) 247 262 $(if $(HEADLESS),,mv $(archdir)/rdesktop-vrdp $(prefix)/usr/bin) 248 263 $(if $(HEADLESS),,mv $(archdir)/rdesktop-vrdp-keymaps $(prefix)/usr/share/$(package)) 249 else250 dh_installdocs \251 $(archdir)/UserManual*.pdf252 rm $(addprefix $(archdir)/,UserManual*.pdf)253 for i in additions/VBoxGuestAdditions.iso; do \254 mv $(archdir)/$$i $(prefix)/usr/share/$(package); done255 endif256 264 mv $(archdir) $(prefix)/usr/lib/$(package) 257 265 if [ -f $(prefix)/usr/lib/$(package)/libQt5CoreVBox.so.5 ]; then \ … … 260 268 $(prefix)/usr/lib/$(package)/*.so.5 \ 261 269 $(prefix)/usr/lib/$(package)/plugins/platforms/*.so; \ 270 $(prefix)/usr/lib/$(package)/plugins/platformthemes/*.so; \ 271 $(prefix)/usr/lib/$(package)/plugins/sqldrivers/*.so; \ 272 $(prefix)/usr/lib/$(package)/plugins/styles/*.so; \ 262 273 $(prefix)/usr/lib/$(package)/plugins/xcbglintegrations/*.so; \ 263 274 echo "[Paths]" > $(prefix)/usr/lib/$(package)/qt.conf; \ … … 279 290 $(if $(NOSDL),,usr/bin/VBox usr/bin/VBoxSDL) \ 280 291 $(if $(NOSDL),,usr/bin/VBox usr/bin/vboxsdl) \ 281 $(if $(ose),,usr/bin/VBox usr/bin/VBoxVRDP) \282 292 usr/bin/VBox usr/bin/VBoxHeadless \ 283 293 usr/bin/VBox usr/bin/vboxheadless \ … … 298 308 dh_installmime 299 309 dh_link 300 ifeq ($(DEBUG),)310 ifeq ($(DEBUG),) 301 311 dh_strip --keep-debug \ 302 312 $(addprefix --exclude=lib,$(addsuffix VBox.so.5,\ 303 Qt5Core Qt5Gui Qt5Widgets Qt5PrintSupport Qt5OpenGL Qt5DBus Qt5XcbQpa Qt5X11Extras)) \ 304 --exclude=libqxcb.so --exclude=libqxcb-glx-integration.so 305 endif 306 mkdir -p $(current)/debian/$(verpkg)-dbg/usr/lib/$(package) 307 mv $(prefix)/usr/lib/$(package)/*.debug $(current)/debian/$(verpkg)-dbg/usr/lib/$(package) 308 ifeq ($(DEBUG),) 309 mv $(prefix)/usr/lib/debug $(current)/debian/$(verpkg)-dbg/usr/lib 310 endif 311 $(firstword $(shell which dh_python2) $(shell which dh_python3)) 312 dh_compress -X.pdf -X LICENSE -X.py 313 Qt5Core Qt5Gui Qt5Widgets Qt5PrintSupport Qt5OpenGL Qt5DBus Qt5XcbQpa Qt5X11Extras)) 314 endif 315 mkdir -p $(bldbase)/$(verpkg)-dbg/usr/lib/$(package) 316 mv $(prefix)/usr/lib/$(package)/*.debug $(bldbase)/$(verpkg)-dbg/usr/lib/$(package) 317 ifeq ($(DEBUG),) 318 mv $(prefix)/usr/lib/debug $(bldbase)/$(verpkg)-dbg/usr/lib 319 endif 320 $(firstword $(shell which dh_python3) $(shell which dh_python2)) 321 dh_compress -X.pdf -X.qch -X.qhc -X LICENSE -X.py 313 322 dh_fixperms 314 323 dh_makeshlibs … … 323 332 dh_md5sums 324 333 dh_builddeb --destdir $(pkgdir) -- -Zxz 334 endif 335 336 .PHONY: binary configure build clean 325 337 endif 326 327 .PHONY: binary modules binary-arch binary-indep clean checkroot
Note:
See TracChangeset
for help on using the changeset viewer.