Blame SOURCES/0012-Move-po-translation-files-into-the-right-sub-directo.patch

9bbebd
From 4015e9299bfda622e9d407cdbcc536000688aa8f Mon Sep 17 00:00:00 2001
9bbebd
From: Petr Lautrbach <plautrba@redhat.com>
9bbebd
Date: Mon, 6 Aug 2018 13:23:00 +0200
9bbebd
Subject: [PATCH] Move po/ translation files into the right sub-directories
9bbebd
9bbebd
When policycoreutils was split into policycoreutils/ python/ gui/ and sandbox/
9bbebd
sub-directories, po/ translation files stayed in policycoreutils/.
9bbebd
9bbebd
This commit split original policycoreutils/po directory into
9bbebd
policycoreutils/po
9bbebd
python/po
9bbebd
gui/po
9bbebd
sandbox/po
9bbebd
9bbebd
See https://github.com/fedora-selinux/selinux/issues/43
9bbebd
---
9bbebd
 gui/Makefile                |  3 ++
9bbebd
 gui/po/Makefile             | 82 ++++++++++++++++++++++++++++++++++++
9bbebd
 gui/po/POTFILES             | 17 ++++++++
9bbebd
 policycoreutils/po/Makefile | 70 ++-----------------------------
9bbebd
 policycoreutils/po/POTFILES |  9 ++++
9bbebd
 python/Makefile             |  2 +-
9bbebd
 python/po/Makefile          | 83 +++++++++++++++++++++++++++++++++++++
9bbebd
 python/po/POTFILES          | 10 +++++
9bbebd
 sandbox/Makefile            |  2 +
9bbebd
 sandbox/po/Makefile         | 82 ++++++++++++++++++++++++++++++++++++
9bbebd
 sandbox/po/POTFILES         |  1 +
9bbebd
 11 files changed, 293 insertions(+), 68 deletions(-)
9bbebd
 create mode 100644 gui/po/Makefile
9bbebd
 create mode 100644 gui/po/POTFILES
9bbebd
 create mode 100644 policycoreutils/po/POTFILES
9bbebd
 create mode 100644 python/po/Makefile
9bbebd
 create mode 100644 python/po/POTFILES
9bbebd
 create mode 100644 sandbox/po/Makefile
9bbebd
 create mode 100644 sandbox/po/POTFILES
9bbebd
9bbebd
diff --git a/gui/Makefile b/gui/Makefile
9bbebd
index ca965c94..5a5bf6dc 100644
9bbebd
--- a/gui/Makefile
9bbebd
+++ b/gui/Makefile
9bbebd
@@ -22,6 +22,7 @@ system-config-selinux.ui \
9bbebd
 usersPage.py
9bbebd
 
9bbebd
 all: $(TARGETS) system-config-selinux.py polgengui.py
9bbebd
+	(cd po && $(MAKE) $@)
9bbebd
 
9bbebd
 install: all
9bbebd
 	-mkdir -p $(DESTDIR)$(MANDIR)/man8
9bbebd
@@ -54,6 +55,8 @@ install: all
9bbebd
 		install -m 644 sepolicy_$${i}.png $(DESTDIR)$(DATADIR)/icons/hicolor/$${i}x$${i}/apps/sepolicy.png; \
9bbebd
 	done
9bbebd
 	install -m 644 org.selinux.config.policy $(DESTDIR)$(DATADIR)/polkit-1/actions/
9bbebd
+	(cd po && $(MAKE) $@)
9bbebd
+
9bbebd
 clean:
9bbebd
 
9bbebd
 indent:
9bbebd
diff --git a/gui/po/Makefile b/gui/po/Makefile
9bbebd
new file mode 100644
9bbebd
index 00000000..a0f5439f
9bbebd
--- /dev/null
9bbebd
+++ b/gui/po/Makefile
9bbebd
@@ -0,0 +1,82 @@
9bbebd
+#
9bbebd
+# Makefile for the PO files (translation) catalog
9bbebd
+#
9bbebd
+
9bbebd
+PREFIX ?= /usr
9bbebd
+
9bbebd
+# What is this package?
9bbebd
+NLSPACKAGE	= gui
9bbebd
+POTFILE		= $(NLSPACKAGE).pot
9bbebd
+INSTALL		= /usr/bin/install -c -p
9bbebd
+INSTALL_DATA	= $(INSTALL) -m 644
9bbebd
+INSTALL_DIR	= /usr/bin/install -d
9bbebd
+
9bbebd
+# destination directory
9bbebd
+INSTALL_NLS_DIR = $(PREFIX)/share/locale
9bbebd
+
9bbebd
+# PO catalog handling
9bbebd
+MSGMERGE	= msgmerge
9bbebd
+MSGMERGE_FLAGS	= -q
9bbebd
+XGETTEXT	= xgettext --default-domain=$(NLSPACKAGE)
9bbebd
+MSGFMT		= msgfmt
9bbebd
+
9bbebd
+# All possible linguas
9bbebd
+PO_LINGUAS := $(sort $(patsubst %.po,%,$(wildcard *.po)))
9bbebd
+
9bbebd
+# Only the files matching what the user has set in LINGUAS
9bbebd
+USER_LINGUAS := $(filter $(patsubst %,%%,$(LINGUAS)),$(PO_LINGUAS))
9bbebd
+
9bbebd
+# if no valid LINGUAS, build all languages
9bbebd
+USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
9bbebd
+
9bbebd
+POFILES		= $(patsubst %,%.po,$(USE_LINGUAS))
9bbebd
+MOFILES		= $(patsubst %.po,%.mo,$(POFILES))
9bbebd
+POTFILES  = $(shell cat POTFILES)
9bbebd
+
9bbebd
+#default:: clean
9bbebd
+
9bbebd
+all::  $(MOFILES)
9bbebd
+
9bbebd
+$(POTFILE): $(POTFILES)
9bbebd
+	$(XGETTEXT) --keyword=_ --keyword=N_ $(POTFILES)
9bbebd
+	@if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
9bbebd
+	    rm -f $(NLSPACKAGE).po; \
9bbebd
+	else \
9bbebd
+	    mv -f $(NLSPACKAGE).po $(POTFILE); \
9bbebd
+	fi; \
9bbebd
+
9bbebd
+
9bbebd
+refresh-po: Makefile
9bbebd
+	for cat in $(POFILES); do \
9bbebd
+		lang=`basename $$cat .po`; \
9bbebd
+		if $(MSGMERGE) $(MSGMERGE_FLAGS) $$lang.po $(POTFILE) > $$lang.pot ; then \
9bbebd
+			mv -f $$lang.pot $$lang.po ; \
9bbebd
+			echo "$(MSGMERGE) of $$lang succeeded" ; \
9bbebd
+		else \
9bbebd
+			echo "$(MSGMERGE) of $$lang failed" ; \
9bbebd
+			rm -f $$lang.pot ; \
9bbebd
+		fi \
9bbebd
+	done
9bbebd
+
9bbebd
+clean:
9bbebd
+	@rm -fv *mo *~ .depend
9bbebd
+	@rm -rf tmp
9bbebd
+
9bbebd
+install: $(MOFILES)
9bbebd
+	@for n in $(MOFILES); do \
9bbebd
+	    l=`basename $$n .mo`; \
9bbebd
+	    $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
9bbebd
+	    $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/selinux-$(NLSPACKAGE).mo; \
9bbebd
+	done
9bbebd
+
9bbebd
+%.mo: %.po
9bbebd
+	$(MSGFMT) -o $@ $<
9bbebd
+report:
9bbebd
+	@for cat in $(wildcard *.po); do \
9bbebd
+                echo -n "$$cat: "; \
9bbebd
+                msgfmt -v --statistics -o /dev/null $$cat; \
9bbebd
+        done
9bbebd
+
9bbebd
+.PHONY: missing depend
9bbebd
+
9bbebd
+relabel:
9bbebd
diff --git a/gui/po/POTFILES b/gui/po/POTFILES
9bbebd
new file mode 100644
9bbebd
index 00000000..1795c5c1
9bbebd
--- /dev/null
9bbebd
+++ b/gui/po/POTFILES
9bbebd
@@ -0,0 +1,17 @@
9bbebd
+../booleansPage.py
9bbebd
+../domainsPage.py
9bbebd
+../fcontextPage.py
9bbebd
+../loginsPage.py
9bbebd
+../modulesPage.py
9bbebd
+../org.selinux.config.policy
9bbebd
+../polgengui.py
9bbebd
+../polgen.ui
9bbebd
+../portsPage.py
9bbebd
+../selinux-polgengui.desktop
9bbebd
+../semanagePage.py
9bbebd
+../sepolicy.desktop
9bbebd
+../statusPage.py
9bbebd
+../system-config-selinux.desktop
9bbebd
+../system-config-selinux.py
9bbebd
+../system-config-selinux.ui
9bbebd
+../usersPage.py
9bbebd
diff --git a/policycoreutils/po/Makefile b/policycoreutils/po/Makefile
9bbebd
index 575e1431..18bc1dff 100644
9bbebd
--- a/policycoreutils/po/Makefile
9bbebd
+++ b/policycoreutils/po/Makefile
9bbebd
@@ -3,7 +3,6 @@
9bbebd
 #
9bbebd
 
9bbebd
 PREFIX ?= /usr
9bbebd
-TOP	 = ../..
9bbebd
 
9bbebd
 # What is this package?
9bbebd
 NLSPACKAGE	= policycoreutils
9bbebd
@@ -32,74 +31,13 @@ USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
9bbebd
 
9bbebd
 POFILES		= $(patsubst %,%.po,$(USE_LINGUAS))
9bbebd
 MOFILES		= $(patsubst %.po,%.mo,$(POFILES))
9bbebd
-POTFILES = \
9bbebd
-	../run_init/open_init_pty.c \
9bbebd
-	../run_init/run_init.c \
9bbebd
-	../semodule_link/semodule_link.c \
9bbebd
-	../audit2allow/audit2allow \
9bbebd
-	../semanage/seobject.py \
9bbebd
-	../setsebool/setsebool.c \
9bbebd
-	../newrole/newrole.c \
9bbebd
-	../load_policy/load_policy.c \
9bbebd
-	../sestatus/sestatus.c \
9bbebd
-	../semodule/semodule.c \
9bbebd
-	../setfiles/setfiles.c \
9bbebd
-	../semodule_package/semodule_package.c \
9bbebd
-	../semodule_deps/semodule_deps.c \
9bbebd
-	../semodule_expand/semodule_expand.c \
9bbebd
-	../scripts/chcat \
9bbebd
-	../scripts/fixfiles \
9bbebd
-	../restorecond/stringslist.c \
9bbebd
-	../restorecond/restorecond.h \
9bbebd
-	../restorecond/utmpwatcher.h \
9bbebd
-	../restorecond/stringslist.h \
9bbebd
-	../restorecond/restorecond.c \
9bbebd
-	../restorecond/utmpwatcher.c \
9bbebd
-	../gui/booleansPage.py \
9bbebd
-	../gui/fcontextPage.py \
9bbebd
-	../gui/loginsPage.py \
9bbebd
-	../gui/mappingsPage.py \
9bbebd
-	../gui/modulesPage.py \
9bbebd
-	../gui/polgen.glade \
9bbebd
-	../gui/polgengui.py \
9bbebd
-	../gui/portsPage.py \
9bbebd
-	../gui/semanagePage.py \
9bbebd
-	../gui/statusPage.py \
9bbebd
-	../gui/system-config-selinux.glade \
9bbebd
-	../gui/system-config-selinux.py \
9bbebd
-	../gui/usersPage.py \
9bbebd
-	../secon/secon.c \
9bbebd
-	booleans.py \
9bbebd
-	../sepolicy/sepolicy.py \
9bbebd
-	../sepolicy/sepolicy/communicate.py \
9bbebd
-	../sepolicy/sepolicy/__init__.py \
9bbebd
-	../sepolicy/sepolicy/network.py \
9bbebd
-	../sepolicy/sepolicy/generate.py \
9bbebd
-	../sepolicy/sepolicy/sepolicy.glade \
9bbebd
-	../sepolicy/sepolicy/gui.py \
9bbebd
-	../sepolicy/sepolicy/manpage.py \
9bbebd
-	../sepolicy/sepolicy/transition.py \
9bbebd
-	../sepolicy/sepolicy/templates/executable.py \
9bbebd
-	../sepolicy/sepolicy/templates/__init__.py \
9bbebd
-	../sepolicy/sepolicy/templates/network.py \
9bbebd
-	../sepolicy/sepolicy/templates/rw.py \
9bbebd
-	../sepolicy/sepolicy/templates/script.py \
9bbebd
-	../sepolicy/sepolicy/templates/semodule.py \
9bbebd
-	../sepolicy/sepolicy/templates/tmp.py \
9bbebd
-	../sepolicy/sepolicy/templates/user.py \
9bbebd
-	../sepolicy/sepolicy/templates/var_lib.py \
9bbebd
-	../sepolicy/sepolicy/templates/var_log.py \
9bbebd
-	../sepolicy/sepolicy/templates/var_run.py \
9bbebd
-	../sepolicy/sepolicy/templates/var_spool.py
9bbebd
+POTFILES  = $(shell cat POTFILES)
9bbebd
 
