#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 S = $(EMPTY) $(EMPTY) jrel = $(shell dpkg-parsechangelog | grep -E ^Version: | sed "s/Version: 0.//") DEB_HOST_ARCH ?= $(shell dpkg-architecture --query DEB_HOST_ARCH) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture --query DEB_HOST_MULTIARCH) include debian/java_defaults.mk p_jre = openjdk-$(java_default_version)-jre p_jhl = openjdk-$(java_default_version)-jre-headless p_jdk = openjdk-$(java_default_version)-jdk p_doc = openjdk-$(java_default_version)-doc dversion = 2:1.$(java_default_version)-$(jrel) jvmdir = java-1.$(java_default_version).0-openjdk$(if $(DEB_HOST_MULTIARCH),-$(DEB_HOST_ARCH)) ifneq (,$(filter $(DEB_HOST_ARCH),$(java9_architectures))) jdk_build_dep = openjdk-8-jdk v_jre = $(S)(>= 9~b74-1) v_jdk = $(v_jre) else ifneq (,$(filter $(DEB_HOST_ARCH),$(java8_architectures))) jdk_build_dep = openjdk-7-jdk v_jre = $(S)(>= 8~b132-1) v_jdk = $(v_jre) else ifneq (,$(filter $(DEB_HOST_ARCH),$(java7_architectures))) jdk_build_dep = gcj-jdk v_jre = $(S)(>= 7~u3-2.1.1) v_jdk = $(v_jre) else p_jre = gcj-jre p_jhl = gcj-jre-headless p_jdk = gcj-jdk jdk_build_dep = v_jre = v_jdk = $(v_jre) jvmdir = java-gcj p_doc = openjdk-7-doc endif jre_provides = java-runtime, java2-runtime, $(shell seq --format java%.f-runtime --separator ', ' 5 $(java_default_version)) jhl_provides = java-runtime-headless, java2-runtime-headless, $(shell seq --format java%.f-runtime-headless --separator ', ' 5 $(java_default_version)) jdk_provides = java-sdk, java2-sdk, $(shell seq --format java%.f-sdk --separator ', ' 5 $(java_default_version)) %: dh $@ override_dh_link: dh_link # Link /usr/lib/jvm/default-java to the default JRE dh_link -pdefault-jre-headless usr/lib/jvm/$(jvmdir) usr/lib/jvm/default-java # Link to the JDK documentation dh_link -pdefault-jdk-doc /usr/share/doc/$(p_doc)/api usr/share/doc/default-jre-headless/api dh_link -pdefault-jdk-doc /usr/share/doc/$(p_doc)/api usr/share/doc/default-jdk-doc/api override_dh_installdocs: dh_installdocs -i # Install the changelog and copyright once in default-jre-headless and use links for the other packages dh_installdocs -pdefault-jdk-doc dh_installdocs -pdefault-jre-headless dh_link -pdefault-jre /usr/share/doc/default-jre-headless /usr/share/doc/default-jre dh_link -pdefault-jdk /usr/share/doc/default-jre /usr/share/doc/default-jdk dh_link -pgcj-native-helper /usr/share/doc/default-jdk /usr/share/doc/gcj-native-helper override_dh_gencontrol: dh_gencontrol -i ifneq (,$(p_jre)) dh_gencontrol -a -- \ -v$(dversion) \ '-Vjre=$(p_jre)' \ '-Vjhl=$(p_jhl)' \ '-Vjdk=$(p_jdk)' \ '-Vdoc=$(p_doc)' \ '-Vjdk:builddep=$(jdk_build_dep)' \ '-Vjre:arch=$(DEB_HOST_ARCH)' \ '-Vjre:version=$(v_jre)' \ '-Vjdk:version=$(v_jdk)' \ '-Vjre:provides=$(jre_provides)' \ '-Vjhl:provides=$(jhl_provides)' \ '-Vjdk:provides=$(jdk_provides)' endif override_dh_builddeb: dh_builddeb -i ifneq (,$(p_jre)) dh_builddeb -a endif