%define	ver	1.4.17
%define	libdirver	1.4.0

%define gtk2_immoduledir %{_libdir}/gtk-2.0/2.10.0/immodules
%define gtk3_immoduledir %{_libdir}/gtk-3.0/3.0.0/immodules

Summary: Smart Common Input Method platform
Name: scim
Version: %{ver}
Release: 1%{?_dist_release}
URL: http://www.scim-im.org/
License: LGPL
Group: System Environment/Libraries

Vendor: Project Vine
Distribution: Vine Linux

Source0:   http://dl.sourceforge.net/sourceforge/scim/%{name}-%{version}.tar.gz
Source2:   scim-icons-0.7.tar.gz
Source5:   scim-1.4.7_translation-update.tar.bz2

# vine patch
Patch100: %{name}-1.4.17-vine.patch

BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: glib2-devel >= 2.10.0 gtk2-devel >= 2.8.13  pango-devel >= 1.0.0
BuildRequires: gtk3-devel
BuildRequires: GConf2-devel >= 2.0.0 pkgconfig >= 0.12
BuildRequires: libXt-devel
BuildRequires: autoconf automake gettext libtool
BuildRequires: libtool-ltdl-devel
BuildRequires: desktop-file-utils
Requires(post): gtk2 >= 2.8.13


%description
Smart Common Input Method platform, in short SCIM, is a development
platform to make Input Method developer life easier. It honors a
very clear architecture and provides a pretty simple and powerful
programming interface.

%description -l ja
SCIM ( Smart Common Input Method プラットフォーム ) はインプット
メソッドの開発をより簡単にする開発プラットフォームです。
SCIM は、明快なアーキテクチャを持ち、とても簡潔でパワフルな
プログラミングインタフェースを提供します。

%package devel
Summary: Development tools for SCIM applications.
Summary(ja): SCIM を使ったアプリケーションを開発するためのファイル
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig >= 0.12

%description devel
scim-devel package contains the header files and static libraries to
develop a SCIM applications.

%description devel -l ja
scim-devel パッケージには、SCIM アプリケーションの開発に必要な
ヘッダーファイルと静的ライブラリが含まれています。

%prep
%setup -q -a2