9bbebd
 #default:: clean
9bbebd
 
9bbebd
-all::  $(MOFILES)
9bbebd
+all:: $(POTFILE) $(MOFILES)
9bbebd
 
9bbebd
-booleans.py:
9bbebd
-	sepolicy booleans -a > booleans.py
9bbebd
-
9bbebd
-$(POTFILE): $(POTFILES) booleans.py
9bbebd
+$(POTFILE): $(POTFILES)
9bbebd
 	$(XGETTEXT) --keyword=_ --keyword=N_ $(POTFILES)
9bbebd
 	@if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
9bbebd
 	    rm -f $(NLSPACKAGE).po; \
9bbebd
@@ -107,8 +45,6 @@ $(POTFILE): $(POTFILES) booleans.py
9bbebd
 	    mv -f $(NLSPACKAGE).po $(POTFILE); \
9bbebd
 	fi; \
9bbebd
 
9bbebd
-update-po: Makefile $(POTFILE) refresh-po
9bbebd
-	@rm -f booleans.py
9bbebd
 
9bbebd
 refresh-po: Makefile
9bbebd
 	for cat in $(POFILES); do \
9bbebd
diff --git a/policycoreutils/po/POTFILES b/policycoreutils/po/POTFILES
9bbebd
new file mode 100644
9bbebd
index 00000000..12237dc6
9bbebd
--- /dev/null
9bbebd
+++ b/policycoreutils/po/POTFILES
9bbebd
@@ -0,0 +1,9 @@
9bbebd
+../run_init/open_init_pty.c
9bbebd
+../run_init/run_init.c
9bbebd
+../setsebool/setsebool.c
9bbebd
+../newrole/newrole.c
9bbebd
+../load_policy/load_policy.c
9bbebd
+../sestatus/sestatus.c
9bbebd
+../semodule/semodule.c
9bbebd
+../setfiles/setfiles.c
9bbebd
+../secon/secon.c
9bbebd
diff --git a/python/Makefile b/python/Makefile
9bbebd
index 9b66d52f..00312dbd 100644
9bbebd
--- a/python/Makefile
9bbebd
+++ b/python/Makefile
9bbebd
@@ -1,4 +1,4 @@
9bbebd
-SUBDIRS = sepolicy audit2allow semanage sepolgen chcat
9bbebd
+SUBDIRS = sepolicy audit2allow semanage sepolgen chcat po
9bbebd
 
