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