File: rules

package info (click to toggle)
uwsgi-plugin-java 0.0.6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 68 kB
  • sloc: makefile: 39; sh: 4
file content (56 lines) | stat: -rwxr-xr-x 1,721 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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

# Fuse uWSGI and our package versions, flattened to native format
UWSGI_VERSION = $(shell dpkg-query --show --showformat '$${Version}' uwsgi-src)
OUR_BINARY_VERSION = $(subst -,+,$(UWSGI_VERSION))+$(DEB_VERSION)

PLUGINBUILDER = uwsgi --build-plugin

# find jvm includes
-include /usr/share/java/java_defaults.mk
export UWSGICONFIG_JVM_INCLUDES:= $(jvm_includes)
$(info INCLUDES is ${UWSGICONFIG_JVM_INCLUDES})

# find libjvm.so path, until the fix for #1095496 provides a better way
JAVA_HOME = $(shell realpath -q /usr/lib/jvm/default-java)
JAVA_JVMLIB = $(firstword $(wildcard $(JAVA_HOME)/lib/*/libjvm.so))
ifeq (,$(JAVA_JVMLIB))
    $(warning Could not find libjvm.so, will not be able to link plugins)
endif
export UWSGICONFIG_JVM_LIBPATH := $(shell dirname $(JAVA_JVMLIB))
$(info LIBPATH is ${UWSGICONFIG_JVM_LIBPATH})

%:
	dh $@

UWSGI_SRCPLUGINS=jvm jwsgi ring servlet

pluginsource:
	mkdir -p $(CURDIR)/plugins
	for p in $(UWSGI_SRCPLUGINS); do \
		[ -d $(CURDIR)/plugins/$$p ] \
				|| cp -ar /usr/src/uwsgi/plugins/$$p $(CURDIR)/plugins; \
	done

%_openjdk_plugin.so: pluginsource
	$(PLUGINBUILDER) "$(CURDIR)/plugins/$* $*_openjdk"
	ln -s $@ $*_plugin.so

.PHONY: pluginsource plugins
plugins: $(addsuffix _openjdk_plugin.so, $(UWSGI_SRCPLUGINS))

override_dh_auto_build-arch: plugins
	help2man \
		--name 'fast (pure C), self-healing, developer-friendly WSGI server' \
		--section 1 \
		--no-info \
		--version-string="$(UWSGI_VERSION)" \
		debian/uwsgi_jvm \
		> debian/uwsgi_jvm.1

jdkversion=$(shell javac -version | cut -d" " -f2 | cut -d. -f 1)

override_dh_gencontrol:
	dh_gencontrol -- -v$(OUR_BINARY_VERSION) -Vuwsgi:jdkversion=$(jdkversion)