File: rules

package info (click to toggle)
tesseract 5.5.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 43,508 kB
  • sloc: cpp: 154,570; makefile: 1,519; java: 1,143; ansic: 852; sh: 763; python: 51
file content (56 lines) | stat: -rwxr-xr-x 1,665 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
#!/usr/bin/make -f
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
CFLAGS += -Wall -g -fPIC -DTESSDATA_PREFIX='\"/usr/share/tesseract-ocr/5\"'

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

ifeq (,$(NUMJOBS))
	NUMJOBS = 1
endif

%:
	dh $@ --with autoreconf

override_dh_auto_build:
	make -j$(NUMJOBS)
	make -j$(NUMJOBS) training

override_dh_auto_install:
	$(MAKE) DESTDIR=$$(pwd)/debian/tmp prefix=/usr install
	$(MAKE) DESTDIR=$$(pwd)/debian/tmp prefix=/usr training-install

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	./tesseract -v
	./tesseract ./test/testing/phototest.tif -
endif

override_dh_auto_clean:
	dh_auto_clean
	dh_clean java/com/Makefile \
		java/com/google/Makefile \
		java/com/google/scrollview/Makefile \
		java/com/google/scrollview/events/Makefile \
		java/com/google/scrollview/ui/Makefile \
		java/Makefile \
		nsis/Makefile \
		doc/*.1 \
		doc/*.5
	test ! -f configure.ac.orig || mv configure.ac.orig configure.ac

override_dh_auto_configure:
ifeq ($(DEB_HOST_GNU_TYPE),arm-linux-gnueabi)
	cp configure.ac configure.ac.orig
	patch -p1 < debian/patches/0002_disable_NEON.diff
else
	echo "no patch"
endif
	./autogen.sh
	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --disable-tessdata-prefix --prefix=/usr --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CXXFLAGS="$(CFLAGS)" LDFLAGS="-lleptonica -Wl,-z,defs $(LDFLAGS)"