wime-3.2.0-1kkr2009.0.spec

%define name       wime
%define version    3.2.0
%define release    %mkrel 1

%define winelibdir %{_prefix}/lib/wine
%define wimedir    %{_datadir}/%{name}


Summary:        Tool to use Win32 IME as Canna
Summary(ja):    Win32 IMEをかんなとして使用するためのツール
Name:           %{name}
Version:        %{version}
Release:        %{release}
Source:         http://www.venus.sannet.ne.jp/thomas/wime/%{name}-%{version}.tar.bz2
  # Size  : 82,717
  # MD5   : 196568d3cc8f92ce323d0f0978d6e17b
  # SHA-1 : a6dbd0d40fb7776b75da5d053aca257de07cb171
URL:            http://www.venus.sannet.ne.jp/thomas/wime/
License:        LGPLv2.1+
Group:          System/Internationalization
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires:       wine >= 1.1.16 libx11 gtk2
BuildRequires:  wine-devel >= 1.1.16 canna-devel libx11-devel gtk2-devel
%ifarch x86_64
# require xlib for x86_32
Requires:       libx11_6
# conflict?
# need to create synlink [/usr/lib/libX11.so -> /usr/lib/libX11.so.6] manually
#BuildRequires:  libx11_6-devel
%endif
ExclusiveArch:  i586 x86_64


%description
wime is a program which allows using Win32 IME as Canna on GNU/Linux.

%description -l ja
wimeはGNU/Linux上でWin32 IMEをかんなとして使用することを可能にするプログラムです。


%prep
%setup -q
%{__sed} -i 's:-L../dll:-L../so:' exe/Makefile
%{__sed} -i \
	-e 's:\(immoddir=\):\1%{buildroot}/:' \
	-e 's:$(INSTALL) $(app) $(immoddir):$(INSTALL) -D {,$(immoddir)/}$(app):'  gim/Makefile


%build
CFLAGS="-std=gnu99 -Wno-multichar -fgnu89-inline -fPIC %{optflags}"
export CFLAGS
%make -C lib WINEINCDIR=%{_includedir}/wine
%make -C so WINEINCDIR=%{_includedir}/wine
%ifarch x86_64
%{__cp} -a so{,64}
%endif
%make -C gim GTKPC=gtk+-2.0 GTKLOCALEDIR=%{_prefix}/share/locale
%make -C wimectrl
%make -C xim
%make -C so clean
%{__rm} lib/*.[oa]
for dir in lib so dll exe hinshi-list; do
	%make -C ${dir} CFLAGS="${CFLAGS} -m32" LDFLAGS="-m32" WINEINCDIR=%{_includedir}/wine
done


%install
%{__rm} %{buildroot} -fr
# fix wime to copy "hinshi" file automatically (first time)
sed -i 's:\(#!/bin/sh\):\1\n\n[ -d ~/.wime ] || ( mkdir ~/.wime \&\& cp %{_datadir}/wime/hinshi ~/.wime/)\n:' exe/wime
%{__install} -d %{buildroot}/{%{_bindir},%{winelibdir},%{wimedir}}
%{__install} -p -m 644 *.reg hinshi %{buildroot}/%{wimedir}/
for f in patch/*; do
	%{__install} -D -p -m 644 ${f} %{buildroot}/%{wimedir}/${f}.patch
done
%makeinstall PREFIX=%{buildroot}/%{_prefix} WINELIBDIR=%{buildroot}/%{winelibdir}
%ifarch x86_64
%{__install} -D -m 755 {so64/,%{buildroot}/%{_libdir}/}libwime.so
%endif
%{__lzma} Changelog Readme


%post
%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/gtk.immodules.%{_lib}


%postun
%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/gtk.immodules.%{_lib}


%clean
%{__rm} %{buildroot} -fr


%files
%defattr(-, root, root)
%{_bindir}/*
%{_prefix}/lib/libwime.so
%ifarch x86_64
%{_prefix}/lib64/libwime.so
%endif
%{winelibdir}/wime.dll.so
%{wimedir}/
%{_libdir}/gtk-2.0/*/*/im-wime.so
%doc Changelog* Readme*


%changelog
* Wed Aug 05 2009 kakurasan <kakurasan AT gmail DOT com> 3.2.0-1kkr2009.0
- new version

* Wed Jul 29 2009 kakurasan <kakurasan AT gmail DOT com> 3.1.4-1kkr2009.0
- new version
- fix BuildRequires

* Fri Mar 13 2009 kakurasan <kakurasan AT gmail DOT com> 2.1.0-1kkr2009.0
- new version
- BuildRequires: require Wine >= 1.1.16

* Fri Feb 20 2009 kakurasan <kakurasan AT gmail DOT com> 2.0.1-1kkr2009.0
- new version

* Fri Feb 20 2009 kakurasan <kakurasan AT gmail DOT com> 1.8.5-2kkr2009.0
- require Wine 1.1.15 (winegcc problem is fixed in this version)

* Thu Dec 18 2008 kakurasan <kakurasan AT gmail DOT com> 1.8.5-1kkr2009.0
- initial build