Пакет tinycdb: Specfile

Name: tinycdb
Version: 0.77
Release: alt1

Summary: A package for maintenance of constant databases
License: GPLv2+
Group: Databases
Url: http://www.corpit.ru/mjt/tinycdb.html

# http://www.corpit.ru/mjt/tinycdb/tinycdb_%version.tar.gz
Source: tinycdb-%version.tar

Patch1: tinycdb-0.76-alt-makefile.patch
Patch2: tinycdb-0.77-alt-warnings.patch

Requires: libcdb = %version-%release

%def_disable static

%description
tinycdb is a small, fast and reliable utility set and subroutine library
for creating and reading constant databases.  The database structure is
tuned for fast reading:
+ Successful lookups take normally just two disk accesses.
+ Unsuccessful lookups take only one disk access.
+ Small disk space and memory size requirements; a database uses 2048
  bytes for the header and 24 bytes per record.
+ Maximum database size is 4GB; individual record size is not
  otherwise limited.
+ Portable file format.
+ Fast creation of new databases.
+ No locking, updates are atomical.

This package contains the cdb utility.

%package -n libcdb
Summary: The %name shared library 
License: LGPLv2+
Group: System/Libraries

%package -n libcdb-devel
Summary: Development libraries and header files for tinycdb
License: LGPLv2+
Group: Development/C
Requires: libcdb = %version-%release
Provides: %name-devel = %version-%release
Obsoletes: %name-devel

%package -n libcdb-devel-static
Summary: Development static library for tinycdb
License: LGPLv2+
Group: Development/C
Requires: libcdb-devel = %version-%release

%description -n libcdb
tinycdb is a small, fast and reliable utility set and subroutine
library for creating and reading constant databases.

This package contains tinycdb shared library.

%description -n libcdb-devel
tinycdb is a small, fast and reliable utility set and subroutine
library for creating and reading constant databases.

This package contains tinycdb development library and header files.
Required if you plan to do development using the tinycdb database.

%description -n libcdb-devel-static
tinycdb is a small, fast and reliable utility set and subroutine
library for creating and reading constant databases.

This package contains development static library.

%prep
%setup
%patch1 -p1
%patch2 -p1

%build
%def_enable Werror
%make_build CFLAGS="%optflags -W -D_GNU_SOURCE" %{?_enable_static:static} shared

%install
%make_install \
	%{?_enable_static:install-staticlib} \
	install-sharedlib \
	install-bin \
	install-data \
	bindir=%_bindir \
	libdir=%_libdir \
	syslibdir=/%_lib \
	sysconfdir=%_sysconfdir \
	includedir=%_includedir \
	mandir=%_mandir \
	DESTDIR=%buildroot \
	INSTALLPROG=cdb-shared \
	CP='cp -p'

%define docdir %_docdir/%name-%version
mkdir -p %buildroot/%docdir
install -pm644 NEWS %buildroot/%docdir/

%check
make %{?_enable_static:test} test-shared

%files
%_bindir/*
%_mandir/man1/*

%files -n libcdb
%_libdir/libcdb.so.*
%docdir

%files -n libcdb-devel
%_libdir/libcdb.so
%_mandir/man[35]/*
%_includedir/*

%if_enabled static
%files -n libcdb-devel-static
%_libdir/libcdb.a
%endif

%changelog
* Tue Mar 08 2011 Dmitry V. Levin <ldv@altlinux.org> 0.77-alt1
- Updated to 0.77.

* Wed Nov 03 2010 Dmitry V. Levin <ldv@altlinux.org> 0.76-alt4
- Rebuilt for soname set-versions.

* Wed Sep 09 2009 Dmitry V. Levin <ldv@altlinux.org> 0.76-alt3
- Moved "make check" to %%check section.

* Sun Dec 14 2008 Dmitry V. Levin <ldv@altlinux.org> 0.76-alt2
- Removed obsolete %%post_ldconfig/%%postun_ldconfig calls.

* Mon Oct 16 2006 Dmitry V. Levin <ldv@altlinux.org> 0.76-alt1
- Updated to 0.76.
- Reviewed and updated patches.
- Fixed build with -D_FORTIFY_SOURCE=2 -Werror.

* Mon May 22 2006 Dmitry V. Levin <ldv@altlinux.org> 0.75-alt2
- Deal with compilation warnings generated by new gcc compiler.

* Fri Nov 04 2005 Dmitry V. Levin <ldv@altlinux.org> 0.75-alt1
- Updated to 0.75.
- Updated patches.
- Disabled build of static library by default.

* Sat Aug 20 2005 Dmitry V. Levin <ldv@altlinux.org> 0.74-alt2
- Restricted list of global symbols exported by the library.

* Sat Apr 17 2004 Dmitry V. Levin <ldv@altlinux.org> 0.74-alt1
- Updated to 0.74.
- Raised soname to reflect API and ABI changes.
- Fixed typo in cdb(3) manpage.
- Fixed potential null dereference in cdb(1) utility.

* Thu Dec 11 2003 Dmitry V. Levin <ldv@altlinux.org> 0.73-alt3
- Relocated cdb(5) to devel subpackage.
- Build static library without %%optflags_shared.

* Mon Oct 20 2003 Dmitry V. Levin <ldv@altlinux.org> 0.73-alt2
- Build shared library.
- Run tests after build.
- Resplit subpackages: %name, libcdb, libcdb-devel, libcdb-devel-static.

* Mon Sep 08 2003 Victor Forsyuk <force@altlinux.ru> 0.73-alt1
- Initial build for Sisyphus.