File: rules

package info (click to toggle)
tesseract 4.1.1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 109,680 kB
  • sloc: cpp: 157,065; sh: 2,285; python: 1,750; makefile: 1,467; java: 1,143; ansic: 8
file content (46 lines) | stat: -rwxr-xr-x 1,540 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
#!/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/4.00

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

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

%:
	dh $@ --parallel --with autoreconf

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

override_dh_install:
	cd $(CURDIR)/src/training/ && chmod +x *.sh
	cd $(CURDIR)/debian/tmp/usr/bin && for i in $$(ls *.sh); do rm -f $${i}; done
	dh_install

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)))
	./src/api/tesseract -v
	./src/api/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

override_dh_auto_configure:
	./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="-llept -Wl,-z,defs $(LDFLAGS)"