1
2noinst_SCRIPTS = gen-po.sh
3
4gen-po.sh: gen-po.in
5	sed \
6	  -e 's,[@]top_srcdir[@],$(top_srcdir),' \
7	  -e 's,[@]PACKAGE_NAME[@],$(PACKAGE_NAME),' \
8	  -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),' \
9	  < $(srcdir)/gen-po.in > gen-po.tmp
10	chmod +x gen-po.tmp
11	mv gen-po.tmp gen-po.sh
12
13ceprefix=heim_com_err
14
15po: gen-po.sh
16	./gen-po.sh heimdal_krb5 $(top_srcdir)/lib/krb5/*.[chly]
17	./gen-po.sh heimdal_kuser $(top_srcdir)/kuser/*.[ch]
18	find $(top_srcdir) -name *.et | while read x; do \
19		y=$$(basename $$x); \
20		echo $$y ; \
21		z=$$(echo $$y | sed 's/\.et$$//') ; \
22		t=$$(find $(top_builddir) -name $$z.c) ; \
23		t=$$(echo $$t | sed 's/\.c$$//') ; \
24		base=$$(grep 'ERROR_TABLE_BASE_' $${t}.h | cut -f3 -d' ') ; \
25		./gen-po.sh $(ceprefix)$$base $${t}.c ; \
26		test -f $(top_srcdir)/po/$(ceprefix)$$base/$(ceprefix)$$base.pot || { echo "$$y missing" ; exit 1; } \
27	done
28
29mo:
30	cd $(srcdir) ; \
31	rm localefiles ; \
32	touch localefiles ; \
33	find . -name '*.po' | while read s ; do \
34	   t=$$(echo $$s | sed -e 's/\.po$$/.mo/') ; \
35	   msgfmt -o $$t $$s ; \
36	   echo $$t | sed 's@\./@@' >> localefiles ; \
37	done
38
39install-data-hook:
40	@for x in `cat $(srcdir)/localefiles` ; do \
41	    domain=`echo $$x | sed 's@/.*@@'`; \
42	    lang=`echo $$x | sed 's@.*/\(.*\)\\.mo$$@\1@'`; \
43	    echo "installing lang $$domain $$lang" ; \
44	    $(top_srcdir)/install-sh -d \
45		"$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES" ; \
46	    $(top_srcdir)/install-sh $(srcdir)/$$x \
47	        "$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$domain.mo" ; \
48	done
49
50#find . -name '*.po' -or -name '*.pot' -or -name '*.mo' | sed 's/^../    /' | sed 's/$/ \\/'
51FILES = \
52    heim_com_err-1750206208/heim_com_err-1750206208.pot \
53    heim_com_err-1765328384/heim_com_err-1765328384.pot \
54    heim_com_err-1765328384/sv_SE.mo \
55    heim_com_err-1765328384/sv_SE.po \
56    heim_com_err-1980176640/heim_com_err-1980176640.pot \
57    heim_com_err-969269760/heim_com_err-969269760.pot \
58    heim_com_err1859794432/heim_com_err1859794432.pot \
59    heim_com_err35224064/heim_com_err35224064.pot \
60    heim_com_err36150272/heim_com_err36150272.pot \
61    heim_com_err39525376/heim_com_err39525376.pot \
62    heim_com_err43787520/heim_com_err43787520.pot \
63    heim_com_err569856/heim_com_err569856.pot \
64    heimdal_kuser/heimdal_kuser.pot \
65    heimdal_krb5/heimdal_krb5.pot \
66    heimdal_krb5/sv_SE.mo \
67    heimdal_krb5/sv_SE.po
68
69EXTRA_DIST = gen-po.in $(FILES)
70CLEANFILES = gen-po.tmp $(noinst_SCRIPTS) heimdal-pot.tar.gz
71
72launchpad:
73	tar czCf \
74		$(top_srcdir) \
75		$(top_builddir)/po/heimdal-pot.tar.gz \
76		$$(cd $(top_srcdir) && find . -name '*.pot')
77