File tokyocabinet.spec of Package tokyocabinet

# vim: set ts=4 sw=4 et:
#
# spec file for package tokyocabinet
#
# 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:           tokyocabinet
Version:        1.4.48
Release:        0
%define soname 9
Summary:        Modern Implementation of DBM - CLI Utilities
License:        LGPL-2.1+
Group:          Productivity/Databases/Tools
Url:            http://fallabs.com/tokyocabinet/

Source:         http://fallabs.com/tokyocabinet/%name-%version.tar.gz
Patch1:         tokyocabinet-fix_library_paths.patch
Patch2:         tokyocabinet-remove-minlinestringops.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} >= 1030
BuildRequires:  libbz2-devel
%endif
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc
BuildRequires:  glibc-devel
BuildRequires:  libtool
BuildRequires:  make
BuildRequires:  pkgconfig
BuildRequires:  zlib-devel
Provides:       tokyocabinet-tools = %{version}-%{release}
Provides:       tokyocabinet-utils = %{version}-%{release}

%description
Tokyo Cabinet is a library of routines for managing a database. The database
is a simple data file containing records, each is a pair of a key and a
value. Every key and value is serial bytes with variable length. Both binary
data and character string can be used as a key and a value. There is neither
concept of data tables nor data types. Records are organized in hash table, B+
tree, or fixed-length array.

Tokyo Cabinet is developed as the successor of GDBM and QDBM on the following
purposes. They are achieved and Tokyo Cabinet replaces conventional DBM
products.

Features:
* improves space efficiency: smaller size of database file.
* improves time efficiency: faster processing speed.
* improves parallelism: higher performance in multi-thread environment.
* improves usability: simplified API.
* improves robustness: database file is not corrupted even under catastrophic
  situation.
* supports 64-bit architecture: enormous memory space and database file are
  available.

This package contains the command-line utilities to manage Tokyocabinet
database files.


%package -n libtokyocabinet-devel
Summary:        Development Environment for the tokyocabinet Library
Group:          Development/Languages/C and C++
Requires:       libtokyocabinet%{soname} = %{version}-%{release}
Provides:       libtokyocabinet%{soname}-devel = %{version}-%{release}

%description -n libtokyocabinet-devel
This package contains the development environment (headers, shared
library symlink, pkg-config file, ...) for libtokyocabinet%{soname}

%package -n libtokyocabinet%{soname}
Summary:        Modern Implementation of DBM - Shared Library
Group:          System/Libraries
Provides:       libtokyocabinet = %{version}-%{release}

%description -n libtokyocabinet%{soname}
Tokyo Cabinet is a library of routines for managing a database. The database
is a simple data file containing records, each is a pair of a key and a
value. Every key and value is serial bytes with variable length. Both binary
data and character string can be used as a key and a value. There is neither
concept of data tables nor data types. Records are organized in hash table, B+
tree, or fixed-length array.

Tokyo Cabinet is developed as the successor of GDBM and QDBM on the following
purposes. They are achieved and Tokyo Cabinet replaces conventional DBM
products.

Features:
* improves space efficiency: smaller size of database file.
* improves time efficiency: faster processing speed.
* improves parallelism: higher performance in multi-thread environment.
* improves usability: simplified API.
* improves robustness: database file is not corrupted even under catastrophic
  situation.
* supports 64-bit architecture: enormous memory space and database file are
  available.

%package cgi
Summary:        Modern Implementation of DBM - CGI Frontend
Group:          Productivity/Networking/Web/Utilities
Requires:       libtokyocabinet%{soname} = %{version}-%{release}

%description cgi
This package contains a CGI frontend for Tokyocabinet
database files.

%package testsuite
Summary:        Modern Implementation of DBM - Test Suite
Group:          Productivity/Networking/Web/Utilities
Requires:       %{name} = %{version}-%{release}

%description testsuite
This package contains the test suite of Tokyocabinet.

%prep
%setup -q
%patch1 -p0
%patch2 -p1

%build
autoreconf -iv

