File scim.spec of Package scim.import4151

# spec file for package scim
# Copyright (c) 2011 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

# norootforbuild

Name:           scim
BuildRequires:  docbook-xsl-stylesheets doxygen gcc-c++ graphviz gtk2-devel intltool libgnomeui-devel libxslt perl-XML-Parser update-desktop-files
# for older distros
BuildRequires:  libexpat-devel
Summary:        Smart Chinese/Common Input Method platform
Version:        1.4.7
Release:        180.<RELEASE2>
License:        LGPLv2.1+
Group:          System/I18n/Chinese
AutoReqProv:    on
# bug437293
%ifarch ppc64
Obsoletes:      scim-64bit
PreReq:         /usr/bin/touch
Obsoletes:      scim-frontend-x11, scim-server-rawcode, scim-config-simple, scim-server-table, scim-gtk2-immodule, scim-config-socket, scim-server-socket, scim-config-gconf, scim-frontend-socket
Provides:       locale(ja;ko;zh)
Provides:       scim-frontend-x11, scim-server-rawcode, scim-config-simple, scim-server-table, scim-gtk2-immodule, scim-config-socket, scim-server-socket, scim-frontend-socket
# CVS repository:
# cvs login 
# cvs -z3 co scim
# Source0:
Source0:        scim-1.4.7.tar.bz2
Source1:        baselibs.conf
Source10:       etc-x11-xim.d-scim
Source11:       SuSEconfig.scim
Patch0:         scim.patch
Patch1:         configs.patch
Patch248159:    bugzilla-248159-scim-launcher-segfault.patch
Patch2:         scim-gcc4.4-fixes.diff
Patch3:         scim-no-setpwent.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%define gnome_prefix %(pkg-config --variable=prefix libgnomeui-2.0)

SCIM is a developing platform to significantly reduce the difficulty of
input method development.

    James Su <>

%package devel
License:        LGPLv2.1+
Summary:        Include Files and Libraries mandatory for Development.
Group:          System/I18n/Chinese
Requires:       %{name} = %{version}, libstdc++-devel
Requires:       pkgconfig >= 0.12
Requires:       gtk2-devel
Requires:       libexpat-devel
# bug437293
%ifarch ppc64
Obsoletes:      scim-devel-64bit

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.

    James Su <>

%define build_config_socket	1
%define build_config_simple	1
%define build_frontend_x11	1
%define build_frontend_socket	1
%define build_imengine_rawcode	1
%define build_imengine_table	1
%define build_imengine_socket	1
%define build_gtk2_immodule	1
%define build_scim_setup        1
%define build_panel_gtk         1
%define build_gtk_utils         1
%setup -q -n %{name}-%{version}
#%patch0 -p1
%patch1 -p1
%patch248159 -p1
%patch2 -p1
%if %suse_version > 1110
%patch3 -p1
find . -type f | xargs chmod u+w
UTF_8_LOCALES=$(locale -a | grep utf8 | perl -p -e "s/utf8/UTF-8/; s/\n/,/; " | perl -p -e "s/,$//")
perl -pi -e "s/\/SupportedUnicodeLocales =.*/\/SupportedUnicodeLocales = $UTF_8_LOCALES/"  ./configs/global
# hack to build with older distros
%if %suse_version < 1100
sed -i -e'/supplements/d' $RPM_SOURCE_DIR/baselibs.conf

%if %suse_version <= 1100
libtoolize --force
autoreconf --force --install --verbose
if [ ! -f po/Makevars -a -f po/Makevars.template ] ; then
    cp po/Makevars.template po/Makevars
if [ ! -f po/Makevars -a -f /usr/share/gettext/po/Makevars.template ] ; then
    cp  /usr/share/gettext/po/Makevars.template po/Makevars
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%if ! %{build_config_socket}
%if ! %{build_config_simple}
%if ! %{build_frontend_x11}
%if ! %{build_frontend_socket}
%if ! %{build_imengine_rawcode}
%if ! %{build_imengine_table}
%if ! %{build_imengine_socket}
%if ! %{build_gtk2_immodule}
%if ! %{build_scim_setup}
make top_builddir=$(pwd)
# build documentation:
make -C docs html
make -C docs/manual/zh_CN html

make DESTDIR=${RPM_BUILD_ROOT} top_builddir=$(pwd) install
mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}/scim-1.0/{Config,FrontEnd,IMEngine,SetupUI}
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/scim-1.0/*/*/*.*a
rm -f ${RPM_BUILD_ROOT}/%{gnome_prefix}/%_lib/gtk-2.0/immodules/im-scim.*a
# install user manual
mkdir -p docs/dist/manual/zh_CN/figures/
cp -a docs/manual/zh_CN/user-manual.{html,xml} docs/dist/manual/zh_CN/
cp -a docs/manual/zh_CN/figures/*.png docs/dist/manual/zh_CN/figures/
mkdir -p $RPM_BUILD_ROOT/etc/X11/xim.d/
install -m 644 $RPM_SOURCE_DIR/etc-x11-xim.d-scim \
# install symlinks in /etc/X11/xim.d/$lang for all languages
# where SCIM might be useful:
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
        mkdir $lang
	pushd $lang
            ln -s ../scim $PRIORITY-scim
mkdir -p $RPM_BUILD_ROOT/sbin/conf.d/
install -m 755 $RPM_SOURCE_DIR/SuSEconfig.scim \
%find_lang scim
%suse_update_desktop_file scim-setup System SystemSetup

[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;

%if %{build_gtk2_immodule}

%if %{build_gtk2_immodule}

%files -f scim.lang
%defattr(-, root, root)
%doc docs/dist/manual/zh_CN
%dir /etc/X11/xim.d/
%dir %{_sysconfdir}/scim
%dir %{_libdir}/scim-1.0
%dir %{_libdir}/scim-1.0/1.4.0
%dir %{_libdir}/scim-1.0/*/Filter
%dir %{_libdir}/scim-1.0/*/FrontEnd
%dir %{_libdir}/scim-1.0/*/IMEngine
%dir %{_libdir}/scim-1.0/*/Config
%dir %{_libdir}/scim-1.0/*/SetupUI
%dir %{_libdir}/scim-1.0/*/Helper
%dir %{_libdir}/scim-1.0/Config
%dir %{_libdir}/scim-1.0/FrontEnd
%dir %{_libdir}/scim-1.0/IMEngine
%dir %{_libdir}/scim-1.0/SetupUI
%dir %{_datadir}/scim
%dir %{_datadir}/scim/icons
%config %{_sysconfdir}/scim/global
%if %{build_scim_setup}
%dir %{_datadir}/control-center-2.0/capplets/
%if %{build_panel_gtk}
%if %{build_scim_setup}
%if %{build_frontend_x11}
%if %{build_scim_setup}
%if %{build_imengine_rawcode}
%if %{build_config_simple}
%config %{_sysconfdir}/scim/config
%if %{build_imengine_socket}
%if %{build_frontend_socket}
%if %{build_config_socket}
%if %{build_gtk2_immodule}
%dir %{gnome_prefix}/%_lib/gtk-2.0/immodules

%files devel
%defattr(-, root, root)
%doc docs/html
%doc docs/developers

openSUSE Build Service is sponsored by