diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | setup/Makefile.am | 5 | ||||
-rw-r--r-- | setup/config.py.in | 7 |
3 files changed, 13 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index aee02d3..6df8f2c 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,7 @@ AC_ISC_POSIX AC_HEADER_STDC IT_PROG_INTLTOOL([0.35.0]) AM_PROG_LIBTOOL +AC_PROG_SED # check ibus PKG_CHECK_MODULES(IBUS, [ @@ -206,7 +207,6 @@ src/Makefile src/libpinyin.xml.in setup/Makefile setup/ibus-setup-libpinyin -setup/config.py data/Makefile data/icons/Makefile m4/Makefile diff --git a/setup/Makefile.am b/setup/Makefile.am index 7845342..64a8f1d 100644 --- a/setup/Makefile.am +++ b/setup/Makefile.am @@ -40,6 +40,11 @@ EXTRA_DIST = \ ibus-setup-libpinyin.in \ $(NULL) + +config.py: config.py.in + $(SED) -e "s:[@]VERSION@:$(VERSION):" \ + -e "s:[@]datadir@:$(datadir)/$(PACKAGE):" $< > $@ + test-libpinyin: $(ENV) DBUS_DEBUG=true \ IBUS_LOCALEDIR=@localedir@ \ diff --git a/setup/config.py.in b/setup/config.py.in index 8be42db..b601570 100644 --- a/setup/config.py.in +++ b/setup/config.py.in @@ -3,6 +3,7 @@ # ibus-libpinyin - Intelligent Pinyin engine based on libpinyin for IBus # # Copyright (c) 2008-2010 Peng Huang <shawn.p.huang@gmail.com> +# Copyright (c) 2013 Peng Wu <alexepico@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,5 +18,11 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + def get_version(): return "@VERSION@" + + +def get_package_data_dir(): + return "@datadir@" |