cp -p scim-icons/icons/*.png data/icons
cp -p scim-icons/pixmaps/*.png data/pixmaps

%patch100 -p1 -b .vine

%build
autoreconf -vfi
intltoolize --force
%configure --disable-static
%{__make} %{?_smp_mflags}

%install
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}
%{__make} DESTDIR=%{buildroot} install-strip
%{find_lang} %{name}

# remove unpackaged files
find ${RPM_BUILD_ROOT} -name '*.la' -exec rm \{\} \;

# install desktop file
desktop-file-install --delete-original  \
        --dir ${RPM_BUILD_ROOT}%{_datadir}/applications   \
        --add-category X-GNOME-PersonalSettings \
        ${RPM_BUILD_ROOT}%{_datadir}/applications/scim-setup.desktop

desktop-file-install --delete-original  \
        --dir ${RPM_BUILD_ROOT}%{_datadir}/control-center-2.0/capplets   \
        --add-category X-GNOME-PersonalSettings \
        ${RPM_BUILD_ROOT}%{_datadir}/control-center-2.0/capplets/scim-setup.desktop

%clean
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}

%post
/sbin/ldconfig
%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/%{_arch}/gtk.immodules 2>/dev/null ||:
%{_bindir}/gtk-query-immodules-3.0 > %{_libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null ||:

%postun
/sbin/ldconfig
%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/%{_arch}/gtk.immodules 2>/dev/null ||:
%{_bindir}/gtk-query-immodules-3.0 > %{_libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null ||:


%files -f %{name}.lang
%defattr(-,root,root)
%license COPYING
%doc AUTHORS ChangeLog NEWS README THANKS TODO
%{_bindir}/scim
%{_bindir}/scim-config-agent
%{_bindir}/scim-im-agent
%{_bindir}/scim-setup
%{_libdir}/libscim-1.0.so.*
%{_libdir}/libscim-gtkutils-1.0.so.*
%{_libdir}/libscim-x11utils-1.0.so.*
%gtk2_immoduledir/im-scim.so
%gtk3_immoduledir/im-scim.so
%dir %{_libdir}/scim-1.0
%{_libdir}/scim-1.0/scim-helper-launcher
%{_libdir}/scim-1.0/scim-helper-manager
%{_libdir}/scim-1.0/scim-launcher
%{_libdir}/scim-1.0/scim-panel-gtk
%dir %{_libdir}/scim-1.0/%{libdirver}
%dir %{_libdir}/scim-1.0/%{libdirver}/Config
%{_libdir}/scim-1.0/%{libdirver}/Config/*.so
%dir %{_libdir}/scim-1.0/%{libdirver}/Filter
%{_libdir}/scim-1.0/%{libdirver}/Filter/*.so
%dir %{_libdir}/scim-1.0/%{libdirver}/FrontEnd
%{_libdir}/scim-1.0/%{libdirver}/FrontEnd/*.so
%dir %{_libdir}/scim-1.0/%{libdirver}/Helper
%{_libdir}/scim-1.0/%{libdirver}/Helper/*.so
%dir %{_libdir}/scim-1.0/%{libdirver}/IMEngine
%{_libdir}/scim-1.0/%{libdirver}/IMEngine/*.so
%dir %{_libdir}/scim-1.0/%{libdirver}/SetupUI
%{_libdir}/scim-1.0/%{libdirver}/SetupUI/*.so
%{_datadir}/applications/scim-setup.desktop
%{_datadir}/control-center-2.0/capplets/scim-setup.desktop
%{_datadir}/pixmaps/scim-setup.png
%{_datadir}/scim
%config(noreplace) %{_sysconfdir}/scim/config
%config(noreplace) %{_sysconfdir}/scim/global
%dir %{_sysconfdir}/scim

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

%changelog
* Thu Jul  7 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.4.17-1
- new upstream release.
- dropped Source5: upstream is newer than it.
- dropped all imported patches: fixed in upstream.
- updated Patch100.
- added BR: gtk3-devel.

* Mon Dec 30 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.9-9
- rebuild with VineSeed environment

* Sat Oct 16 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.9-8
- added BuildRequires: desktop-file-utils [see VineSeed:22000]

* Tue Sep 28 2010 Shu KONNO <owa@bg.wakwak.com> 1.4.9-7
- rebuilt with rpm-4.8.1 for pkg-config

* Sat Jul 10 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.9-6
- added Pacth34 from Mandriva to fix disapppear tray icon
  - This patch upstream is Ubuntu https://bugs.launchpad.net/ubuntu/+source/scim/+bug/475800

* Sun Feb 21 2010 Shu KONNO <owa@bg.wakwak.com> 1.4.9-5
- rebuilt with new toolchain

* Tue Aug 11 2009 Shu KONNO <owa@bg.wakwak.com> 1.4.9-4
- add BR: libtool-ltdl-devel

* Sun Aug 09 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.4.9-3
- add Categories=X-GNOME-PersonalSettings for .desktop

* Thu Apr 23 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.9-2
- fixed changelog typo in Apr 19
- added Buildrequires: autoconf automake gettext libtool

* Sun Apr 19 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.9-1
- new upstream release
- spec in UTF-8
 -added Pacth32,33 (import from fedora package)
- changed autoreconf option

* Sun Apr 5 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.8-2
- updated vine patch
  - enabled "/Panel/Gtk/LookupTableVertinal = True" again

* Sun Feb 8 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4.8-1
- new upstream release
- removed patch12,patch24 (because these patches are merged)
- added patch31 (for support more utf8-locales)
- updated and renamed vine patch
  - deleted "/Panel/Gtk/LookupTableVertinal = True" (because already "True")
  - renamed scim-1.4.8-vine.patch

* Wed Oct 29 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.7-6
- import more patches from fedora package.
- disable static libs
- remove unpackaged files

* Sat Oct 25 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.7-5
- remove *.la

* Sat Sep 27 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.7-4
- rebuild with gtk-2.14
- import patch1[245], Patch2[01235678] from fedora package to fix
  several problems.

* Fri May 09 2008 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.7-3
- rebuild with xorg-x11-7.3

* Thu Apr 17 2008 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 1.4.7-2
- rebuilt with glib2-devel-2.16.3-1vl5 (without *.la files)

* Sat Apr 05 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.4.7-1
- apply new versioning policy.

* Wed Sep 26 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.4.7-0vl1
- new upstream release
- add %%{_libdir}/scim-1.0/%%{libdirver}/Filter/*.la.

* Thu May 10 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.6-0vl2
- rebuild with libstdc++34

* Tue Apr 24 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.6-0vl1
- new upstream release

* Fri Nov 24 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.5-0vl1
- new upstream release

* Sun Sep 03 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.4-0vl2
- update vine patch
  - set /Panel/Gtk/LookupTableVertinal = True

* Tue Apr 04 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.4-0vl1
- new upstream release
- change Group: to System Environment/Libraries
- change Url: to current scim homepage.
- add Patch100 for Vine Linux default settings
  - add Zenkaku_Hankaku, Alt+Kanji, Alt+grave and Shift+space as Trigger
- fix %%post/%%postun to support biarch.
- add PreReq: gtk2 >= 2.8.13 to support biarch.

* Wed Aug 17 2005 IWAI, Masaharu <iwai@alib.jp> 1.4.2-0vl1
- new upstream release

* Fri Aug 12 2005 IWAI, Masaharu <iwai@alib.jp> 1.4.1-0vl1
- new upstream release

* Sun Jul 31 2005 IWAI, Masaharu <iwai@alib.jp> 1.4.0-0vl1
- new upstream releases
- stop runnging gconftool-2 in post script

* Fri May 27 2005 IWAI, Masaharu <iwai@alib.jp> 1.2.3-0vl1
- new upstream release

* Thu May 26 2005 IWAI, Masaharu <iwai@alib.jp> 1.2.2-0vl1
- new upstream release
- update library directory varsion: 1.2.0
- add %%{_libdir}/scim-1.0/scim-helper-{launcher,manager}
- add New Setup Module: Helper
- drop %%{_bindir}/scim-make-table
- drop %%{_sysconfdir}/gconf/schemas/*

* Fri Dec 31 2004 IWAI, Masaharu <iwai@alib.jp> 1.0.2-0vl1
- new upstream release

* Fri Oct 22 2004 IWAI, Masaharu <iwai@alib.jp> 1.0.1-0vl2
- add Japanese descriptions

* Sat Oct  9 2004 IWAI, Masaharu <iwai@alib.jp> 1.0.1-0vl1
- new upstream release
- add new config files: config and global

* Wed Sep  8 2004 IWAI, Masaharu <iwai@alib.jp> 1.0.0-0vl1
- initial build

