Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 8da5903c5889cfed4484b50f15484869 > files > 4

sdb-0.6.0-3mdk.src.rpm

%define name	sdb
%define version	0.6.0
%define release	3mdk

%define major	0
%define libname %mklibname %{name} %{major}

Summary:	Simple database library
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	GPL
Group:		System/Libraries
URL:		http://siag.nu/libsdb/
Source0:	http://siag.nu/pub/libsdb/%{name}-%{version}.tar.bz2
Patch0:		sdb-0.6.0-no_ms.diff.bz2
Patch1:		sdb-0.6.0-postgres.diff.bz2
BuildRequires:	MySQL-devel
BuildRequires:	gdbm-devel
BuildRequires:	libtool
BuildRequires:	openssl-devel
BuildRequires:	postgresql-devel
BuildRequires:	sqlite-devel
BuildRequires:	unixODBC-devel
BuildRequires:	zlib-devel
%if %mdkversion >= 1020
BuildRequires:	multiarch-utils >= 1.0.3
%endif
BuildRoot:	%{_tmppath}/%{name}-buildroot

%description
This is libsdb, the simple database library, which provides a way 
to support multiple database management systems in an application 
with negligeable overhead, in terms of code as well as system 
resources. It is mainly intended for use on Unix, but the ODBC 
driver works on Windows as well. 

%package -n	%{libname}
Summary:	Libraries for %{name}
Group:		System/Libraries

%description -n	%{libname}
This package contains libraries necessary for %{name}.

%package -n	%{libname}-devel
Summary:	Development header files and libraries for %{name}
Group:		Development/C
Requires:	%{libname} = %{version}
Requires:	MySQL-devel
Requires:	gdbm-devel
Requires:	openssl-devel
Requires:	postgresql-devel
Requires:	sqlite-devel
Requires:	unixODBC-devel
Requires:	zlib-devel
Provides:	%{name}-devel lib%{name}-devel
Obsoletes:	%{name}-devel lib%{name}-devel

%description -n	%{libname}-devel
This package contains the development header files and libraries
for %{name}.

%prep

%setup -q
%patch0 -p0
%patch1 -p0

perl -pi -e "s|/usr/local/|%{_prefix}/|g" configure
perl -pi -e "s|/lib |%{_lib} |g" configure

%build

# the author dropped automake !!!
# ulric blev lite lack på automake tror jag...

./configure \
    --with-gdbm \
    --with-mysql \
    --with-postgres \
    --with-odbc=odbc \
    --with-sqlite

perl -pi -e "s|/sbin/ldconfig|#/sbin/ldconfig|g" Makefile

%make CFLAGS="%{optflags} -fPIC "\
    PREFIX=%{_prefix} \
    BINDIR=%{_bindir} \
    LIBDIR=%{_libdir} \
    MANDIR=%{_mandir} \
    INCDIR=%{_includedir}

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_libdir}
install -d %{buildroot}%{_mandir}
install -d %{buildroot}%{_includedir}

make \
    PREFIX=%{buildroot}%{_prefix} \
    BINDIR=%{buildroot}%{_bindir} \
    LIBDIR=%{buildroot}%{_libdir} \
    MANDIR=%{buildroot}%{_mandir} \
    INCDIR=%{buildroot}%{_includedir} \
    install

%if %mdkversion >= 1020
%multiarch_binaries %{buildroot}%{_bindir}/sdb-config
%endif

# remove invalid manpages
rm -f %{buildroot}%{_mandir}/man3/sdb_*

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files -n %{name}
%defattr(-,root,root)
%doc AUTHORS COPYING* ChangeLog INSTALL README*
%{_bindir}/sdb_client
%{_bindir}/sdbd
%{_bindir}/sdbd_client
%{_mandir}/man3/sdb.3*
%{_mandir}/man8/sdbd.8*

%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/*.so.*

%files -n %{libname}-devel
%defattr(-,root,root)
%if %mdkversion >= 1020
%multiarch %{multiarch_bindir}/sdb-config
%endif
%{_bindir}/sdb-config
%{_libdir}/*.a
%{_libdir}/*.so
%{_includedir}/*.h

%changelog
* Wed Jan 26 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 0.6.0-3mdk
- really fix conditional %%multiarch :)

* Tue Jan 25 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 0.6.0-2mdk
- fix deps and conditional %%multiarch

* Tue Jan 25 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 0.6.0-1mdk
- 0.6.0
- fix patches, build and spec file
- rebuilt against MySQL-4.1.x system libs

* Fri Dec 31 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.5.5-3mdk
- revert latest "lib64 fixes"

* Tue Dec 28 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.5.5-2mdk
- lib64 fixes

* Sun Jun 13 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.5.5-1mdk
- 0.5.5
- rebuilt against new deps and with gcc v3.4.x
- merge the static devel sub package into the devel sub package
- added sqlite support
- make it compile (P1)
- fix deps

* Fri Apr 23 2004 Guillaume Cottenceau <gc@mandrakesoft.com> 0.5.4-1mdk
- new version (0.5.3 is an addition by myself, yo - adds support for
  persistent connections in the postgres driver)

* Thu Jul 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.5.1-5mdk
- rebuild

* Wed Jun 04 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.5.1-4mdk
- make it provide
- use the %%configure2_5x macro

* Sat May 03 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.5.1-3mdk
- fix wierdness on 9.0...

* Sun Apr 13 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.5.1-2mdk
- fix typo in requires (duh!)

* Sun Apr 13 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.5.1-1mdk
- initial cooker contrib