wime-1.8.5-2kkr2009.0.spec

%define name           wime
%define version        1.8.5
%define release        %mkrel 2

%define libcanna       %mklibname    canna 1
%define libcanna_devel %mklibname -d canna 1

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

%define __find         /bin/find


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  : 39,291
  # MD5   : 60263f0334f0a65de650a31890c32988
  # SHA-1 : 89d85037e293b0d30616bedb1cca74eda07c6edf
Patch:          %{name}-1.8.3-build.patch
  # Size  : 2,208
  # MD5   : 603666f5d5fb232004f430ab427ef4e5
  # SHA-1 : 256218a5dba3788494570c9fc7f9eb94f3378f65
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.15 %{libcanna}
BuildRequires:  libwine-devel >= 1.1.15 %{libcanna_devel}
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
%patch -p1
%{__sed} -i \
	-e 's:\(export PREFIX?=\)/usr/local:\1%{buildroot}/%{_prefix}:' \
	-e 's:\(export WINELIBDIR?=\)/usr/local/lib/wine:\1%{buildroot}/%{winelibdir}:' \
	-e 's:\(export CFLAGS?=-g -Wall\):\1 %{optflags}:' Makefile


%build
# %{optflags} causes crash on i586
CFLAGS="-std=gnu99 -Wno-multichar -fgnu89-inline -fPIC"
%ifarch x86_64
CFLAGS="${CFLAGS} %{optflags}"
%endif
export CFLAGS
%make -j1


%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
%makeinstall
%{__install} -d %{buildroot}/%{wimedir}
%{__install} -p -m 644 *.reg hinshi %{buildroot}/%{wimedir}/
%{__lzma} Changelog Readme


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


%files
%defattr(-, root, root)
%{_bindir}/*
%{_prefix}/lib/libwime.so
%{winelibdir}/libwime.dll.so
%{wimedir}/
%doc Changelog* Readme*


%changelog
* 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