File canna-yubin.spec of Package canna-yubin

#
# spec file for package canna-yubin (Version 0.0.20011101)
#
# Copyright (c) 2009 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:           canna-yubin
BuildRequires:  canna-devel
License:        GPL v2 or later; Public Domain, Freeware
Group:          System/I18n/Japanese
PreReq:         /usr/sbin/useradd
AutoReqProv:    on
Version:        0.0.20011101
Release:        544
Url:            http://www8.plala.or.jp/ykomatsu/software/canna-yubin.html
# Original source: http://homepage1.nifty.com/ykomatsu/canna-yubin/canna-yubin_0.0.20011101.tar.gz
Source0:        http://homepage1.nifty.com/ykomatsu/canna-yubin/canna-yubin_0.0.20011101.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Postal Code Extension Dictionary for Canna
# Summary(ja): 郵便番号データのCanna用の辞書
# %description -l ja
# 郵便番号データのCanna用の辞書
# 
# 著者:
# ------
#     Japanese Ministry of Posts and Telecommunications
#     Yoshito Komatsu <yoshito.komatsu@nifty.com>

%description
A postal code extension dictionary for Canna.



Authors:
--------
    Japanese Ministry of Posts and Telecommunications
    Yoshito Komatsu <yoshito.komatsu@nifty.com>

%prep
%setup0

%build
%define canna_dir /var/lib/canna
%define canna_dic_dir /var/lib/canna/dic
%define canna_system_dic_dir %{canna_dic_dir}/canna
%define canna_user_dic_dir %{canna_dic_dir}/user
%define canna_root_dic_dir %{canna_user_dic_dir}/root
./yu2can.pl > yubin7.ctd.tmp
iconv -f SHIFT-JIS -t EUC-JP yubin7.ctd.tmp > yubin7.ctd
# make binary dictionaries:
mkbindic -m yubin7.ctd

%install
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
mkdir -p $RPM_BUILD_ROOT%{canna_system_dic_dir}
install -m 644 yubin7.cbd yubin7.cld $RPM_BUILD_ROOT%{canna_system_dic_dir}

%pre
/usr/sbin/useradd -r -o -g bin -u 66 -s /bin/false -c "Wnn System Account" -d /var/lib/wnn wnn 2> /dev/null || :

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

%files -n canna-yubin
%defattr(-, root, root)
%doc README* debian/README* debian/copyright
%dir %{canna_dir}/
%dir %attr(-, wnn, root) %{canna_dic_dir}/
%dir %attr(-, wnn, root) %{canna_system_dic_dir}/
%attr(-, wnn, root) %{canna_system_dic_dir}/*

%changelog
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Sat Jan 10 2004 adrian@suse.de
- build as user
* Fri Sep 19 2003 mfabian@suse.de
- add user "wnn" in %%pre and add "Prereq: /usr/sbin/useradd"
* Wed Sep 17 2003 mfabian@suse.de
- Bugzilla #31220: fix permissions and ownerships to agree
  with the main canna package.
* Fri Jun 13 2003 mfabian@suse.de
- fix "directory is not owned by any package".
* Sun Aug 11 2002 mfabian@suse.de
- update to version 0.0.20011101
- change # neededforbuild:
  canna -> canna canna-devel canna-libs
* Sat Sep 08 2001 mfabian@suse.de
- new package: canna-yubin, version 0.0.20010601