rules 1.62 KB
Newer Older
1 2
#!/usr/bin/make -f

3 4
include /usr/share/dpkg/architecture.mk

Jeremy Bicha's avatar
Jeremy Bicha committed
5
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
Jeremy Bicha's avatar
Jeremy Bicha committed
6
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
7

Pino Toscano's avatar
Pino Toscano committed
8
no_java_archs = hppa hurd-i386 kfreebsd-amd64 kfreebsd-i386 m68k sh4
9 10 11 12
ifneq (,$(filter $(DEB_HOST_ARCH), $(no_java_archs)))
CONFIGURE_ARGS += --disable-java-bindings
endif

Jeremy Bicha's avatar
Jeremy Bicha committed
13
%:
14
	dh $@ --with python2,python3
15

16
override_dh_auto_clean:
17
	dh_auto_clean
18 19
	-rm -r bin/org
	-rm linkgrammar-*.jar
20

Jeremy Bicha's avatar
Jeremy Bicha committed
21
override_dh_auto_configure:
22 23
	dh_auto_configure -- \
		--disable-static \
24
		--enable-pthreads \
25 26
		--with-hunspell-dictdir=/usr/share/hunspell \
		$(CONFIGURE_ARGS)
Jeremy Bicha's avatar
Jeremy Bicha committed
27

28 29 30
override_dh_autoreconf:
	dh_autoreconf --as-needed

31
override_dh_install:
32
ifeq (,$(filter $(DEB_HOST_ARCH), $(no_java_archs)))
33 34 35
	mkdir -p debian/liblink-grammar-java/usr/lib/$(DEB_HOST_MULTIARCH)/jni
	mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/liblink-grammar-java.so* \
		debian/liblink-grammar-java/usr/lib/$(DEB_HOST_MULTIARCH)/jni
36
endif
37
	find debian/ -name "*.la" -delete
Fabian Wolff's avatar
Fabian Wolff committed
38
	dh_install
39 40 41 42 43 44 45 46 47 48 49 50
	d-shlibmove --commit \
		--devunversioned \
		--exclude-la \
		--exclude-a \
		--multiarch \
		--override 's/libhunspell-[0-9.-]\+-dev/libhunspell-dev/' \
		--override 's/libminisat2-dev/minisat/' \
		--override 's/libsqlite3-0-dev/libsqlite3-dev/' \
		--movedev "debian/tmp/usr/include/*" usr/include/ \
		--movedev "debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/*" \
			usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.so
Fabian Wolff's avatar
Fabian Wolff committed
51 52 53

override_dh_missing:
	dh_missing --fail-missing
54

55 56 57
override_dh_compress:
	dh_compress --exclude=.py

Jeremy Bicha's avatar
Jeremy Bicha committed
58 59 60
override_dh_makeshlibs:
	dh_makeshlibs -- -c4

Jeremy Bicha's avatar
Jeremy Bicha committed
61
override_dh_auto_test:
62
# We use autopkgtest instead