# NOTE: This package uses a prebuilt BIOS image, that can only be properly built with OpenWatcom. import 'vcs/svn' import 'misc/debian' name=VirtualBox deb_name=virtualbox orig_version=5.1.18 version=$orig_version-dfsg-1 update_url="http://http.debian.net/debian/pool/contrib/v/$deb_name/" define_option 'pulseaudio: Add pulseaudio support' define_option 'pam: Use PAM for authentication' define_option 'docs: Build documentation (requires texlive)' dlfile "http://download.virtualbox.org/virtualbox/$orig_version/$name-$orig_version.tar.bz2" \ '1a7db64cd69ba6d39574fb333e031251' dlextract "http://http.debian.net/debian/pool/contrib/v/$deb_name/${deb_name}_$version.debian.tar.xz" \ 'b1b603b64426a6595fd52e930070a751' header_end # Unpack and sanitize the source tarball ( cd debian # We don't need to repack the sources. sed -i -e '/^tar.*-cJf/,+2d' get-orig-source.sh ./get-orig-source.sh --upstream-version $orig_version ) mv debian "$name-$orig_version" cd "$name-$orig_version" # Exclude some patches misc_debian_patch_exclude 01-build-arch.patch # Debian-exclusive patch that uses dpkg-architecture. misc_debian_patch_exclude 04-vboxdrv-references.patch # Debian-specific error messages. misc_debian_patch_exclude 12-make-module.patch # Debian uses amd64 instead of x86_64. misc_debian_patch_exclude 13-modules-mismatch.patch # Debian-specific error messages. # Replace /usr/include with whatever we're using sed -i -e "/^+\t\/usr\/include/s/usr\/include/$(safe_sed "$dir_prefix/$dir_includedir")/" debian/patches/18-system-xorg.patch # Apply debian patches misc_debian_patch # Fix path to sysconfdir in some scripts sed -i -e "s/\/etc\/vbox\//$(safe_sed "/$dir_prefix/$dir_sysconfdir/vbox/")/g" \ src/VBox/Installer/linux/VBox.sh \ src/VBox/Installer/linux/vboxdrv.sh \ src/VBox/Installer/linux/*-service.sh \ src/VBox/HostDrivers/*/linux/Makefile # Make vboxdrv.sh find the proper kernel sources sed -i -e 's/\${INSTALL_DIR}\/src\/vboxhost/\${INSTALL_DIR}\/src/' \ -e '/^elif test -x \/usr\/lib\/virtualbox\/VirtualBox/,+2d' src/VBox/Installer/linux/vboxdrv.sh # Make sure VBox.sh finds the proper INSTALL_DIR sed -i -e '/^if test -f \/usr\/lib\/virtualbox\/VirtualBox/,+2d' \ -e 's/^elif test -f "${MY_DIR}/if test -f "${MY_DIR}/' src/VBox/Installer/linux/VBox.sh # Qt5 requires -std=c++11 sed -i -e 's/^CXX_FLAGS="\(.*\)"/CXX_FLAGS="\1 -std=c++11"/' configure # Copy debian's configuration, barring a few things egrep -vf - debian/LocalConfig.kmk > LocalConfig.kmk << 'EOF' ^VBOX_JAVA_HOME ^VBOX_PATH_DOCBOOK_DTD EOF # Append our configuration cat >> LocalConfig.kmk << EOF VBOX_PATH_APP_PRIVATE_ARCH := /$dir_prefix/$dir_libdir/$name VBOX_PATH_SHARED_LIBS := \$(VBOX_PATH_APP_PRIVATE_ARCH) VBOX_WITH_RUNPATH := \$(VBOX_PATH_APP_PRIVATE_ARCH) VBOX_PATH_APP_PRIVATE := /$dir_prefix/$dir_datadir/$name VBOX_PATH_APP_DOCS = /$dir_prefix/$dir_docdir/$name VBOX_GCC_OPT := $CXXFLAGS VBOX_USE_SYSTEM_XORG_HEADERS := 1 VBOX_NO_LEGACY_XORG_X11 := 1 VBOX_WITH_REGISTRATION_REQUEST := VBOX_WITH_UPDATE_REQUEST := VBOX_WITH_EXTPACK_VBOXDTRACE := VBOX_WITHOUT_ADDITIONS := 1 $(option pam || echo VBOX_WITH_PAM :=) EOF ./configure \ --ose \ --disable-kmods \ --with-makeself=/bin/true \ --disable-java \ $(option pulseaudio || echo --disable-pulse) \ $(option docs || echo --disable-docs) source ./env.sh kmk LOCALCFG=./LocalConfig.kmk # Install VirtualBox # manpages (by debian) install -Dm644 -t "$dir_install/$dir_prefix/$dir_mandir/man1" \ debian/manpages/VirtualBox.1 \ debian/manpages/VBoxManage.1 \ debian/manpages/VBoxSDL.1 \ debian/manpages/VBoxHeadless.1 \ debian/manpages/VBoxBalloonCtrl.1 \ debian/manpages/vboxwebsrv.1 cd "out/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/release/bin" rm -f *.debug # Apply suid to VirtualBox chmod 4711 VirtualBox VBoxSDL VBoxHeadless # binaries mkdir -p "$dir_install/$dir_prefix/$dir_bindir" for i in VirtualBox VBoxManage VBoxSDL VBoxHeadless VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxDTrace vboxwebsrv; do ln -sf "/$dir_prefix/$dir_libdir/$name/VBox.sh" "$dir_install/$dir_prefix/$dir_bindir/$i" ln -sf "/$dir_prefix/$dir_libdir/$name/VBox.sh" "$dir_install/$dir_prefix/$dir_bindir/$(echo $i | tr '[:upper:]' '[:lower:]')" done # icons mkdir -p "$dir_install/$dir_prefix/$dir_datadir/pixmaps" mv VBox.png "$dir_install/$dir_prefix/$dir_datadir/pixmaps" for i in icons/*; do mkdir -p "$dir_install/$dir_prefix/$dir_datadir/icons/hicolor/$(basename $i)/mimetypes" mv $i/* "$dir_install/$dir_prefix/$dir_datadir/icons/hicolor/$(basename $i)/mimetypes" done rm -rf icons # desktop mkdir -p "$dir_install/$dir_prefix/$dir_datadir/applications" "$dir_install/$dir_prefix/$dir_datadir/mime/packages" mv virtualbox.desktop "$dir_install/$dir_prefix/$dir_datadir/applications" mv virtualbox.xml "$dir_install/$dir_prefix/$dir_datadir/mime/packages" # install configuration mkdir -p "$dir_install/$dir_prefix/$dir_sysconfdir/vbox" echo "INSTALL_DIR='/$dir_prefix/$dir_libdir/$name'" > "$dir_install/$dir_prefix/$dir_sysconfdir/vbox/vbox.cfg" # Move the directory mkdir -p "$dir_install/$dir_prefix/$dir_libdir/$name" cp -a * "$dir_install/$dir_prefix/$dir_libdir/$name" # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: