Skip to content

Commit

Permalink
Fixed configure option.
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwarat committed Jun 30, 2010
1 parent 54b92ce commit e783f8c
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 26 deletions.
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ SUBDIRS = \
po \
data \
input-pad \
pyinput-pad \
$(NULL)

if HAVE_PYTHON
Expand Down
33 changes: 22 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ if test "x$have_libxklavier" = "xyes" ; then
AC_DEFINE(HAVE_LIBXKLAVIER, [1], [Define if we have libxklavier])
fi

dnl - check eek
AC_MSG_CHECKING([whether you enable libeek])
AC_ARG_ENABLE(eek,
AS_HELP_STRING([--enable-eek=no/yes],
Expand Down Expand Up @@ -158,18 +159,28 @@ AC_SUBST(PYTHON_LIBS)
AC_SUBST(SWIG)

dnl - check XTest module
backup_LIBS=$LIBS
if test "x$XTEST_LIBS" = "x" ; then
XTEST_LIBS="-lXtst"
fi
LIBS="$LIBS $XTEST_LIBS"
AC_MSG_CHECKING([whether you enable xtest module])
AC_ARG_ENABLE(xtest,
AS_HELP_STRING([--enable-xtest=no/yes],
[Send keyboard event with xtest. default=no]),
enable_xtest=yes,
enable_xtest=no)
AC_MSG_RESULT($enable_xtest)
AM_CONDITIONAL(HAVE_XTEST, false)
AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
dnl - Do not put NULL string here so that LIBS is not overrided.
[AC_MSG_NOTICE([use $XTEST_LIBS for XTEST module])
AM_CONDITIONAL(HAVE_XTEST, true)],
[AC_MSG_NOTICE([if you want to enable X11 XTEST module, install libXtst-devel package])])
LIBS=$backup_LIBS

if test x"$enable_xtest" = xyes; then
backup_LIBS=$LIBS
if test "x$XTEST_LIBS" = "x" ; then
XTEST_LIBS="-lXtst"
fi
LIBS="$LIBS $XTEST_LIBS"
AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
dnl - Do not put NULL string here so that LIBS is not overrided.
[AC_MSG_NOTICE([use $XTEST_LIBS for XTEST module])
AM_CONDITIONAL(HAVE_XTEST, true)],
[AC_MSG_NOTICE([if you want to enable X11 XTEST module, install libXtst-devel package])])
LIBS=$backup_LIBS
fi
AC_SUBST(XTEST_LIBS)

dnl - define GETTEXT_* variables
Expand Down
45 changes: 32 additions & 13 deletions input-pad.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
%define libxklavier_version 4.0
%define libxml2_version 2.0

%define libinput_paddir %{_libdir}/%{name}-%sub_version
%define moduledir %{_libdir}/%{name}-%sub_version/modules
%define kbduidir %{_libdir}/%{name}-%sub_version/modules/kbdui
%define xkeysenddir %{_libdir}/%{name}-%sub_version/modules/xkeysend


Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
Expand Down Expand Up @@ -88,8 +94,14 @@ The input-pad-eek package contains eekboard extension module

%build
%configure \
%if ! %have_python_devel
--disable-python \
%endif
%if %have_eek_devel
--enable-eek \
--enable-eek \
%endif
%if %have_xtest_devel
--enable-xtest \
%endif
--disable-static
make %{?_smp_mflags}
Expand All @@ -98,20 +110,27 @@ make %{?_smp_mflags}
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'

if [ ! -d $RPM_BUILD_ROOT%kbduidir ] ; then
mkdir -p $RPM_BUILD_ROOT%kbduidir
fi
if [ ! -d $RPM_BUILD_ROOT%xkeysenddir ] ; then
mkdir -p $RPM_BUILD_ROOT%xkeysenddir
fi

rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
%if %have_xtest_devel
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}-%sub_version/modules/xkeysend/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}-%sub_version/modules/xkeysend/*.a
rm -f $RPM_BUILD_ROOT%xkeysenddir/*.la
rm -f $RPM_BUILD_ROOT%xkeysenddir/*.a
%endif
%if %have_eek_devel
rm -f $RPM_BUILD_ROOT%kbduidir/*.la
rm -f $RPM_BUILD_ROOT%kbduidir/*.a
%endif
%if %have_python_devel
rm -f $RPM_BUILD_ROOT%python_sitearch/%{name}-%sub_version/*.la
rm -f $RPM_BUILD_ROOT%python_sitearch/%{name}-%sub_version/*.a
%endif
%if %have_eek_devel
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}-%sub_version/modules/kbdui/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}-%sub_version/modules/kbdui/*.a
%endif

%find_lang %{name}

Expand All @@ -126,10 +145,10 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%doc AUTHORS COPYING README
%{_bindir}/input-pad
%dir %{_libdir}/%{name}-%sub_version
%dir %{_libdir}/%{name}-%sub_version/modules
%dir %{_libdir}/%{name}-%sub_version/modules/xkeysend
%dir %{_libdir}/%{name}-%sub_version/modules/kbdui
%dir %libinput_paddir
%dir %moduledir
%dir %xkeysenddir
%dir %kbduidir
%{_libdir}/libinput-pad.so.*
%{_datadir}/%name
%{_datadir}/pixmaps/input-pad.png
Expand All @@ -150,13 +169,13 @@ rm -rf $RPM_BUILD_ROOT
%if %have_xtest_devel
%files xtest
%defattr(-,root,root,-)
%{_libdir}/%{name}-%sub_version/modules/xkeysend/libinput-pad-xtest-gdk.so
%xkeysenddir/libinput-pad-xtest-gdk.so
%endif

%if %have_eek_devel
%files eek
%defattr(-,root,root,-)
%{_libdir}/%{name}-%sub_version/modules/kbdui/libinput-pad-eek-gtk.so
%kbduidir/libinput-pad-eek-gtk.so
%endif

%changelog
Expand Down
3 changes: 2 additions & 1 deletion pyinput-pad/test_input_pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ def button_pressed_cb(window, str, type, keysym, keycode, state, data):
print "data =", data

print "input-pad version:", get_version()
print "available kbdui modules:", get_kbdui_name_list()
window = InputPadWindow()
# InputPadWindow() calls setlocale()
print "available kbdui modules:", get_kbdui_name_list()
window.new()
if len(sys.argv) > 1:
if os.path.isdir(sys.argv[1]):
Expand Down

0 comments on commit e783f8c

Please sign in to comment.