# don't use %configure because it sets
# CFLAGS and CXXFLAGS, which breaks the build
# by overriding required compiler flags in
# the generated makefile
unset CFLAGS
unset CPPFLAGS
OPTFLAGS="%{optflags}" \
./configure \
    			--host="%{_host}" \
    			--build="%{_build}" \
    			--target="%{_target_platform}" \
    			--prefix="%{_prefix}" \
    			--libdir="%{_libdir}" \
    			--datadir="%{_datadir}" \
    			--mandir="%{_mandir}" \
    			--sysconfdir="%{_sysconfdir}" \
    			--libexecdir="%{_libexecdir}" \
    			--enable-fastest \
    		  	--enable-off64

make %{?_smp_mflags}

%install
b="%buildroot";
make install DESTDIR="$b";
mkdir -p "$b/%_docdir/%name";
mv "$b/%_datadir/%name/doc"/* "$b/%_docdir/%name/";
mv "$b/%_datadir/%name"/{COPYING,ChangeLog} "$b/%_docdir/%name/";

#%__rm -rf "%{buildroot}%{_datadir}/tokyocabinet"
rm -f "%buildroot/%_libdir"/*.a

%check
%__make check

%post   -n libtokyocabinet%{soname} -p /sbin/ldconfig

%postun -n libtokyocabinet%{soname} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%{_bindir}/tcamgr
%{_bindir}/tcbmgr
%{_bindir}/tcfmgr
%{_bindir}/tchmgr
%{_bindir}/tctmgr
%{_bindir}/tcucodec
%doc %{_mandir}/man1/tcamgr.1%{ext_man}
%doc %{_mandir}/man1/tcbmgr.1%{ext_man}
%doc %{_mandir}/man1/tcfmgr.1%{ext_man}
%doc %{_mandir}/man1/tchmgr.1%{ext_man}
%doc %{_mandir}/man1/tctmgr.1%{ext_man}
%doc %{_mandir}/man1/tcucodec.1%{ext_man}
%_datadir/%name
%_docdir/%name

%files -n libtokyocabinet-devel
%defattr(-,root,root)
%{_includedir}/tcadb.h
%{_includedir}/tcbdb.h
%{_includedir}/tctdb.h
%{_includedir}/tcfdb.h
%{_includedir}/tchdb.h
%{_includedir}/tcutil.h
%{_libdir}/libtokyocabinet.so
%{_libdir}/pkgconfig/tokyocabinet.pc
%doc %{_mandir}/man3/*.3%{ext_man}

%files cgi
%defattr(-,root,root)
%{_libexecdir}/tcawmgr.cgi

%files -n libtokyocabinet%{soname}
%defattr(-,root,root)
%doc ChangeLog COPYING
%{_libdir}/libtokyocabinet.so.%{soname}
%{_libdir}/libtokyocabinet.so.%{soname}.*.*

%files testsuite
%defattr(-,root,root)
%{_bindir}/tcatest
%{_bindir}/tcbmttest
%{_bindir}/tcbtest
%{_bindir}/tcfmttest
%{_bindir}/tcftest
%{_bindir}/tchmttest
%{_bindir}/tchtest
%{_bindir}/tctmttest
%{_bindir}/tcttest
%{_bindir}/tcumttest
%{_bindir}/tcutest
%{_bindir}/tcamttest
%doc %{_mandir}/man1/tcatest.1%{ext_man}
%doc %{_mandir}/man1/tcbmttest.1%{ext_man}
%doc %{_mandir}/man1/tcbtest.1%{ext_man}
%doc %{_mandir}/man1/tcfmttest.1%{ext_man}
%doc %{_mandir}/man1/tcftest.1%{ext_man}
%doc %{_mandir}/man1/tchmttest.1%{ext_man}
%doc %{_mandir}/man1/tchtest.1%{ext_man}
%doc %{_mandir}/man1/tctmttest.1%{ext_man}
%doc %{_mandir}/man1/tcttest.1%{ext_man}
%doc %{_mandir}/man1/tcutest.1%{ext_man}
%doc %{_mandir}/man1/tcumttest.1%{ext_man}
%doc %{_mandir}/man1/tcamttest.1%{ext_man}

%changelog
openSUSE Build Service is sponsored by