summaryrefslogtreecommitdiff
path: root/man/Makefile.am
blob: 05d67e7676b2acfd35c8d8d33b3a6e7ae7d3045a (plain)
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
## Process this file with automake to produce Makefile.in

PO4A_V = $(PO4A_V_$(V))
PO4A_V_ = $(PO4A_V_$(AM_DEFAULT_VERBOSITY))
PO4A_V_0 = @echo "  PO4A   $@";

PO4A_RM_V = $(PO4A_RM_V_$(V))
PO4A_RM_V_ = $(PO4A_RM_V_$(AM_DEFAULT_VERBOSITY))
PO4A_RM_V_0 = @echo "  PO4ARM $@";

all-local: all-local-@USE_PO4A@

all-local-no:
all-local-yes: man.stamp

PO4A_COMMON_OPTS = --previous --variable builddir=$(CURDIR)
PO4A_BUILD_OPTS = $(PO4A_COMMON_OPTS) --no-backups
PO4A_CLEAN_OPTS = $(PO4A_COMMON_OPTS) --rm-backups --rm-translations

# FIXME: Use a stamp file until po4a supports them internally.
man.stamp:
	$(PO4A_V) cd $(srcdir) && \
	$(PO4A) $(PO4A_BUILD_OPTS) po/po4a.cfg
	$(AM_V_at) touch $@

clean-local: clean-local-@USE_PO4A@

clean-local-no:
clean-local-yes:
	$(PO4A_RM_V) cd $(srcdir) && \
	$(PO4A) $(PO4A_CLEAN_OPTS) po/po4a.cfg
	$(AM_V_at) rm -f man.stamp

update-po:
	$(PO4A_V) cd $(srcdir) && \
	$(PO4A) $(PO4A_BUILD_OPTS) --force po/po4a.cfg

# Extract the list of languages from the po4a config file.
LINGUAS_DIST = `sed -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/po/po4a.cfg`

# If the user has not defined it let's use the default.
LINGUAS ?= $(LINGUAS_DIST)

install-data-local: install-data-local-@USE_PO4A@

install-data-local-no:
install-data-local-yes:
	for lang in $(LINGUAS); do \
		files=""; \
		for trans in $(dist_man_MANS); do \
			if [ -f $(srcdir)/$$lang/$$trans ]; then \
				files="$$files $(srcdir)/$$lang/$$trans"; \
			fi; \
		done; \
		$(MAKE) install-man \
			mandir="$(mandir)/$$lang" \
			man_MANS="" \
			dist_man_MANS="$$files"; \
	done

uninstall-local: uninstall-local-@USE_PO4A@

uninstall-local-no:
uninstall-local-yes:
	for lang in $(LINGUAS); do \
		files=""; \
		for trans in $(dist_man_MANS); do \
			if [ -f $(srcdir)/$$lang/$$trans ]; then \
				files="$$files $(srcdir)/$$lang/$$trans"; \
			fi; \
		done; \
		$(MAKE) uninstall-man \
			mandir="$(mandir)/$$lang" \
			man_MANS="" \
			dist_man_MANS="$$files"; \
	done

dist-hook: man.stamp
	cp $(srcdir)/man.stamp $(distdir)/
	for lang in $(LINGUAS_DIST); do \
		cp $(srcdir)/po/$$lang.po $(distdir)/po; \
		cp $(srcdir)/po/$$lang.add $(distdir)/po; \
		$(mkdir_p) $(distdir)/$$lang; \
		cp -r $(srcdir)/$$lang $(distdir)/; \
	done

dist_man_MANS = \
	deb-control.5 \
	deb-version.5 \
	deb-shlibs.5 \
	deb-split.5 \
	deb-substvars.5 \
	deb-symbols.5 \
	deb-triggers.5 \
	deb-old.5 \
	deb-override.5 \
	deb-extra-override.5 \
	deb.5 \
	dpkg-architecture.1 \
	dpkg-buildflags.1 \
	dpkg-buildpackage.1 \
	dpkg-checkbuilddeps.1 \
	dpkg-deb.1 \
	dpkg-distaddfile.1 \
	dpkg-divert.8 \
	dpkg-genchanges.1 \
	dpkg-gencontrol.1 \
	dpkg-gensymbols.1 \
	dpkg-mergechangelogs.1 \
	dpkg-name.1 \
	dpkg-parsechangelog.1 \
	dpkg-query.1 \
	dpkg-scanpackages.1 \
	dpkg-scansources.1 \
	dpkg-shlibdeps.1 \
	dpkg-source.1 \
	dpkg-split.1 \
	dpkg-statoverride.8 \
	dpkg-trigger.1 \
	dpkg-vendor.1 \
	dpkg.1 \
	dpkg.cfg.5 \
	maintscript-helper.1

if WITH_DSELECT
dist_man_MANS += \
	dselect.1 \
	dselect.cfg.5
endif

if WITH_START_STOP_DAEMON
dist_man_MANS += \
	start-stop-daemon.8
endif

if WITH_UPDATE_ALTERNATIVES
dist_man_MANS += \
	update-alternatives.8
endif

EXTRA_DIST = \
	po/ChangeLog.old \
	po/po4a.cfg \
	po/dpkg-man.pot

.PHONY: update-po