#!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- # Copyright © 2012-2016 Jonas Smedegaard # Description: Main Debian packaging script for Inline::Java # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . include /usr/share/cdbs/1/rules/upstream-tarball.mk include /usr/share/cdbs/1/rules/utils.mk include /usr/share/cdbs/1/class/perl-makemaker.mk include /usr/share/cdbs/1/rules/debhelper.mk DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk pkg = $(DEB_SOURCE_PACKAGE) perlpath := $(shell perl -MConfig -e 'print $$Config{vendorarch};' ) #DEB_UPSTREAM_PACKAGE = Inline-Java #DEB_UPSTREAM_URL = http://www.cpan.org/modules/by-module/Inline DEB_UPSTREAM_URL = https://github.com/ingydotnet/Inline-Java/archive DEB_UPSTREAM_TARBALL_BASENAME = Inline-Java-$(DEB_UPSTREAM_TARBALL_VERSION) # Build-depend unversioned on debhelper # TODO: Drop when adopted in cdbs CDBS_BUILD_DEPENDS_rules_debhelper_v9 = debhelper # Needed both by upstream build and at runtime deps = libinline-perl (>= 0.68), default-jdk # Needed by upstream build b-depends = chrpath CDBS_BUILD_DEPENDS += , $(deps), $(b-depends) CDBS_DEPENDS_$(pkg) = $(deps) export JAVA_HOME=/usr/lib/jvm/default-java DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) NO_JNI_ARCH = hppa hurd-i386 mips mipsel armel powerpc ifeq (,$(filter $(DEB_HOST_ARCH), $(NO_JNI_ARCH))) # Have testsuite use JNI export PERL_INLINE_JAVA_JNI=1 else # Don't build JNI extension DEB_MAKEMAKER_USER_FLAGS = BUILD_JNI=0 endif # Put aside upstream cruft during build DEB_UPSTREAM_CRUFT_MOVE = t/t13.txt # Have testsuite use the C locale's decimal point DEB_MAKE_CHECK_TARGET += LC_NUMERIC=C ifeq (,$(filter $(DEB_HOST_ARCH), $(NO_JNI_ARCH))) binary-post-install/$(pkg):: chrpath -d $(cdbs_curdestdir)$(perlpath)/auto/Inline/Java/JNI/JNI.so binary-post-install/$(pkg):: mkdir -p $(cdbs_curdestdir)/usr/share/$(pkg) mv -t $(cdbs_curdestdir)/usr/share/$(pkg) \ $(cdbs_curdestdir)$(perlpath)/Inline/Java/*.jar dh_link usr/share/$(pkg)/InlineJavaServer.jar $(perlpath)/Inline/Java/InlineJavaServer.jar \ usr/share/$(pkg)/InlineJavaUser.jar $(perlpath)/Inline/Java/InlineJavaUser.jar endif