%define pkg_name dbskkd-cdb
%define pkg_version 2.00
%define pkg_release 7%{?_dist_release}

%define cdb_ver 0.78

Summary:     A dictionary server for the SKK Japanese input method system
Summary(ja): SKK 日本語入力メソッドの辞書サーバ
Name:        %{pkg_name}
Version:     %{pkg_version}
Release:     %{pkg_release}

License: GPL
Group:   Applications/System
URL:     http://www.ne.jp/asahi/bdx/info/software/jp-dbskkd.html

Source0: https://github.com/jj1bdx/dbskkd-cdb/archive/%{name}-%{version}_IMPORTED_FROM_SVN.tar.gz
Source1: http://www.corpit.ru/mjt/tinycdb/tinycdb-%{cdb_ver}.tar.gz
Source2: dbskkd-cdb.xinetd
Patch1:  dbskkd-cdb-2.00.c.patch
Patch2:  dbskkd-cdb-2.00.makefile.patch

Requires: skkdic-cdb
Requires: xinetd

BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Provides: skkserv

Vendor: Project Vine
Distribution: Vine Linux
Packager: ara_t


%description
dbskkd-cdb is a dictionary server for the SKK Japanese input method
system.  dbskkd-cdb is based on the code of skkserv (the original SKK
server) 3.9.3, using the cdb constant database package of
D. J. Bernstein (DJB) for faster dictionary access.

#Add an entry for dbskkd-cdb to /etc/hosts.allow when using with tcp_wrappers.
#ex. dbskkd-cdb: 127.0.0.1

%description -l ja
dbskkd-cdbは、skkservと同様の機能を提供する
SKK用の共通辞書サーバーである。
辞書は D. J. Bernsteinのcdbを使ってデータベース化し、
検索を高速化している。
本サーバーは同種のツールpskkservを基にしている。


%prep
%setup -q -n %{name}-%{version}_IMPORTED_FROM_SVN -q -a 1
%patch1 -p1
%patch2 -p1

%{__rm} -rf ${RPM_BUILD_ROOT}

%build
%{__make} -C tinycdb-%{cdb_ver}
%{__make} CDBLIB="-Ltinycdb-%{cdb_ver} -lcdb"

%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__mkdir_p} ${RPM_BUILD_ROOT}%{_sbindir}
%{__mkdir_p} ${RPM_BUILD_ROOT}/etc/xinetd.d/

%{__install} -m0755 dbskkd-cdb ${RPM_BUILD_ROOT}%{_prefix}/sbin
%{__install} -m0644 %{SOURCE2} ${RPM_BUILD_ROOT}/etc/xinetd.d/dbskkd-cdb

%clean
%{__rm} -rf $RPM_BUILD_ROOT


%files
%defattr(-, root, root)
%config(noreplace) /etc/xinetd.d/dbskkd-cdb
%doc CHANGES LICENSE README READMEJP
%{_sbindir}/
%config


%changelog
* Fri Apr 29 2016 Toshiaki Ara <ara_t@384.jp> 2.00-7
- delete BuildRequires: skkdic
- add Requires: skkdic-cdb

* Sun Apr 10 2016 Toshiaki Ara <ara_t@384.jp> 2.00-6
- rebuild with skkdic-2016410
- add Packager tag

* Sat Mar 12 2016 Toshiaki Ara <ara_t@384.jp> 2.00-5
- rebuild with skkdic-20160306

* Mon Dec 28 2015 Toshiaki Ara <ara_t@384.jp> 2.00-4
- rebuild with skkdic-20151227

* Tue Nov 17 2015 Toshiaki Ara <ara_t@384.jp> 2.00-3
- rebuild with skkdic-20151115
- add Requires: xinetd

* Thu Sep 24 2015 Toshiaki Ara <ara_t@384.jp> 2.00-2
- rebuild with skkdic-20150920

* Thu Jul 09 2015 Toshiaki Ara <ara_t@384.jp> 2.00-1
- update 2.00

* Sat Jun 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.01-20
- rebuild with Vine6 environment

* Sat Aug 29 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.01-19
- spec in utf-8, new versioning policy

* Wed Jan 30 2008 Shu KONNO <owa@bg.wakwak.com> 1.01-18vl2
- s/Copyright/License/

* Sun May 25 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org>
- modified for VineLinux

* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Mon Nov 25 2002 Jens Petersen <petersen@redhat.com> 1.01-17
- improve service description in xinetd config file (#77711)

* Mon Jun 24 2002 Jens Petersen <petersen@redhat.com> 1.01-16
- don't install dbskkd-cdb stripped

* Fri Jun 21 2002 Tim Powers <timp@redhat.com> 1.01-15
- automated rebuild

* Thu May 23 2002 Tim Powers <timp@redhat.com> 1.01-14
- automated rebuild

* Mon Feb 25 2002 Jens Petersen <petersen@redhat.com> 1.01-13
- rebuild in new environment

* Thu Feb 21 2002 Jens Petersen <petersen@redhat.com> 1.01-12
- generate and include SKK-JISYO.L.cdb (formerly in skkdic)
- silence depend files warnings while building freecdb with -include
- no longer include skktocdbm.sh in docs

* Wed Jan 30 2002 Jens Petersen <petersen@redhat.com> 1.01-11
- tidy spec
- freecdb-0.62 included for build, so no longer buildrequires freecdb
- build it first and link with it 

* Wed Jan 09 2002 Tim Powers <timp@redhat.com> 1.01-10
- automated rebuild

* Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com> 1.01-9
- Bump release + rebuild.

* Wed Feb 28 2001 SATO Satoru <ssato@redhat.com>
- add /etc/xinetd.d/dbskkd-cdb

* Wed Feb 28 2001 Bill Nottingham <notting@redhat.com>
- remove %post, just put it in the default /etc/services (#29759)

* Tue Jan 23 2001 Karsten Hopp <karsten@redhat.de>
- change Conflicts: skkserv to Obsoletes: skkserv

* Mon Jan 22 2001 SATO Satoru <ssato@redhat.com>
- fix category

* Mon Jan 21 2001 SATO Satoru <ssato@redhat.com>
- remove some macros
- remove the dictionary
- clean up upstream sources
- clean up SPEC

* Mon Dec 18 2000 SATO Satoru <ssato@redhat.com>
- use system macros 

* Mon Aug  4 2000 SATO Satoru <ssato@redhat.com>
- Initial release
