File cppdb.spec of Package cppdb
#
# spec file for package cppdb
#
# Copyright (c) 2011 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: cppdb
%define sover 0
Version: 0.3.1
Release: 0
License: MIT ; BSL-1.0
Summary: Database-independent SQL connectivity library
Url: http://cppcms.com/sql/cppdb/
Group: Development/Libraries/C and C++
Source: http://downloads.sf.net/cppcms/%name-%version.tar.bz2
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libmysqlclient-devel
BuildRequires: postgresql-devel
BuildRequires: unixODBC-devel
BuildRequires: pkgconfig(sqlite3)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
CppDB is an SQL connectivity library that is designed to provide
platform and Database independent connectivity API similarly to what
JDBC, ODBC and other connectivity libraries do.
%package devel
Summary: Development files for cppdb
Group: Development/Libraries/C and C++
Requires: libcppdb%sover = %version
# The rest are plugins, no Requires needed.
%description devel
CppDB is an SQL connectivity library that is designed to provide
platform and Database independent connectivity API similarly to what
JDBC, ODBC and other connectivity libraries do.
This package contains the development files (headers, link-time
file references) for cppdb.
%package -n libcppdb%sover
Summary: Database-independent SQL connectivity library
Group: System/Libraries
%description -n libcppdb%sover
CppDB is an SQL connectivity library that is designed to provide
platform and Database independent connectivity API similarly to what
JDBC, ODBC and other connectivity libraries do.
%package -n libcppdb_mysql%sover
Summary: MySQL database connector for the cppdb library
Group: System/Libraries
%description -n libcppdb_mysql%sover
CppDB is an SQL connectivity library that is designed to provide
platform and Database independent connectivity API similarly to what
JDBC, ODBC and other connectivity libraries do.
This package contains the MySQL database connector.
%package -n libcppdb_odbc%sover
Summary: unixODBC database connector for the cppdb library
Group: System/Libraries
%description -n libcppdb_odbc%sover
CppDB is an SQL connectivity library that is designed to provide
platform and Database independent connectivity API similarly to what
JDBC, ODBC and other connectivity libraries do.
This package contains the unixODBC database connector.
%package -n libcppdb_postgresql%sover
Summary: PostgreSQL database connector for the cppdb library
Group: System/Libraries
%description -n libcppdb_postgresql%sover
CppDB is an SQL connectivity library that is designed to provide
platform and Database independent connectivity API similarly to what
JDBC, ODBC and other connectivity libraries do.
This package contains the PostgreSQL database connector.
%package -n libcppdb_sqlite3-%sover
Summary: SQLite3 database connector for the cppdb library
Group: System/Libraries
%description -n libcppdb_sqlite3-%sover
CppDB is an SQL connectivity library that is designed to provide
platform and Database independent connectivity API similarly to what
JDBC, ODBC and other connectivity libraries do.
This package contains the SQLite3 database connector.
%package doc
Summary: HTML documentation for CppDB
Group: Documentation/HTML
BuildArch: noarch
%description doc
CppDB is an SQL connectivity library that is designed to provide
platform and Database independent connectivity API similarly to what
JDBC, ODBC and other connectivity libraries do.
This package contains HTML documentation.
%prep
%setup -q
%build
export CFLAGS="%optflags"
export CXXFLAGS="%optflags"
cmake -DCMAKE_INSTALL_PREFIX="%_prefix" -DLIBDIR="%_libdir" \
-DODBC_BACKEND_INTERNAL="OFF";
make %{?_smp_mflags};
%install
b="%buildroot";
make install DESTDIR="$b"
rm -f "$b/%_libdir"/*.a "$b/%_libdir"/libcppdb_*.so
rm html/installdox
mkdir -p "$b/%_docdir/%name";
cp -a html examples "$b/%_docdir/%name/";
%fdupes -s %buildroot/%_docdir/%name
%post -n libcppdb%sover -p /sbin/ldconfig
%post -n libcppdb_mysql%sover -p /sbin/ldconfig
%post -n libcppdb_odbc%sover -p /sbin/ldconfig
%post -n libcppdb_postgresql%sover -p /sbin/ldconfig
%post -n libcppdb_sqlite3-%sover -p /sbin/ldconfig
%postun -n libcppdb%sover -p /sbin/ldconfig
%postun -n libcppdb_mysql%sover -p /sbin/ldconfig
%postun -n libcppdb_odbc%sover -p /sbin/ldconfig
%postun -n libcppdb_postgresql%sover -p /sbin/ldconfig
%postun -n libcppdb_sqlite3-%sover -p /sbin/ldconfig
%files devel
%defattr(-,root,root)
%doc LICENSE_1_0.txt MIT.txt copyright.txt
%_includedir/cppdb
%_libdir/libcppdb.so
%files -n libcppdb%sover
%defattr(-,root,root)
%_libdir/libcppdb.so.%{sover}*
%files -n libcppdb_mysql%sover
%defattr(-,root,root)
%_libdir/libcppdb_mysql.so.%{sover}*
%files -n libcppdb_odbc%sover
%defattr(-,root,root)
%_libdir/libcppdb_odbc.so.%{sover}*
%files -n libcppdb_postgresql%sover
%defattr(-,root,root)
%_libdir/libcppdb_postgresql.so.%{sover}*
%files -n libcppdb_sqlite3-%sover
%defattr(-,root,root)
%_libdir/libcppdb_sqlite3.so.%{sover}*
%files doc
%defattr(-,root,root)
%_docdir/%name
%changelog