File canna-yubin.spec of Package canna-yubin

#
# spec file for package canna-yubin
#
# Copyright (c) 2013 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/
#


Name:           canna-yubin
BuildRequires:  canna-devel
BuildRequires:  nkf
BuildRequires:  unzip
PreReq:         /usr/sbin/useradd
%define pkgver 0.0.20011101
Version:        0.0.20011101_20130830dat
Release:        0
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's URL was dead .
Source0:        %{name}_%{pkgver}.tar.bz2
# Source[12] are data files . Added by bkbin005@rinku.zaq.ne.jp .
# Read http://www.post.japanpost.jp/zipcode/dl/readme.html .
# Check http://www.post.japanpost.jp/zipcode/dl/kogaki-zip.html .
Source1:        http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip
# Read http://www.post.japanpost.jp/zipcode/dl/jigyosyo/readme.html .
# Check http://www.post.japanpost.jp/zipcode/dl/jigyosyo/index-zip.html .
Source2:        http://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Postal Code Extension Dictionary for Canna
License:        GPL-2.0+ and SUSE-Public-Domain
Group:          System/I18n/Japanese
# 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 -n %{name}-%{pkgver} -a 1 -a 2
%__mv KEN_ALL.CSV ken_all.csv
%__mv JIGYOSYO.CSV jigyosyo.csv

%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
nkf -Se 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
openSUSE Build Service is sponsored by