File: rules

package info (click to toggle)
hfst 3.15.0-1.1~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 20,996 kB
  • sloc: cpp: 155,114; ansic: 14,088; sh: 8,293; python: 5,808; yacc: 5,284; lex: 3,570; makefile: 2,135; xml: 6
file content (44 lines) | stat: -rwxr-xr-x 1,395 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
#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE=1

NUMJOBS = 1
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

build2vers := $(shell pyversions -sv)
build3vers := $(shell py3versions -sv)

# This has to be exported to make some magic below work.
export DH_OPTIONS
export LC_ALL=C.UTF-8

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@ --fail-missing --with autoreconf --with python2 --with python3

override_dh_auto_configure:
	dh_auto_configure -- --disable-static --enable-all-tools --with-readline

override_dh_auto_build:
	$(MAKE) -j$(NUMJOBS) || $(MAKE) -j$(NUMJOBS) || $(MAKE)
	set -e && for i in $(build2vers) $(build3vers); do \
		cd $(CURDIR)/python && python$$i setup.py build_ext && strip --strip-unneeded build/*/*.so; \
	done

override_dh_auto_test:
	# Disable because they still break on big-endian

override_dh_auto_install:
	dh_auto_install
	set -e && for i in $(build2vers) $(build3vers); do \
		cd $(CURDIR)/python && python$$i setup.py install --no-compile --prefix /usr --install-layout deb --root $(CURDIR)/debian/tmp; \
	done
	find $(CURDIR) -type f -name '*.pyc' -exec rm -f '{}' \;
	find $(CURDIR) -type f -name '*.pyo' -exec rm -f '{}' \;
	find $(CURDIR) -type f -name '*.la' -exec rm -f '{}' \;