summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-07-08 17:24:31 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-07-08 17:24:31 +0800
commit2b00952f26f2915cc2ff07d0140d51c492a6fda2 (patch)
treef78b8e66ecfbedc398492b502b88e8bdf3b02b88
parent5175a113e99a86085d754ebc44e68bb8167d0df9 (diff)
downloadibus-2b00952f26f2915cc2ff07d0140d51c492a6fda2.tar.gz
ibus-2b00952f26f2915cc2ff07d0140d51c492a6fda2.tar.xz
ibus-2b00952f26f2915cc2ff07d0140d51c492a6fda2.zip
Add ibus launcher program.
-rw-r--r--Makefile.am24
-rw-r--r--configure.ac2
-rw-r--r--ibus.spec.in1
-rw-r--r--launcher/Makefile.am30
-rw-r--r--launcher/ibus.in42
-rw-r--r--xinput-ibus2
6 files changed, 94 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index a7a6600..a8629a4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,7 @@ SUBDIRS = \
daemon \
gconf \
ibus \
+ launcher \
panel \
engine \
gtk2 \
@@ -34,6 +35,7 @@ SUBDIRS = \
ACLOCAL_AMFLAGS = -I m4
+
EXTRA_DIST = \
autogen.sh \
ibus.spec.in \
@@ -48,14 +50,24 @@ DISTCLEANFILES = \
po/stamp-it \
$(NULL)
-rpm: dist ibus.spec
- rpmbuild -bb \
+rpm: dist @PACKAGE_NAME@.spec
+ rpmbuild -bb \
--define "_sourcedir `pwd`" \
- --define "_builddir `pwd`" \
+ --define "_builddir `pwd`" \
--define "_srcrpmdir `pwd`" \
- --define "_rpmdir `pwd`" \
- --define "_specdir `pwd`" \
- ibus.spec
+ --define "_rpmdir `pwd`" \
+ --define "_specdir `pwd`" \
+ @PACKAGE_NAME@.spec
+
+srpm: dist @PACKAGE_NAME@.spec
+ rpmbuild -bs \
+ --define "_sourcedir `pwd`" \
+ --define "_builddir `pwd`" \
+ --define "_srcrpmdir `pwd`" \
+ --define "_rpmdir `pwd`" \
+ --define "_specdir `pwd`" \
+ @PACKAGE_NAME@.spec
+
clean-rpm:
$(RM) -r "`uname -i`"
diff --git a/configure.ac b/configure.ac
index bbe269b..8c0190f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -143,6 +143,8 @@ ibus/Makefile
ibus/interface/Makefile
daemon/Makefile
daemon/ibus-daemon
+launcher/ibus
+launcher/Makefile
panel/Makefile
panel/ibus-panel
gconf/Makefile
diff --git a/ibus.spec.in b/ibus.spec.in
index 6d69c7e..a3d7f2a 100644
--- a/ibus.spec.in
+++ b/ibus.spec.in
@@ -76,6 +76,7 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_datadir}/ibus/panel/
%dir %{_datadir}/ibus/engine/
%dir %{_datadir}/ibus/icons/
+%{_bindir}/ibus
%{_datadir}/ibus/daemon/*
%{_datadir}/ibus/gconf/*
%{_datadir}/ibus/panel/*
diff --git a/launcher/Makefile.am b/launcher/Makefile.am
new file mode 100644
index 0000000..eaf3167
--- /dev/null
+++ b/launcher/Makefile.am
@@ -0,0 +1,30 @@
+# vim:set noet ts=4:
+#
+# ibus - The Input Bus
+#
+# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+# Boston, MA 02111-1307 USA
+
+bin_SCRIPTS = ibus
+
+CLEANFILES = \
+ $(NULL)
+
+EXTRA_DIST = \
+ ibus.in \
+ $(NULL)
+
diff --git a/launcher/ibus.in b/launcher/ibus.in
new file mode 100644
index 0000000..82c1ac4
--- /dev/null
+++ b/launcher/ibus.in
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+#
+# ibus - The Input Bus
+#
+# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+# Boston, MA 02111-1307 USA
+import os
+import sys
+import time
+
+daemon = "@prefix@/libexec/ibus-daemon"
+panel = "@prefix@/libexec/ibus-panel"
+
+pid = os.fork ()
+if pid > 0: # parent
+ print "start ibus-daemon"
+ os.execv (daemon, [daemon])
+ print >> sys.stderr, "start ibus-daemon failed"
+ sys.exit (1)
+elif pid == 0:
+ time.sleep (1)
+ print "start ibus-panel"
+ os.execv (panel, [panel])
+ print >> sys.stderr, "start ibus-panel failed"
+ sys.exit (1)
+else:
+ print >> sys.stderr, "can not start ibus"
+ sys.exit (1)
diff --git a/xinput-ibus b/xinput-ibus
index 3ee149a..33ea5fe 100644
--- a/xinput-ibus
+++ b/xinput-ibus
@@ -1,5 +1,5 @@
XIM=IBus
-XIM_PROGRAM=/usr/libexec/ibus-daemon
+XIM_PROGRAM=/usr/bin/ibus
XIM_ARGS=""
PREFERENCE_PROGRAM=/usr/bin/ibus-setup
SHORT_DESC="IBus"