Skip to content

Commit

Permalink
Merge pull request #483 from citrus-it/aarch64
Browse files Browse the repository at this point in the history
Fix hard coded proto, stop using make as a scripting host
  • Loading branch information
hadfl authored Jun 17, 2024
2 parents c40c4dc + dccbb16 commit 9aec25c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 45 deletions.
4 changes: 4 additions & 0 deletions src/Makefile.com
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ROOTETCZONES = $(ROOTETC)/zones
ROOTETCBRAND = $(ROOTETC)/brand
ROOTUSRLIB = $(ROOT)/usr/lib
ROOTUSRSHARE = $(ROOT)/usr/share
ROOTUSRSHARELOCALE = $(ROOTUSRSHARE)/locale
ROOTBRAND = $(ROOTUSRLIB)/brand
ROOTPKGLIB = $(ROOTUSRLIB)/pkg

Expand All @@ -39,6 +40,9 @@ SHELL= /usr/bin/ksh93
INSTALL = /usr/sbin/install
CTFCONVERT = /opt/onbld/bin/i386/ctfconvert
STRIP = /usr/bin/strip
RM = /usr/bin/rm -f
MV = /usr/bin/mv
MKDIR = /usr/bin/mkdir -p

CTFCONVERT_BIN = $(CTFCONVERT) -l pkg5
POST_PROCESS = $(CTFCONVERT_BIN) $@; $(STRIP) -x $@
Expand Down
4 changes: 2 additions & 2 deletions src/man/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ check:
clean clobber:

$(MAN1DIR) $(MAN7DIR) $(MAN8DIR):
mkdir -p $@
$(MKDIR) $@

$(MAN1DIR)/% $(MAN7DIR)/% $(MAN8DIR)/%: %
rm -f $@; $(INSTALL) -f $(@D) -m 0444 $<
$(RM) $@; $(INSTALL) -f $(@D) -m 0444 $<
23 changes: 0 additions & 23 deletions src/po/LINGUAS

This file was deleted.

43 changes: 23 additions & 20 deletions src/po/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,47 @@

#
# Copyright (c) 2024, Oracle and/or its affiliates.
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
#

include ../Makefile.com

XGETTEXT = /usr/gnu/bin/xgettext
MSGFMT = /usr/bin/msgfmt
MKDIR = mkdir -p
INSTALL = cp

PROTO_AREA:sh = echo $(dirname $(dirname $(pwd)))/proto/root_$(uname -p)
LOCALE_DIR = $(PROTO_AREA)/usr/share/locale
LOCALES = ar ca cs de es fr he hu id it ja ko nl pl \
pt_BR ru sk sv zh_CN zh_HK zh_TW

LOCALES:sh = grep -v "^\#" LINGUAS
CATALOGS = $(LOCALES:=.mo)

ROOTLOCALES = $(LOCALES:%=$(ROOTUSRSHARELOCALE)/%/LC_MESSAGES/pkg.mo)
ROOTPOT = $(ROOTUSRSHARELOCALE)/__LOCALE__/LC_MESSAGES/pkg.pot

all: $(CATALOGS) pkg.pot

$(ROOTPOT): pkg.pot
$(MKDIR) $(@D)
$(RM) $@; $(INSTALL) -f $(@D) -m 0444 pkg.pot

$(ROOTUSRSHARELOCALE)/%/LC_MESSAGES/pkg.mo: %.mo
$(MKDIR) $(@D)
$(RM) $@; $(INSTALL) -f $(@D) -m 0444 $<
$(MV) $(@D)/$(<F) $@

install: all $(ROOTPOT) $(ROOTLOCALES)

%.mo: %.po
$(MSGFMT) -o $@ $^

pkg.pot: POTFILES.in
$(XGETTEXT) --add-comments --keyword=N_ --from-code=UTF-8 -f POTFILES.in -D .. -o pkg.pot

install: all
@for locale in $(LOCALES); do \
dir=$(LOCALE_DIR)/$$locale/LC_MESSAGES; \
$(MKDIR) $$dir; \
$(INSTALL) $$locale.mo $$dir/pkg.mo; \
echo "copying $$locale.mo -> $$dir/pkg.mo"; \
done; \
dir=$(LOCALE_DIR)/__LOCALE__/LC_MESSAGES; \
$(MKDIR) $$dir; \
$(INSTALL) pkg.pot $$dir/pkg.pot; \
echo "copying pkg.pot -> $$dir/pkg.pot"
$(XGETTEXT) --add-comments --keyword=N_ \
--from-code=UTF-8 -f POTFILES.in -D .. -o pkg.pot

check:
$(XGETTEXT) --keyword=N_ --from-code=UTF-8 -f POTFILES.in -D .. -o /dev/null 2>i18n_errs.txt
$(XGETTEXT) --keyword=N_ --from-code=UTF-8 -f POTFILES.in \
-D .. -o /dev/null 2>i18n_errs.txt
@if [ -s i18n_errs.txt ]; then \
echo "The following i18n errors were detected and should be corrected:"; \
echo "The following i18n errors were detected:"; \
echo "(this list is saved in i18n_errs.txt)"; \
cat i18n_errs.txt; \
exit 1; \
Expand Down

0 comments on commit 9aec25c

Please sign in to comment.