File scim-bridge.spec of Package scim-bridge

#
# spec file for package scim-bridge
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           scim-bridge
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  doxygen
BuildRequires:  gtk2-devel
BuildRequires:  libqt4-devel
BuildRequires:  libtool
BuildRequires:  qt3-devel
BuildRequires:  scim-devel
Summary:        Scim Bridge
License:        LGPL-2.1+
Group:          System/I18n/Japanese
Version:        0.4.16
Release:        0
PreReq:         /usr/bin/touch
Provides:       locale(scim:ja;ko)
Recommends:     scim-bridge-gtk,scim-bridge-qt
Url:            http://www.scim-im.org/
# CVS repository:
# cvs -d:pserver:anonymous@scim.cvs.sourceforge.net:/cvsroot/scim login 
# cvs -z3 -d:pserver:anonymous@scim.cvs.sourceforge.net:/cvsroot/scim co scim-bridge
Source0:        scim-bridge-%{version}.tar.bz2
Source1:        baselibs.conf
Source10:       etc-x11-xim.d-scim-bridge
Source11:       etc-x11-xim.d-scim-bridge-114
Patch3:         bug-351920-should-return-retval.patch
Patch8:         scim-bridge-0.4.15-gcc44.patch
Patch9:         scim-bridge-fix-vnc-display-check.diff
Patch10:        scim-bridge-reregister-type-module-if-reload.patch
Patch11:        scim-bridge-gcc47.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define gtk_prefix %(pkg-config --variable=prefix gtk+-2.0)

%description
Scim Bridge



Authors:
--------
    Ryo Dairiki <ryo-dairiki@users.sourceforge.net>

%package -n scim-bridge-gtk
Summary:        Scim Bridge for gtk2
Group:          System/I18n/Japanese
Requires:       %{name} = %{version}
Provides:       locale(gtk2:ja;ko;zh)
%gtk2_immodule_requires

%description -n scim-bridge-gtk
Scim Bridge for gtk2



Authors:
--------
    Ryo Dairiki <ryo-dairiki@users.sourceforge.net>

%package -n scim-bridge-qt
Summary:        Scim Bridge for Qt
Group:          System/I18n/Japanese
Requires:       %{name} = %{version}
Provides:       locale(qt3:ja;ko;zh)

%description -n scim-bridge-qt
Scim Bridge for Qt



Authors:
--------
    Ryo Dairiki <ryo-dairiki@users.sourceforge.net>

%prep
%define qt4_plugindir %_libdir/qt4/plugins
%setup -q -n %{name}-%{version}
%patch3 -p1
%patch8
%patch9 -p1
%patch10 -p1
%patch11 -p1

find . -type f | xargs chmod u+w
#find . -name CVS -type d | xargs rm -r
find . -name .cvsignore -type f | xargs rm -f
#chmod 644 doc/icon/kasasagi.png
# hack to build with older distros
%if %suse_version < 1100
sed -i -e'/supplements/d' $RPM_SOURCE_DIR/baselibs.conf
%endif

%build

./bootstrap

libtoolize --force -c --automake

export CFLAGS="$RPM_OPT_FLAGS"
%configure --disable-static --with-pic --enable-gtk2-immodule --enable-qt3-immodule --enable-qt4-immodule --enable-documents

%{__make} %{?jobs:-j%jobs}

%install
make DESTDIR=${RPM_BUILD_ROOT} install
rm -f $RPM_BUILD_ROOT/%{gtk_prefix}/%{_lib}/gtk-2.0/immodules/im-scim-bridge.*a
pushd $RPM_BUILD_ROOT/usr/lib/qt3/plugins/inputmethods/
    if [ %_lib = lib64 ]; then
	mv im-scim-bridge.so im-scim-bridge.lib64.so
	mv im-scim-bridge.la im-scim-bridge.lib64.la
    else
    	:
    fi
popd
rm -f $RPM_BUILD_ROOT/usr/lib/qt3/plugins/inputmethods/im-scim-bridge.*a
mkdir -p $RPM_BUILD_ROOT/%qt4_plugindir/inputmethods
mv $RPM_BUILD_ROOT/usr/plugins/inputmethods/im-scim-bridge* $RPM_BUILD_ROOT/%qt4_plugindir/inputmethods
pushd $RPM_BUILD_ROOT/%qt4_plugindir/inputmethods
    if [ %_lib = lib64 ]; then
	mv im-scim-bridge.so im-scim-bridge.lib64.so
	mv im-scim-bridge.la im-scim-bridge.lib64.la
    else
    	:
    fi
popd
rm -f $RPM_BUILD_ROOT/%qt4_plugindir/inputmethods/im-scim-bridge.*a
mkdir -p $RPM_BUILD_ROOT/etc/X11/xim.d/
%if %suse_version < 1210
install -m 644 $RPM_SOURCE_DIR/etc-x11-xim.d-scim-bridge-114 \
               $RPM_BUILD_ROOT/etc/X11/xim.d/scim-bridge
%else
install -m 644 $RPM_SOURCE_DIR/etc-x11-xim.d-scim-bridge \
               $RPM_BUILD_ROOT/etc/X11/xim.d/scim-bridge
%endif
# install symlinks in /etc/X11/xim.d/$lang for all languages
# where scim-bridge might be useful:
PRIORITY=49
pushd $RPM_BUILD_ROOT/etc/X11/xim.d/
    for lang in am ar as bn el fa gu he hi hr ja ka kk kn ko lo ml my \
		pa ru sk vi zh_TW zh_CN zh_HK zh_SG \
		de fr it es nl cs pl da nn nb fi en sv
    do
        mkdir $lang
	pushd $lang
            ln -s ../scim-bridge $PRIORITY-scim-bridge
	popd
    done
popd

rm doc/Makefile*

%post -n scim-bridge-gtk
%gtk2_immodule_post

%postun -n scim-bridge-gtk
%gtk2_immodule_postun

%files
%defattr(-, root, root)
%doc AUTHORS COPYING NEWS README ChangeLog INSTALL doc
%dir /etc/X11/xim.d/
/etc/X11/xim.d/*
/usr/bin/scim-bridge

%files -n scim-bridge-gtk
%defattr(-, root, root)
%{gtk_prefix}/%{_lib}/gtk-2.0/immodules/im-scim-bridge.so

%files -n scim-bridge-qt
%defattr(-, root, root)
%dir /usr/lib/qt3/
%dir /usr/lib/qt3/plugins/
%dir /usr/lib/qt3/plugins/inputmethods/
/usr/lib/qt3/plugins/inputmethods/im-scim-bridge*.so
%dir %qt4_plugindir/
%dir %qt4_plugindir/inputmethods/
%qt4_plugindir/inputmethods/im-scim-bridge*.so

%changelog