1 VERGEN
= ..
/..
/tools
/vergen
3 LOCALE_DIR
= $(DESTDIR
)$(PREFIX
)/share
/locale
6 LANGS
= en_US en_GB de_DE ru_RU
7 PO_SOURCES
= $(LANGS
:%=%/openxpki.po
)
8 MO_TRANSLATIONS
= $(LANGS
:%=%/$(MO_FILE
))
9 POT_SOURCES
= ..
/perl-modules
/core
/trunk ..
/clients
/perl
/OpenXPKI-Client ..
/clients
/perl
/OpenXPKI-Client-SCEP ..
/clients
/perl
/OpenXPKI-Client-HTML-Mason ..
/deployment
10 VERSION_FILE
= .
/VERSION
12 #---- variable settings above, rules below ----
14 .PHONY
: default
test install clean clean.local
distclean openxpki.pot
16 default
:: $(MO_TRANSLATIONS
)
17 @echo Languages
: $(LANGS
)
20 @if
(test ! -d
$(@
:openxpki.po
=)); then echo creating directory for
$(@
:openxpki.po
=); mkdir
$(@
:openxpki.po
=); fi
21 @if
(test ! -f
$@
); then echo creating po file
$@
; cp openxpki.pot
$@
; fi
22 @if
(test `uname` = "SunOS"); then \
23 gmsgmerge
-s
--update
$@ openxpki.pot
; \
25 msgmerge
-s
--update
$@ openxpki.pot
; \
28 @perl convert.pl
$@
> $@_utf8
2>/dev
/null
29 @if
(test ! -z
"`diff $@ $@_utf8`"); then echo no utf8
; exit
1; fi
32 ## do not depend on openxpki.pot or some directories - this does not work
34 perl build-pot.pl
$(POT_SOURCES
) > openxpki.pot
38 $(MAKE
) install_dir DIR
=$(LOCALE_DIR
)
39 @set
-e
; for lang in
$(LANGS
); do \
40 $(MAKE
) install_dir DIR
=$(LOCALE_DIR
)/$$lang; \
41 $(MAKE
) install_dir DIR
=$(LOCALE_DIR
)/$$lang/LC_MESSAGES
; \
42 if
(test `uname` = "SunOS"); then \
43 $(INSTALL
) -m
644 -f
$(LOCALE_DIR
)/$$lang/LC_MESSAGES
$$lang/$(MO_FILE
); \
45 $(INSTALL
) -m
644 $$lang/$(MO_FILE
) $(LOCALE_DIR
)/$$lang/LC_MESSAGES
/$(MO_FILE
); \
50 @if
(test ! -d
$(DIR
)); then \
51 $(INSTALL
) -m
755 -d
$(DIR
); \
53 echo directory already exists
; \
59 @if
(test -f
$<.local
) ; then \
60 echo
"Using local file" ; \
61 msgcat
--use-first
$<.local
$< | msgfmt
-o
$@
- ; \
66 test install clean distclean::
75 @
( if
(test -f
$(VERGEN
)) ; then \
76 $(VERGEN
) --format version
> $(VERSION_FILE
); \
78 @
( if
(test ! -f
$(VERSION_FILE
) ) ; then \
79 echo
"Could not determine version" ; \
83 readversion
: writeversion
84 VERSION
=$(shell cat
$(VERSION_FILE
))
86 #dist: VERSION=`$(VERGEN) --format version`
88 if
(test -d openxpki-i18n-
$(VERSION
)) ; then \
89 rm -rf openxpki-i18n-
$(VERSION
)/ ; \
91 mkdir openxpki-i18n-
$(VERSION
)
94 --exclude
"openxpki-i18n-*" \
98 tar -C openxpki-i18n-
$(VERSION
)/ -x
-f
-
99 tar cf openxpki-i18n-
$(VERSION
).
tar openxpki-i18n-
$(VERSION
)
100 gzip
--best
--force openxpki-i18n-
$(VERSION
).
tar
101 rm -rf openxpki-i18n-
$(VERSION
)/