summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2011-03-05 00:48:56 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2011-03-05 00:48:56 +0900
commit92506e7fc05dc54eb39f02c566cdb53a99ef1740 (patch)
treeb63fc9ad746e822f63308f943e7e5c3e0933a1bc
parente29f8a85374a7a28c47010dd145f5126baa3cfa4 (diff)
downloadibus-hangul-92506e7fc05dc54eb39f02c566cdb53a99ef1740.tar.gz
issue: #1210 hangul_keyboard_list should be moved
hangul_keyboard_list is architecture dependent file, so it should be installed in ${pkglibdir} or its subdir. I made it installed in ${pkglibdir}/setup. config.py will be created by Makefile not configure. Variable ${pkglibdir} is suitable for Make, but python will not expand it correctly. It's better for Make to generate config.py so that Make expand the variables.
-rw-r--r--configure.ac1
-rw-r--r--setup/Makefile.am14
-rw-r--r--setup/config.py.in9
-rw-r--r--setup/main.py4
4 files changed, 19 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 043e150..f23faba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,7 +84,6 @@ src/Makefile
src/hangul.xml.in
setup/Makefile
setup/ibus-setup-hangul
-setup/config.py
icons/Makefile
data/Makefile
m4/Makefile
diff --git a/setup/Makefile.am b/setup/Makefile.am
index b9b00b3..cc003bb 100644
--- a/setup/Makefile.am
+++ b/setup/Makefile.am
@@ -19,6 +19,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
setup_hangul_PYTHON = \
+ config.py \
main.py \
keycapturedialog.py \
setup.ui \
@@ -26,11 +27,12 @@ setup_hangul_PYTHON = \
nodist_setup_hangul_PYTHON = config.py
-setup_hanguldir = $(datadir)/ibus-hangul/setup
+setup_hanguldir = $(pkgdatadir)/setup
libexec_SCRIPTS = ibus-setup-hangul
-setup_hangul_PROGRAMS = hangul_keyboard_list
+setuplibdir = $(pkglibdir)/setup
+setuplib_PROGRAMS = hangul_keyboard_list
hangul_keyboard_list_SOURCES = hangul_keyboard_list.c
hangul_keyboard_list_CFLAGS = $(HANGUL_CFLAGS)
@@ -38,10 +40,12 @@ hangul_keyboard_list_LDADD = $(HANGUL_LIBS)
CLEANFILES = \
+ config.py \
*.pyc \
$(NULL)
EXTRA_DIST = \
+ config.py.in \
ibus-setup-hangul.in \
$(NULL)
@@ -50,3 +54,9 @@ test:
PYTHONPATH=$(abs_top_srcdir):$(pyexecdir) \
$(PYTHON) $(srcdir)/main.py
+config.py: config.py.in Makefile
+ sed -e 's&@SETUP_LOCALEDIR@&$(localedir)&g' \
+ -e 's&@SETUP_PKGDATADIR@&$(pkgdatadir)&g' \
+ -e 's&@SETUP_PKGLIBDIR@&$(pkglibdir)&g' $< > $@
+
+ibus-setup-hangul: config.py
diff --git a/setup/config.py.in b/setup/config.py.in
index ab99924..d317fcb 100644
--- a/setup/config.py.in
+++ b/setup/config.py.in
@@ -18,7 +18,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-prefix = "@prefix@"
-datadir = "@prefix@/share"
-localedir = "@prefix@/share/locale"
-setupdir = datadir + "/ibus-hangul/setup"
+localedir = '@SETUP_LOCALEDIR@'
+pkgdatadir = '@SETUP_PKGDATADIR@'
+pkglibdir = '@SETUP_PKGLIBDIR@'
+setupdatadir = pkgdatadir + '/setup'
+setuplibdir = pkglibdir + '/setup'
diff --git a/setup/main.py b/setup/main.py
index 8164543..ba5b0de 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -46,7 +46,7 @@ class Setup ():
self.__builder.add_from_file(ui_file)
# Hangul tab
- pipe = subprocess.Popen([config.setupdir + '/hangul_keyboard_list'], stdout = subprocess.PIPE)
+ pipe = subprocess.Popen([config.setuplibdir + '/hangul_keyboard_list'], stdout = subprocess.PIPE)
list = pipe.communicate()[0].split('\n')
self.__hangul_keyboard = self.__builder.get_object("HangulKeyboard")
@@ -100,7 +100,7 @@ class Setup ():
# setup dialog
self.__window = self.__builder.get_object("SetupDialog")
- icon_file = os.path.join(config.datadir, "ibus-hangul", "icons", "ibus-hangul.svg")
+ icon_file = os.path.join(config.pkgdatadir, "icons", "ibus-hangul.svg")
self.__window.set_icon_from_file(icon_file)
self.__window.connect("response", self.on_response, None)
self.__window.show()