File: rules

package info (click to toggle)
java-common 0.58+deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 92 kB
  • sloc: sh: 166; makefile: 68
file content (92 lines) | stat: -rwxr-xr-x 3,237 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

release = $(shell dpkg-parsechangelog | grep -E ^Version: | sed "s/Version: 0.//")

DEB_HOST_ARCH      ?= $(shell dpkg-architecture --query DEB_HOST_ARCH)

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_jdkhl		= openjdk-$(java_default_version)-jdk-headless
p_doc		= openjdk-$(java_default_version)-doc
p_plugin	= icedtea-$(java_default_version)-plugin
dversion	= 2:1.$(java_default_version)-$(release)
jvmdir		= java-1.$(java_default_version).0-openjdk-$(DEB_HOST_ARCH)

ifeq (5, $(java_default_version))
  p_jre		= gcj-jre
  p_jhl		= gcj-jre-headless
  p_jdk		= gcj-jdk
  p_jdkhl	= gcj-jdk # no gcj-jdk-headless package
  p_doc		= openjdk-8-doc
  p_plugin	=
  jvmdir	= java-gcj
endif

p_plugin      =

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))
jdkhl_provides	= java-sdk-headless, java2-sdk-headless, $(shell seq --format java%.f-sdk-headless --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-jre-headless
	dh_link -pdefault-jre          /usr/share/doc/default-jre-headless /usr/share/doc/default-jre
	dh_link -pdefault-jdk-headless /usr/share/doc/default-jre-headless /usr/share/doc/default-jdk-headless
	dh_link -pdefault-jdk          /usr/share/doc/default-jre          /usr/share/doc/default-jdk
	dh_link -pdefault-java-plugin  /usr/share/doc/default-jre          /usr/share/doc/default-java-plugin

	dh_installdocs -pdefault-jdk-doc
	dh_installdocs -pgcj-native-helper

override_dh_gencontrol:
	dh_gencontrol -i
ifneq (,$(p_jre))
	dh_gencontrol -a --no-package=default-java-plugin -- \
		-v$(dversion) \
		'-Vjre=$(p_jre)' \
		'-Vjhl=$(p_jhl)' \
		'-Vjdk=$(p_jdk)' \
		'-Vjdkhl=$(p_jdkhl)' \
		'-Vdoc=$(p_doc)' \
		'-Vjre:arch=$(DEB_HOST_ARCH)' \
		'-Vjre:provides=$(jre_provides)' \
		'-Vjhl:provides=$(jhl_provides)' \
		'-Vjdkhl:provides=$(jdkhl_provides)' \
		'-Vjdk:provides=$(jdk_provides)'
endif
ifneq (,$(p_plugin))
	dh_gencontrol -pdefault-java-plugin -- -v$(dversion) -Vplugin=$(p_plugin) -Vjre:arch=$(DEB_HOST_ARCH)
endif

override_dh_builddeb:
	dh_builddeb -i
ifneq (,$(p_jre))
	dh_builddeb -a --no-package=default-java-plugin
endif
ifneq (,$(p_plugin))
	dh_builddeb -pdefault-java-plugin
endif