9bbebd
 all install relabel clean indent test:
9bbebd
 	@for subdir in $(SUBDIRS); do \
9bbebd
diff --git a/python/po/Makefile b/python/po/Makefile
9bbebd
new file mode 100644
9bbebd
index 00000000..4e052d5a
9bbebd
--- /dev/null
9bbebd
+++ b/python/po/Makefile
9bbebd
@@ -0,0 +1,83 @@
9bbebd
+#
9bbebd
+# Makefile for the PO files (translation) catalog
9bbebd
+#
9bbebd
+
9bbebd
+PREFIX ?= /usr
9bbebd
+
9bbebd
+# What is this package?
9bbebd
+NLSPACKAGE	= python
9bbebd
+POTFILE		= $(NLSPACKAGE).pot
9bbebd
+INSTALL		= /usr/bin/install -c -p
9bbebd
+INSTALL_DATA	= $(INSTALL) -m 644
9bbebd
+INSTALL_DIR	= /usr/bin/install -d
9bbebd
+
9bbebd
+# destination directory
9bbebd
+INSTALL_NLS_DIR = $(PREFIX)/share/locale
9bbebd
+
9bbebd
+# PO catalog handling
9bbebd
+MSGMERGE	= msgmerge
9bbebd
+MSGMERGE_FLAGS	= -q
9bbebd
+XGETTEXT	= xgettext --default-domain=$(NLSPACKAGE)
9bbebd
+MSGFMT		= msgfmt
9bbebd
+
9bbebd
+# All possible linguas
9bbebd
+PO_LINGUAS := $(sort $(patsubst %.po,%,$(wildcard *.po)))
9bbebd
+
9bbebd
+# Only the files matching what the user has set in LINGUAS
9bbebd
+USER_LINGUAS := $(filter $(patsubst %,%%,$(LINGUAS)),$(PO_LINGUAS))
9bbebd
+
9bbebd
+# if no valid LINGUAS, build all languages
9bbebd
+USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
9bbebd
+
9bbebd
+POFILES		= $(patsubst %,%.po,$(USE_LINGUAS))
9bbebd
+MOFILES		= $(patsubst %.po,%.mo,$(POFILES))
9bbebd
+POTFILES  = $(shell cat POTFILES)
9bbebd
+
9bbebd
+#default:: clean
9bbebd
+
9bbebd
+all::  $(MOFILES)
9bbebd
+
9bbebd
+$(POTFILE): $(POTFILES) 
9bbebd
+	$(XGETTEXT) -L Python --keyword=_ --keyword=N_ $(POTFILES)
9bbebd
+	$(XGETTEXT) -j --keyword=_ --keyword=N_ ../sepolicy/sepolicy/sepolicy.glade
9bbebd
+	@if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
9bbebd
+	    rm -f $(NLSPACKAGE).po; \
9bbebd
+	else \
9bbebd
+	    mv -f $(NLSPACKAGE).po $(POTFILE); \
9bbebd
+	fi; \
9bbebd
+
9bbebd
+
9bbebd
+refresh-po: Makefile
9bbebd
+	for cat in $(POFILES); do \
9bbebd
+		lang=`basename $$cat .po`; \
9bbebd
+		if $(MSGMERGE) $(MSGMERGE_FLAGS) $$lang.po $(POTFILE) > $$lang.pot ; then \
9bbebd
+			mv -f $$lang.pot $$lang.po ; \
9bbebd
+			echo "$(MSGMERGE) of $$lang succeeded" ; \
9bbebd
+		else \
9bbebd
+			echo "$(MSGMERGE) of $$lang failed" ; \
9bbebd
+			rm -f $$lang.pot ; \
9bbebd
+		fi \
9bbebd
+	done
9bbebd
+
9bbebd
+clean:
9bbebd
+	@rm -fv *mo *~ .depend
9bbebd
+	@rm -rf tmp
9bbebd
+
9bbebd
+install: $(MOFILES)
9bbebd
+	@for n in $(MOFILES); do \
9bbebd
+	    l=`basename $$n .mo`; \
9bbebd
+	    $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
9bbebd
+	    $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/selinux-$(NLSPACKAGE).mo; \
9bbebd
+	done
9bbebd
+
9bbebd
+%.mo: %.po
9bbebd
+	$(MSGFMT) -o $@ $<
9bbebd
+report:
9bbebd
+	@for cat in $(wildcard *.po); do \
9bbebd
+                echo -n "$$cat: "; \
9bbebd
+                msgfmt -v --statistics -o /dev/null $$cat; \
9bbebd
+        done
9bbebd
+
9bbebd
+.PHONY: missing depend
9bbebd
+
9bbebd
+relabel:
9bbebd
diff --git a/python/po/POTFILES b/python/po/POTFILES
9bbebd
new file mode 100644
9bbebd
index 00000000..128eb870
9bbebd
--- /dev/null
9bbebd
+++ b/python/po/POTFILES
9bbebd
@@ -0,0 +1,10 @@
9bbebd
+../audit2allow/audit2allow
9bbebd
+../chcat/chcat
9bbebd
+../semanage/semanage
9bbebd
+../semanage/seobject.py
9bbebd
+../sepolgen/src/sepolgen/interfaces.py
9bbebd
+../sepolicy/sepolicy/generate.py
9bbebd
+../sepolicy/sepolicy/gui.py
9bbebd
+../sepolicy/sepolicy/__init__.py
9bbebd
+../sepolicy/sepolicy/interface.py
9bbebd
+../sepolicy/sepolicy.py
9bbebd
diff --git a/sandbox/Makefile b/sandbox/Makefile
9bbebd
index 9da5e58d..b817824e 100644
9bbebd
--- a/sandbox/Makefile
9bbebd
+++ b/sandbox/Makefile
9bbebd
@@ -13,6 +13,7 @@ override LDLIBS += -lselinux -lcap-ng
9bbebd
 SEUNSHARE_OBJS = seunshare.o
