File: rules

package info (click to toggle)
freedict 2016.12.12-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 556,676 kB
  • ctags: 484
  • sloc: xml: 466,758; perl: 3,392; python: 936; makefile: 550; sh: 268; yacc: 207
file content (108 lines) | stat: -rwxr-xr-x 2,570 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/make -f
# ToDo: rewrite to be more modern

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

DICTS=$(shell find . -maxdepth 1 -name '???-???' -printf "%f ")

# Support parallel build
# increase compat level, then set:
#DEB_BUILD_OPTIONS=parallel=<num>

# If the environment variable BUILD_MODE=dummy, no dictionaries are build, but
# only dummy files are created. This is useful for test builds of the package,
# because the actual build takes ages.
BUILD_MODE ?= normal

build: build-prep all-dz

build-prep:
	dh_testdir
	# generate TEI file for hun-eng:
	cd hun-eng; make hun-eng.tei

$(DICTS): timestamp
ifeq ($(BUILD_MODE),normal)
	$(MAKE) -C $@ $@.dict.dz
else
	cd $@ && touch $@.dict.dz && touch $@.index && cd ..
endif

timestamp:
	touch $@

all-dz: timestamp $(DICTS)

build-stamp:
	touch build-stamp

# for lintian
build-indep: build
build-arch: build

clean:
	dh_testdir
	rm -f build-stamp timestamp configure-stamp
	rm -rf config.txt
	for DICT in $(DICTS); do \
		rm -f $$DICT/$$DICT.index $$DICT/$$DICT.dict.dz $$DICT/$$DICT.dict $$DICT/$$DICT.c5; \
		rm -rf debian/dict-freedict-$$DICT.docs; \
	done
	dh_clean
	-rm debian/*.dirs debian/*.links debian/*.postinst debian/*.postrm
	# special exception:
	-rm -rf hun-eng/SZOTAR.DBF hun-eng/hun-eng.tei eng-hun/SZOTAR.DBF eng-hun/eng-hun.tei


install: build
	dh_testdir
	dh_testroot
	dh_prep

	# create debian/dict-freedict-$LANG.{links|dirs} file and maint scripts
	for DICT in $(DICTS); do \
		sed "s/LANG/$$DICT/g" debian/dict-freedict-lang-dirs.tmpl > \
			debian/dict-freedict-$$DICT.dirs; \
		sed "s/LANG/$$DICT/g" debian/dict-freedict-lang-links.tmpl > \
			debian/dict-freedict-$$DICT.links; \
		cp debian/postinst debian/dict-freedict-$$DICT.postinst; \
		cp debian/postrm debian/dict-freedict-$$DICT.postrm; \
	done

	dh_installdirs

	# copy files to final destination
	for FILE in $(DICTS); do \
		cp $$FILE/$$FILE.dict.dz debian/dict-freedict-$$FILE/usr/share/dictd/freedict-$$FILE.dict.dz; \
		cp $$FILE/$$FILE.index debian/dict-freedict-$$FILE/usr/share/dictd/freedict-$$FILE.index; \
	done

	# generate *.docs-files:
	sh debian/gendocs.sh


binary-arch: build install
# We have nothing to do by default.

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

get-orig-source:
	# requires python3
	debian/fetchdictdata.py -f

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install