#!/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 include /usr/share/javahelper/java-vars.mk include /usr/share/java/java_defaults.mk export UWSGICONFIG_JVM_INCLUDES:= $(jvm_includes) export UWSGICONFIG_JVM_LIBPATH := $(shell realpath $(JVM_SERVER_DIR)) # resolve supported architectures for arch-varying build-dependencies # (in maintainer mode only: uses network and messes with control file) ifneq (,$(DEB_MAINTAINER_MODE)) $(shell sh debian/pkgarchs.sh default-jdk-headless > debian/ARCHS_java) endif $(eval ARCHS_java := $(shell cat debian/ARCHS_java)) ifneq (,$(DEB_MAINTAINER_MODE)) clean: debian/control debian/control:: perl -sgpi \ -e 's/^# autogenerated:.+\n\s+\S*$$pat.*\[\K[^\]\n]*/$$list/gm;' \ -e 's/^Package:.*$$pat.*\n# autogenerated:.+\nArchitecture:\s+\K[^\n]*/$$list/gm;' \ -- -pat='(openjdk)' -list='$(ARCHS_java)' \ -- $@ endif %: dh $@ %_openjdk_plugin.so: mkdir -p $(CURDIR)/plugins cp -ar /usr/src/uwsgi/plugins/$* $(CURDIR)/plugins $(PLUGINBUILDER) "$(CURDIR)/plugins/$* $*_openjdk" ln -s $@ $*_plugin.so UWSGI_SRCPLUGINS=jvm jwsgi ring servlet .PHONY: plugins plugins: $(addsuffix _openjdk_plugin.so, $(UWSGI_SRCPLUGINS)) override_dh_auto_build: 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)