File: rules

package info (click to toggle)
libinline-java-perl 0.58~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 964 kB
  • ctags: 684
  • sloc: perl: 4,717; java: 2,844; makefile: 35
file content (78 lines) | stat: -rwxr-xr-x 2,789 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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2012-2016 Jonas Smedegaard <dr@jones.dk>
# 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 <http://www.gnu.org/licenses/>.

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

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)

# Repackage to exclude sourceless jar file
DEB_UPSTREAM_REPACKAGE_EXCLUDES += \
 bug/bug.tar.gz

# 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), libinline-c-perl, 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
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