Randomize certificate serials to prevent chosen prefix hash collision
[openxpki.git] / trunk / i18n / Makefile
blob42c03a8f429095799a79b0899c6c05ccb05afe12
1 VERGEN = ../../tools/vergen
2 PREFIX?= /usr
3 LOCALE_DIR = $(DESTDIR)$(PREFIX)/share/locale
4 MO_FILE = openxpki.mo
5 INSTALL = install
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)
19 $(PO_SOURCES)::
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; \
24 else \
25 msgmerge -s --update $@ openxpki.pot; \
27 @rm -f $@~
28 @perl convert.pl $@ > $@_utf8 2>/dev/null
29 @if (test ! -z "`diff $@ $@_utf8`"); then echo no utf8; exit 1; fi
30 @rm -f $@_utf8
32 ## do not depend on openxpki.pot or some directories - this does not work
33 scan:
34 perl build-pot.pl $(POT_SOURCES) > openxpki.pot
35 $(MAKE) $(PO_SOURCES)
37 install:: $(LANGS)
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); \
44 else \
45 $(INSTALL) -m 644 $$lang/$(MO_FILE) $(LOCALE_DIR)/$$lang/LC_MESSAGES/$(MO_FILE); \
46 fi \
47 done
49 install_dir:
50 @if (test ! -d $(DIR)); then \
51 $(INSTALL) -m 755 -d $(DIR); \
52 else \
53 echo directory already exists; \
56 .SUFFIXES: .mo .po
58 .po.mo:
59 @if (test -f $<.local) ; then \
60 echo "Using local file" ; \
61 msgcat --use-first $<.local $< | msgfmt -o $@ - ; \
62 else \
63 msgfmt -o $@ $< ; \
66 test install clean distclean::
68 clean::
69 rm -f */*.po~
71 distclean:: clean
72 rm -f *.pot */*.mo
74 writeversion:
75 @( if (test -f $(VERGEN)) ; then \
76 $(VERGEN) --format version > $(VERSION_FILE); \
77 fi )
78 @( if (test ! -f $(VERSION_FILE) ) ; then \
79 echo "Could not determine version" ; \
80 exit 1; \
81 fi )
83 readversion: writeversion
84 VERSION=$(shell cat $(VERSION_FILE))
86 #dist: VERSION=`$(VERGEN) --format version`
87 dist: readversion
88 if (test -d openxpki-i18n-$(VERSION)) ; then \
89 rm -rf openxpki-i18n-$(VERSION)/ ; \
91 mkdir openxpki-i18n-$(VERSION)
92 tar -c -p -f - \
93 --exclude "*.svn" \
94 --exclude "openxpki-i18n-*" \
95 --exclude "*.1" \
96 --exclude "*~" \
97 . | \
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)/