File: rules

package info (click to toggle)
translate-toolkit 3.15.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 7,376 kB
  • sloc: python: 63,774; sh: 1,406; makefile: 186; xml: 48
file content (60 lines) | stat: -rwxr-xr-x 1,740 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
#!/usr/bin/make -f
# -*- makefile -*-

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

export PYBUILD_NAME=translate

p	= translate-toolkit
d	= $(CURDIR)/debian/$(p)
d3	= $(CURDIR)/debian/python3-translate

export PYTHONNOUSERSITE=false

export PYBUILD_TEST_ARGS = -rsx -v .

%:
	dh $@ --with python3,sphinxdoc --buildsystem pybuild

execute_after_dh_clean:
	rm -rf man docs/_build run-tests .cache
	make -C docs clean

execute_after_dh_auto_build:
	+$(MAKE) -C docs SPHINXBUILD="python3 -m sphinx build" html

execute_after_dh_auto_install:
	# delete unwanted cruft from /usr/lib
	for i in COPYING README.rst docs; do \
	  rm -rfv debian/*/usr/lib/python*/*-packages/translate/$$i \
	      debian/*/usr/lib/pyshared/translate/$$i; \
	done

	# provide a link to the langmodels shipped in libexttextcat-data
	for i in debian/*/usr/lib/python*/*-packages/translate/; do \
	  mkdir $$i/share; \
	  ln -s /usr/share/libexttextcat $$i/share/langmodels; \
	  cp translate/share/stoplist-en $$i/share/; \
	done

	prename 's/\.sh$$//' debian/*/usr/bin/build_firefox.sh
	prename 's/\.py$$//' debian/*/usr/bin/*.py

	# move the command line tools to the translate-toolkit package
	mkdir -p $(d)/usr/bin
	mv $(d3)/usr/bin/* $(d)/usr/bin/
	rm -rf $(d3)/usr/bin

	mkdir -p man
	for script in $(d)/usr/bin/*; do \
	  case $$(basename $$script) in \
	  buildxpi*|build_tmdb|build_firefox*|get_moz_enUS*|junitmsgfmt|mozfunny2prop|po2web2py|pocompendium|pomigrate2|popuretext|poreencode|posplit|pocount|poglossary|pocommentclean|prop2mozfunny|pydiff|tmserver) \
	    ;; \
	  *) \
	    LC_ALL=C PYTHONPATH=. $$script --manpage \
	      > man/$$(basename $$script).1 \
	      || rm -f man/$(basename $$script).1; \
	    ;; \
	  esac; \
	done