File: rules

package info (click to toggle)
translate-toolkit 1.9.0-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 46,776 kB
  • sloc: python: 40,107; sh: 384; makefile: 70
file content (91 lines) | stat: -rwxr-xr-x 2,204 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
#!/usr/bin/make -f
# -*- makefile -*-

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

p	= translate-toolkit
d	= debian/$(p)
pv	= $(shell python -c 'import sys; print sys.version[:3]')

include /usr/share/python/python.mk

SITEDIR = $(call py_sitename, $(pv))

build: build-stamp

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp:
	dh_testdir
	python setup.py build
	mkdir -p man
	for script in build/scripts-*/*; do \
	  case $$(basename $$script) in \
	  pocompendium|pomigrate2|popuretext|poreencode|posplit|pocount|poglossary|pocommentclean|tmserver) \
	    ;; \
	  *) \
	    LC_ALL=C PYTHONPATH=. ./$$script --manpage \
	      > man/$$(basename $$script).1 \
	      || rm -f man/$(basename $i).1; \
	    ;; \
	  esac; \
	done
	cp debian/msghack.1 man/msghack.1
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	rm -rf build
	rm -rf man
	rm -f MANIFEST.in
	-find -name '*.py[co]' | xargs rm -f
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs \
		usr/share/doc/$(p)
	python setup.py install --prefix=`pwd`/$(d)/usr $(py_setup_install_args)
	mv $(d)/usr/lib/python$(pv)/$(SITEDIR)/translate/doc \
		$(d)/usr/share/doc/$(p)/html
	rm -f $(d)/usr/lib/python$(pv)/$(SITEDIR)/translate/ChangeLog
	rm -f $(d)/usr/lib/python$(pv)/$(SITEDIR)/translate/COPYING
	rm -f $(d)/usr/lib/python$(pv)/$(SITEDIR)/translate/LICENSE
	rm -f $(d)/usr/lib/python$(pv)/$(SITEDIR)/translate/README
	mv $(d)/usr/share/doc/$(p)/html/api \
		$(d)-dev-doc/usr/share/doc/$(p)-dev-doc/html

	dh_lintian

	# Install msghack
	install -p -D -m644 debian/msghack.py \
	                    $(d)/usr/bin/msghack

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs translate/ChangeLog
	dh_installdocs translate/README
	dh_installexamples
	dh_installman man/*
	dh_compress
	dh_fixperms
	dh_python2
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

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