File jtools.spec of Package jtools

#
# spec file for package jtools (Version 1.0)
#
# 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/
#


Name:           jtools
Version:        1.0
Release:        0
Summary:        Ken Lunde's Japanese Code Manipulation Tools
License:        Distributable if kept free
Group:          Productivity/Text/Utilities
URL:            http://www.oreilly.com/people/authors/lunde/j_tools.html
Source0:        jtools.bz2
Patch0:         jtools.suse.patch
Patch1:         jtools.return.patch
Patch2:         jtools.getline.patch
Patch3:         jtools-lseek.patch
Patch4:         jtools-void-main.patch
Provides:       locale(ja)

%description
This is Ken Lunde's suite of Japanese and CJKV code manipulation tools.
It consists of:

- CJKVConv.pl (a cross-locale CJKV code converter)

- jconv, a general-purpose Japanese code conversion tool (JIS,
   Shift-JIS, EUC)

- jcode, a Japanese code inspection tool (JIS, Shift-JIS, EUC) that
   reads the input file and creates an output file containing all of
   the characters within the input file along with their electronic
   codes in octal, decimal, or hexadecimal notation (the default, if
   none specified, is hexadecimal)

- jchar, a generator for various Japanese character sets (JIS,
   Shift-JIS, EUC)

- jgrep, a simplified GREP-like utility that recognizes two-byte
character sequences in Japanese Shift-JIS or EUC code

%prep
%setup -q -n jtools
%patch -P 0 -p1
%patch -P 1
%patch -P 2
%patch -P 3 -p1
%patch -P 4 -p1
head -n 104 jconv.c > README.jconv
head -n 46 jchar.c > README.jchar
head -n 96 jcode.c > README.jcode
head -n 121 jgrep.c > README.jgrep
head -n 10 cjkvconv.pl > README.cjkvconv

%build
CC=gcc
for i in jconv jcode jchar jgrep
do
    ${CC} %{optflags} -o $i $i.c
done

%install
mkdir -p %{buildroot}%{_bindir}
for i in jconv jcode jchar jgrep
do
    install -m755 $i %{buildroot}%{_bindir}/$i
done
install -m755 ./cjkvconv.pl %{buildroot}%{_bindir}/cjkvconv

%files
%doc AUTHOR Copyright README*
%{_bindir}/jconv
%{_bindir}/jcode
%{_bindir}/jchar
%{_bindir}/jgrep
%{_bindir}/cjkvconv

%changelog
openSUSE Build Service is sponsored by