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 http://bugs.opensuse.org/
#

# 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
%endif
#
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
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
# Source0:      http://freedesktop.org/~suzhe/sources/scim-0.99.7.tar.bz2
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
%gtk2_immodule_requires

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

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



Authors:
--------
    James Su <suzhe@tsinghua.org.cn>

%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
%endif
#

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



Authors:
--------
    James Su <suzhe@tsinghua.org.cn>

%prep
%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
%endif
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
%endif

%build
%if %suse_version <= 1100
libtoolize --force
autoreconf --force --install --verbose
%endif
if [ ! -f po/Makevars -a -f po/Makevars.template ] ; then
    cp po/Makevars.template po/Makevars
fi
if [ ! -f po/Makevars -a -f /usr/share/gettext/po/Makevars.template ] ; then
    cp  /usr/share/gettext/po/Makevars.template po/Makevars
fi
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%configure\
	--libexecdir=%{_prefix}/lib/scim-1.0\
	--disable-static\
%if ! %{build_config_socket}
	--disable-config-socket\
%endif
%if ! %{build_config_simple}
	--disable-config-simple\
%endif
%if ! %{build_frontend_x11}
	--disable-frontend-x11\
%endif
%if ! %{build_frontend_socket}
	--disable-frontend-socket\
%endif
%if ! %{build_imengine_rawcode}
	--disable-im-rawcode\
%endif
%if ! %{build_imengine_table}
	--disable-im-table\
%endif
%if ! %{build_imengine_socket}
	--disable-im-socket\
%endif
%if ! %{build_gtk2_immodule}
	--disable-gtk2-immodule\
%endif
%if ! %{build_scim_setup}
	--disable-setup-ui\
%endif
	--enable-debug\
	--enable-ld-version-script
make top_builddir=$(pwd)
# build documentation:
make -C docs html
make -C docs/manual/zh_CN html

%install
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 \
               $RPM_BUILD_ROOT/etc/X11/xim.d/scim
# install symlinks in /etc/X11/xim.d/$lang for all languages
# where SCIM might be useful:
PRIORITY=50
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 $PRIORITY-scim
	popd
    done
popd
mkdir -p $RPM_BUILD_ROOT/sbin/conf.d/
install -m 755 $RPM_SOURCE_DIR/SuSEconfig.scim \
               $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.scim
%find_lang scim
%suse_update_desktop_file scim-setup System SystemSetup

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

%post 
/sbin/ldconfig
%if %{build_gtk2_immodule}
%gtk2_immodule_post
%endif

%postun 
/sbin/ldconfig
%if %{build_gtk2_immodule}
%gtk2_immodule_postun
%endif

%files -f scim.lang
%defattr(-, root, root)
%doc AUTHORS COPYING NEWS README ChangeLog TODO
%doc docs/dist/manual/zh_CN
/sbin/conf.d/SuSEconfig.scim
%dir /etc/X11/xim.d/
/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
%{_bindir}/scim
%{_bindir}/scim-config-agent
%{_libdir}/libscim*.so.*
%{_libdir}/scim-1.0/scim-launcher
%{_libdir}/scim-1.0/scim-helper-launcher
%{_libdir}/scim-1.0/scim-helper-manager
%{_datadir}/scim/icons/keyboard.png
%{_datadir}/scim/icons/up.png
%{_datadir}/scim/icons/down.png
%{_datadir}/scim/icons/left.png
%{_datadir}/scim/icons/right.png
%{_datadir}/scim/icons/full-letter.png
%{_datadir}/scim/icons/half-letter.png
%{_datadir}/scim/icons/full-punct.png
%{_datadir}/scim/icons/half-punct.png
%{_datadir}/scim/icons/help.png
%{_datadir}/scim/icons/menu.png
%{_datadir}/scim/icons/pin-up.png
%{_datadir}/scim/icons/pin-down.png
%{_datadir}/scim/icons/setup.png
%{_datadir}/scim/icons/trademark.png
%{_datadir}/scim/icons/sctc-tc-to-sc.png
%{_datadir}/scim/icons/sctc-sc-to-tc.png
%{_datadir}/scim/icons/sctc.png
%{_libdir}/scim-1.0/*/Filter/sctc.so
%{_libdir}/scim-1.0/*/Helper/setup.so
%if %{build_scim_setup}
%{_bindir}/scim-setup
%{_datadir}/applications/scim-setup.desktop
%{_datadir}/control-center-2.0
%dir %{_datadir}/control-center-2.0/capplets/
%{_datadir}/control-center-2.0/capplets/scim-setup.desktop
%{_datadir}/pixmaps/scim-setup.png
%endif
%if %{build_panel_gtk}
%{_libdir}/scim-1.0/scim-panel-gtk
%if %{build_scim_setup}
%{_libdir}/scim-1.0/*/SetupUI/panel-gtk-setup.so
%endif
%endif
%if %{build_frontend_x11}
%{_libdir}/scim-1.0/*/FrontEnd/x11.so
%endif
%if %{build_scim_setup}
%{_libdir}/scim-1.0/*/SetupUI/aaa-frontend-setup.so
%{_libdir}/scim-1.0/*/SetupUI/aaa-imengine-setup.so
%endif
%if %{build_imengine_rawcode}
%{_libdir}/scim-1.0/*/IMEngine/rawcode.so
%{_datadir}/scim/icons/rawcode.png
%endif
%if %{build_config_simple}
%config %{_sysconfdir}/scim/config
%{_libdir}/scim-1.0/*/Config/simple.so
%endif
%if %{build_imengine_socket}
%{_libdir}/scim-1.0/*/IMEngine/socket.so
%endif
%if %{build_frontend_socket}
%{_libdir}/scim-1.0/*/FrontEnd/socket.so
%endif
%if %{build_config_socket}
%{_libdir}/scim-1.0/*/Config/socket.so
%endif
%if %{build_gtk2_immodule}
%dir %{gnome_prefix}/%_lib/gtk-2.0/immodules
%{gnome_prefix}/%_lib/gtk-2.0/immodules/im-scim.so
%endif

%files devel
%defattr(-, root, root)
%doc docs/html
%doc docs/developers
%{_libdir}/libscim*.so
%{_libdir}/lib*.*a
%{_libdir}/pkgconfig/*.pc
%{_includedir}/scim-1.0

%changelog
openSUSE Build Service is sponsored by