%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
%{expand: %%global _includedir %{_includedir}/gdbm}

Summary: A GNU set of database routines which use extensible hashing.
Summary(ja): 拡張可能なハッシングを利用した GNU データベースルーチン
Name: gdbm1_8
Version: 1.8.0
Release: 25%{?_dist_release}
Source: ftp://ftp.gnu.org/gnu/gdbm-%{version}.tar.gz
Patch0: gdbm-1.8.0-jbj.patch
Patch1: gdbm-1.8.0-fhs.patch
Patch2: gdbm-1.8.0-cflags.patch
Patch3: gdbm-1.8.0-64offset.patch
Patch4: gdbm-1.8.0-config.sub.patch
License: GPL
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libtool
Obsoletes: gdbm < 1.9.0
Obsoletes: gdbm-devel < 1.9.0
Provides: gdbm = %{version}-%{release}

Vendor: Project Vine
Distribution: Vine Linux

%description
Gdbm is a GNU database indexing library, including routines which use
extensible hashing.  Gdbm works in a similar way to standard UNIX dbm
routines.  Gdbm is useful for developers who write C applications and
need access to a simple and efficient database or who are building C
applications which will use such a database.

If you're a C developer and your programs need access to simple
database routines, you should install gdbm.  You'll also need to
install gdbm-devel.

%description -l ja
gdbm は，拡張可能なハッシングを利用したルーチンが含まれた
GNU データベースインデックスライブラリです．gdbm は標準的な
UNIX の dbm ルーチンと同様に機能します．C アプリケーションを
開発する際に簡単で効率的なデータベースへのアクセスが必要になった時，
この gdbm は非常に便利です．

あなたが C プログラマで，プログラムに簡単なデータベースルーチンへの
アクセスが必要になった場合，gdbm を是非インストールして下さい．
その際 gdbm-devel パッケージも同時にインストールする必要があります．

%prep
%setup -q -n gdbm-1.8.0
%patch0 -p 1 -b .jbj
%patch1 -p 1 -b .fhs
%patch2 -p 1 -b .cflags
%patch3 -p1 -b .offset
%patch4 -p0 -b .config.sub

%build
libtoolize --force --copy
aclocal
autoheader
autoconf
%configure
# We need to override libdir, which for whatever reason is set to $(prefix)/lib
# instead of the value passed to configure above.
make libdir=%{_libdir}

%install
rm -rf ${RPM_BUILD_ROOT}

%makeinstall install-compat

{ cd ${RPM_BUILD_ROOT}
  ln -sf gdbm/gdbm.h .%{_oldincludedir}/gdbm.h
  ln -sf libgdbm.so.2.0.0 .%{_libdir}/libgdbm.so
  gzip -9nf .%{_infodir}/gdbm*
  rm -f .%{_infodir}/dir
}

rm -f %{buildroot}%{_libdir}/libgdbm.so
rm -f %{buildroot}%{_libdir}/libgdbm.la
rm -f %{buildroot}%{_libdir}/libgdbm.a
rm -f %{buildroot}%{_oldincludedir}/gdbm.h
rm -rf %{buildroot}%{_includedir}/*
rm -f %{buildroot}%{_infodir}/*.info*
rm -f %{buildroot}%{_mandir}/man3/*

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING NEWS README
%{_libdir}/libgdbm.so.*

%clean
rm -rf ${RPM_BUILD_ROOT}

%changelog
* Sun May 12 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.8.0-25
- renamed to "gdbm1_8" for compatibility.

* Sun Dec 29 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.8.0-24
- rebuild with VineSeed environment

* Sun Apr 17 2011 Shu KONNO <owa@bg.wakwak.com> 1.8.0-23
- rebuilt with rpm-4.8.1-3

* Thu Feb 11 2010 Shu KONNO <owa@bg.wakwak.com> 1.8.0-22
- added patch4: gdbm-1.8.0-config.sub.patch (for x86_64)

* Fri Feb  5 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.8.0-21
- rebuilt with new toolchain
- fix Patch1

* Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 1.8.0-20vl5
- applied new versioning policy, spec in utf-8

* Thu Feb 9 2006 NAKAMURA Kenta <kenta@c.csce.kyushu-u.ac.jp> 1.8.0-20vl3
- added compat32-* packages for x86_64 architecture support

* Wed Jan 11 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.0-20vl2
- added BuildRequires: libtool

* Mon Apr 14 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.0-20vl1
- rebuild with new toolchain
- based on Rawhide 1.8.0-20

* Sat Jul 14 2001 <sagami@vinelinux.org>
- 1.8.0-10vl1
- follow up with 1.8.0-10 which has a fix to build against new libtool

* Sun Feb 11 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 1.8.0-5vl1
- based on 1.8.0-5 from Rawhide
- added Japanese summary and description

* Thu Jul 13 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Mon Jun  5 2000 Jeff Johnson <jbj@redhat.com>
- FHS packaging.

* Mon Feb  7 2000 Bill Nottingham <notting@redhat.com>
- handle compressed manpages

* Tue Aug 10 1999 Jeff Johnson <jbj@redhat.com>
- make sure created database header is initialized (#4457).

* Tue Jun  1 1999 Jeff Johnson <jbj@redhat.com>
- update to 1.8.0.
- repackage to include /usr/include/gdbm/*dbm.h compatibility includes.

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 19)

* Thu Dec 17 1998 Cristian Gafton <gafton@redhat.com>
- build against glibc 2.1

* Thu May 07 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Thu Apr 30 1998 Cristian Gafton <gafton@redhat.com>
- gdbm-devel moved to Development/Libraries

* Wed Apr 08 1998 Cristian Gafton <gafton@redhat.com>
- buildroot and built for Manhattan

* Tue Oct 14 1997 Donnie Barnes <djb@redhat.com>
- spec file cleanups

* Thu Jun 12 1997 Erik Troan <ewt@redhat.com>
- built against glibc