9bbebd
 
9bbebd
 all: sandbox seunshare sandboxX.sh start
9bbebd
+	(cd po && $(MAKE) $@)
9bbebd
 
9bbebd
 seunshare: $(SEUNSHARE_OBJS)
9bbebd
 
9bbebd
@@ -39,6 +40,7 @@ install: all
9bbebd
 	install -m 755 start $(DESTDIR)$(SHAREDIR)
9bbebd
 	-mkdir -p $(DESTDIR)$(SYSCONFDIR)
9bbebd
 	install -m 644 sandbox.conf $(DESTDIR)$(SYSCONFDIR)/sandbox
9bbebd
+	(cd po && $(MAKE) $@)
9bbebd
 
9bbebd
 test:
9bbebd
 	@$(PYTHON) test_sandbox.py -v
9bbebd
diff --git a/sandbox/po/Makefile b/sandbox/po/Makefile
9bbebd
new file mode 100644
9bbebd
index 00000000..0556bbe9
9bbebd
--- /dev/null
9bbebd
+++ b/sandbox/po/Makefile
9bbebd
@@ -0,0 +1,82 @@
9bbebd
+#
9bbebd
+# Makefile for the PO files (translation) catalog
9bbebd
+#
9bbebd
+
9bbebd
+PREFIX ?= /usr
9bbebd
+
9bbebd
+# What is this package?
9bbebd
+NLSPACKAGE	= sandbox
9bbebd
+POTFILE		= $(NLSPACKAGE).pot
9bbebd
+INSTALL		= /usr/bin/install -c -p
9bbebd
+INSTALL_DATA	= $(INSTALL) -m 644
9bbebd
+INSTALL_DIR	= /usr/bin/install -d
9bbebd
+
9bbebd
+# destination directory
9bbebd
+INSTALL_NLS_DIR = $(PREFIX)/share/locale
9bbebd
+
9bbebd
+# PO catalog handling
9bbebd
+MSGMERGE	= msgmerge
9bbebd
+MSGMERGE_FLAGS	= -q
9bbebd
+XGETTEXT	= xgettext -L Python --default-domain=$(NLSPACKAGE)
9bbebd
+MSGFMT		= msgfmt
9bbebd
+
9bbebd
+# All possible linguas
9bbebd
+PO_LINGUAS := $(sort $(patsubst %.po,%,$(wildcard *.po)))
9bbebd
+
9bbebd
+# Only the files matching what the user has set in LINGUAS
9bbebd
+USER_LINGUAS := $(filter $(patsubst %,%%,$(LINGUAS)),$(PO_LINGUAS))
9bbebd
+
9bbebd
+# if no valid LINGUAS, build all languages
9bbebd
+USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
9bbebd
+
9bbebd
+POFILES		= $(patsubst %,%.po,$(USE_LINGUAS))
9bbebd
+MOFILES		= $(patsubst %.po,%.mo,$(POFILES))
9bbebd
+POTFILES  = $(shell cat POTFILES)
9bbebd
+
9bbebd
+#default:: clean
9bbebd
+
9bbebd
+all:: $(POTFILE) $(MOFILES)
9bbebd
+
9bbebd
+$(POTFILE): $(POTFILES)
9bbebd
+	$(XGETTEXT) --keyword=_ --keyword=N_ $(POTFILES)
9bbebd
+	@if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
9bbebd
+	    rm -f $(NLSPACKAGE).po; \
9bbebd
+	else \
9bbebd
+	    mv -f $(NLSPACKAGE).po $(POTFILE); \
9bbebd
+	fi; \
9bbebd
+
9bbebd
+
9bbebd
+refresh-po: Makefile
9bbebd
+	for cat in $(POFILES); do \
9bbebd
+		lang=`basename $$cat .po`; \
9bbebd
+		if $(MSGMERGE) $(MSGMERGE_FLAGS) $$lang.po $(POTFILE) > $$lang.pot ; then \
9bbebd
+			mv -f $$lang.pot $$lang.po ; \
9bbebd
+			echo "$(MSGMERGE) of $$lang succeeded" ; \
9bbebd
+		else \
9bbebd
+			echo "$(MSGMERGE) of $$lang failed" ; \
9bbebd
+			rm -f $$lang.pot ; \
9bbebd
+		fi \
9bbebd
+	done
9bbebd
+
9bbebd
+clean:
9bbebd
+	@rm -fv *mo *~ .depend
9bbebd
+	@rm -rf tmp
9bbebd
+
9bbebd
+install: $(MOFILES)
9bbebd
+	@for n in $(MOFILES); do \
9bbebd
+	    l=`basename $$n .mo`; \
9bbebd
+	    $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
9bbebd
+	    $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/selinux-$(NLSPACKAGE).mo; \
9bbebd
+	done
9bbebd
+
9bbebd
+%.mo: %.po
9bbebd
+	$(MSGFMT) -o $@ $<
9bbebd
+report:
9bbebd
+	@for cat in $(wildcard *.po); do \
9bbebd
+                echo -n "$$cat: "; \
9bbebd
+                msgfmt -v --statistics -o /dev/null $$cat; \
9bbebd
+        done
9bbebd
+
9bbebd
+.PHONY: missing depend
9bbebd
+
9bbebd
+relabel:
9bbebd
diff --git a/sandbox/po/POTFILES b/sandbox/po/POTFILES
9bbebd
new file mode 100644
9bbebd
index 00000000..deff3f2f
9bbebd
--- /dev/null
9bbebd
+++ b/sandbox/po/POTFILES
9bbebd
@@ -0,0 +1 @@
9bbebd
+../sandbox
9bbebd
-- 
9bbebd
2.21.0
9bbebd