Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/architecture.mk
4
5 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
7
8 ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
9 export DEB_CFLAGS_MAINT_STRIP=-O2
10 export DEB_CXXFLAGS_MAINT_STRIP=-O2
11 export DEB_CFLAGS_MAINT_APPEND=-O3
12 export DEB_CXXFLAGS_MAINT_APPEND=-O3
13 endif
14
15 # resolve supported architectures for arch-varying build-dependencies
16 # (in maintainer mode only: uses network and messes with control file)
17 ifneq (,$(DEB_MAINTAINER_MODE))
18 $(shell sh debian/pkgarchs.sh default-jdk > debian/ARCHS_java)
19 endif
20 $(eval ARCHS_java := $(shell cat debian/ARCHS_java))
21 ifneq (,$(DEB_MAINTAINER_MODE))
22 clean: debian/control debian/tests/control
23
24 debian/control debian/tests/control::
25 perl -sgpi \
26 -e 's/^# autogenerated:.+\n\s+\S*$$pat.*\[\K[^\]\n]*/$$list/gm;' \
27 -e 's/^Package:.*$$pat.*\n# autogenerated:.+\nArchitecture:\s+\K[^\n]*/$$list/gm;' \
28 -- -pat='(ant|jdk|java)' -list='$(ARCHS_java)' \
29 -- $@
30 endif
31 ifeq (,$(filter $(DEB_HOST_ARCH), $(ARCHS_java)))
32 CONFIGURE_ARGS += --disable-java-bindings
33 endif
34
35 %:
36 dh $@
37
38 execute_before_dh_auto_clean:
39 [ ! -f Makefile ] || $(MAKE) maintainer-clean
40
41 override_dh_autoreconf:
42 dh_autoreconf --as-needed
43
44 override_dh_auto_configure:
45 dh_auto_configure -- \
46 --disable-static \
47 --enable-pthreads \
48 --with-hunspell-dictdir=/usr/share/hunspell \
49 $(CONFIGURE_ARGS)
50
51 override_dh_install:
52 ifneq (,$(filter $(DEB_HOST_ARCH), $(ARCHS_java)))
53 mkdir -p debian/liblink-grammar-java/usr/lib/$(DEB_HOST_MULTIARCH)/jni
54 mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/liblink-grammar-java.so* \
55 debian/liblink-grammar-java/usr/lib/$(DEB_HOST_MULTIARCH)/jni
56 endif
57 find debian/ -name "*.la" -delete
58 dh_install -Xtests.py
59 d-shlibmove --commit \
60 --t64 \
61 --devunversioned \
62 --exclude-la \
63 --exclude-a \
64 --multiarch \
65 --movedev "debian/tmp/usr/include/*" usr/include/ \
66 --movedev "debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/*" \
67 usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
68 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.so
69
70 override_dh_compress:
71 dh_compress --exclude=.py
72
73 override_dh_makeshlibs:
74 dh_makeshlibs -- -c4