aboutsummaryrefslogtreecommitdiffstats
path: root/rpm-local/spec/libdbi-drivers/libdbi-drivers.spec
blob: 39b4c7f216f7446d23c8e9fdac78809ef41d7f01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#
# spec file for package libdbi-drivers
#
# Copyright (c) 2014 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/
#

%define build_freetds 0

Name:           libdbi-drivers
Version:        0.9.0.g55
Release:        0
Summary:        Database drivers for libdbi
License:        LGPL-2.1+
Group:          Productivity/Databases/Servers
URL:            http://libdbi-drivers.sf.net/

#Source:        http://downloads.sf.net/libdbi-drivers/%name-%version.tar.gz
Source:		%name-%version.tar.xz
Patch1:         configure.ac.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gettext
%if %build_freetds
BuildRequires:  freetds-devel
%endif
BuildRequires:  libdbi-devel >= 0.9.0.g30
BuildRequires:  libtool
BuildRequires:  mysql-devel
BuildRequires:  openjade
BuildRequires:  postgresql-devel
BuildRequires:  sqlite3-devel
BuildRequires:  xz
%define build_doc 0
%if %build_doc
# Only needed when doc is not already prebuilt
BuildRequires:  docbook-dsssl-stylesheets
BuildRequires:  openjade
BuildRequires:  texlive-collection-fontsrecommended
BuildRequires:  texlive-jadetex
BuildRequires:  texlive-pdftex-bin
%endif

%description
libdbi implements a database-independent abstraction layer in C,
similar to the DBI/DBD layer in Perl. Drivers are distributed
separately from the library itself.

%if %build_freetds
%package dbd-freetds
Summary:        FreeTDS driver for libdbi
Group:          System/Libraries

%description dbd-freetds
This driver provides connectivity to FreeTDS database servers
through the libdbi database independent abstraction layer. Switching
a program's driver does not require recompilation or rewriting source
code.
%endif

%package dbd-mysql
Summary:        MySQL driver for libdbi
Group:          System/Libraries

%description dbd-mysql
This driver provides connectivity to MySQL database servers through
the libdbi database independent abstraction layer. Switching a
program's driver does not require recompilation or rewriting source
code.

%package dbd-pgsql
Summary:        PostgreSQL driver for libdbi
Group:          System/Libraries

%description dbd-pgsql
This driver provides connectivity to PostgreSQL database servers
through the libdbi database independent abstraction layer. Switching
a program's driver does not require recompilation or rewriting source
code.

%package dbd-sqlite3
Summary:        SQLite3 driver for libdbi
Group:          System/Libraries

%description dbd-sqlite3
This driver provides connectivity to SQLite 3.x database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.

%prep
%setup -q
%if 0%{?suse_version} == 1110
%patch -P 1 -p1
%endif
chmod a-x COPYING

# Fake the __DATE__ so we do not needelessly rebuild
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %_sourcedir/%name.changes '+%%b %%e %%Y')
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" drivers/*/*.c

%build
if [ ! -e configure ]; then
	autoreconf -fi
fi
export CFLAGS="%optflags -O0 -ggdb3"
%configure		\
%if %build_freetds
	--with-freetds				\
%endif
	--with-mysql 				\
	--with-pgsql 				\
	--with-sqlite3				\
	--with-dbi-incdir="%_includedir/dbi"	\
	--with-dbi-libdir="%_libdir"		\
	--disable-static			\
	--docdir="%_docdir/%name" --disable-docs
make %{?_smp_mflags}

%install
make install DESTDIR="%buildroot"
find "%buildroot" -type f -name "*.la" -delete

%check
make check || :

%if %build_freetds
%files dbd-freetds
%defattr(-,root,root)
%doc COPYING
%dir %_libdir/dbd
%_libdir/dbd/libdbdfreetds.so
%endif

%files dbd-mysql
%defattr(-,root,root)
%doc COPYING
%dir %_libdir/dbd
%_libdir/dbd/libdbdmysql.so

%files dbd-pgsql
%defattr(-,root,root)
%doc COPYING
%dir %_libdir/dbd
%_libdir/dbd/libdbdpgsql.so

%files dbd-sqlite3
%defattr(-,root,root)
%doc COPYING
%dir %_libdir/dbd
%_libdir/dbd/libdbdsqlite3.so

%changelog