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

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