1#
2#  libiodbc.spec
3#
4#  $Id: libiodbc.spec.in,v 1.26 2007/10/08 13:04:32 source Exp $
5#
6#  RPM specification file to build binary distribution set
7#
8#  The iODBC driver manager.
9#
10#  Copyright (C) 1996-2006 by OpenLink Software <iodbc@openlinksw.com>
11#  All Rights Reserved.
12#
13#  This software is released under the terms of either of the following
14#  licenses:
15#
16#      - GNU Library General Public License (see LICENSE.LGPL)
17#      - The BSD License (see LICENSE.BSD).
18#
19#  Note that the only valid version of the LGPL license as far as this
20#  project is concerned is the original GNU Library General Public License
21#  Version 2, dated June 1991.
22#
23#  While not mandated by the BSD license, any patches you make to the
24#  iODBC source code may be contributed back into the iODBC project
25#  at your discretion. Contributions will benefit the Open Source and
26#  Data Access community as a whole. Submissions may be made at:
27#
28#      http://www.iodbc.org
29#
30#
31#  GNU Library Generic Public License Version 2
32#  ============================================
33#  This library is free software; you can redistribute it and/or
34#  modify it under the terms of the GNU Library General Public
35#  License as published by the Free Software Foundation; only
36#  Version 2 of the License dated June 1991.
37#
38#  This library is distributed in the hope that it will be useful,
39#  but WITHOUT ANY WARRANTY; without even the implied warranty of
40#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
41#  Library General Public License for more details.
42#
43#  You should have received a copy of the GNU Library General Public
44#  License along with this library; if not, write to the Free
45#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
46#
47#
48#  The BSD License
49#  ===============
50#  Redistribution and use in source and binary forms, with or without
51#  modification, are permitted provided that the following conditions
52#  are met:
53#
54#  1. Redistributions of source code must retain the above copyright
55#     notice, this list of conditions and the following disclaimer.
56#  2. Redistributions in binary form must reproduce the above copyright
57#     notice, this list of conditions and the following disclaimer in
58#     the documentation and/or other materials provided with the
59#     distribution.
60#  3. Neither the name of OpenLink Software Inc. nor the names of its
61#     contributors may be used to endorse or promote products derived
62#     from this software without specific prior written permission.
63#
64#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
65#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
66#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
67#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR
68#  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
69#  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
70#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
71#  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
72#  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
73#  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
74#  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
75#
76
77
78# ----------------------------------------------------------------------
79# MACROS AND DEFINES
80# ----------------------------------------------------------------------
81
82#  Disable generation of debug package
83%define debug_package %{nil}
84
85
86# ----------------------------------------------------------------------
87# BASE PACKAGE
88# ----------------------------------------------------------------------
89Summary: iODBC Driver Manager
90name: libiodbc
91version: @VERSION@
92release: 1
93Group: Libraries
94Vendor: Ke Jin and OpenLink Software
95Packager: OpenLink Software <iodbc@openlinksw.com>
96License: LGPL or BSD license (see "LICENSE" file included in distribution)
97URL: http://www.iodbc.org/
98Source: http://www.iodbc.org/downloads/iODBC/libiodbc-%{PACKAGE_VERSION}.tar.gz
99Prefix: /usr
100BuildRoot:/var/tmp/build-libiodbc-%{PACKAGE_VERSION}
101
102%description
103The iODBC Driver Manager is a free implementation of the SAG CLI and
104ODBC compliant driver manager which allows developers to write ODBC
105compliant applications that can connect to various databases using
106appropriate backend drivers.
107
108The iODBC Driver Manager was originally created by Ke Jin and is
109currently maintained by OpenLink Software under a LGPL or BSD license
110(see "LICENSE" file included in the distribution).
111
112%package devel
113Summary: header files and libraries for iODBC development
114Group: Development/Libraries
115Requires: libiodbc
116
117%description devel
118The iODBC Driver Manager is a free implementation of the SAG CLI and
119ODBC compliant driver manager which allows developers to write ODBC
120compliant applications that can connect to various databases using
121appropriate backend drivers.
122
123This package contains the header files and libraries needed to develop
124program that use the driver manager.
125
126The iODBC Driver Manager was originally created by Ke Jin and is 
127currently maintained by OpenLink Software under a LGPL or BSD license
128(see "LICENSE" file included in the distribution).
129
130%package admin
131Summary: GTK based administrator for iODBC development
132Group: Development/Libraries
133Requires: libiodbc 
134
135%description admin
136The iODBC Driver Manager is a free implementation of the SAG CLI and
137ODBC compliant driver manager which allows developers to write ODBC
138compliant applications that can connect to various databases using
139appropriate backend drivers.
140
141This package contains a GTK based administrator program for maintaining
142DSN information in odbc.ini and odbcinst.ini files.
143
144The iODBC Driver Manager was originally created by Ke Jin and is
145currently maintained by OpenLink Software under a LGPL or BSD license
146(see "LICENSE" file included in the distribution).
147
148%prep
149%setup
150%build
151./configure --prefix=/usr --mandir=%{_mandir} --enable-odbc3 --with-iodbc-inidir=/etc --enable-pthreads --disable-libodbc
152make
153
154%install
155#
156#  Carefully clean the build tree before use
157#
158[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
159
160#
161#  Make sure we can find the necessary libraries
162#
163LIBRARY_PATH=$RPM_BUILD_ROOT/usr/lib
164export LIBRARY_PATH
165
166#
167#  Install binaries, include files and libraries
168#
169#make install prefix=$RPM_BUILD_ROOT 
170%makeinstall
171
172#
173#  Install the sample odbc.ini and odbcinst.ini files
174#
175mkdir -p $RPM_BUILD_ROOT/etc
176#install -m644 etc/odbc.ini.sample $RPM_BUILD_ROOT/etc/odbc.ini
177#install -m644 etc/odbcinst.ini.sample $RPM_BUILD_ROOT/etc/odbcinst.ini
178
179%clean
180#
181#  Carefully clean the build tree
182#
183[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
184
185%post -p /sbin/ldconfig
186%postun -p /sbin/ldconfig
187
188%files 
189%attr(0755, root, root) /usr/bin/iodbctest
190%attr(0755, root, root) /usr/bin/iodbctestw
191%attr(0755, root, root) /usr/lib/libiodbc.so.*
192%attr(0755, root, root) /usr/lib/libiodbcinst.so.*
193%attr(0644, root, root) %{_mandir}/man1/iodbctest.1*
194%attr(0644, root, root) %{_mandir}/man1/iodbctestw.1*
195#%attr(0644, root, root) %config /etc/odbc.ini
196#%attr(0644, root, root) %config /etc/odbcinst.ini
197
198
199%files devel
200%attr(0644, root, root) %doc AUTHORS 
201%attr(0644, root, root) %doc LICENSE
202%attr(0644, root, root) %doc LICENSE.LGPL
203%attr(0644, root, root) %doc LICENSE.BSD
204%attr(0644, root, root) %doc ChangeLog 
205%attr(0644, root, root) %doc NEWS 
206%attr(0644, root, root) %doc README
207%attr(0644, root, root) %doc README.CVS
208%attr(0644, root, root) %doc etc/odbc.ini.sample
209%attr(0644, root, root) %doc etc/odbcinst.ini.sample
210%attr(0644, root, root) /usr/include/iodbcext.h
211%attr(0644, root, root) /usr/include/iodbcinst.h
212%attr(0644, root, root) /usr/include/iodbcunix.h
213%attr(0644, root, root) /usr/include/isqlext.h
214%attr(0644, root, root) /usr/include/isql.h
215%attr(0644, root, root) /usr/include/isqltypes.h
216%attr(0644, root, root) /usr/include/sql.h
217%attr(0644, root, root) /usr/include/sqltypes.h
218%attr(0644, root, root) /usr/include/sqlucode.h
219%attr(0644, root, root) /usr/include/sqlext.h
220%attr(0644, root, root) /usr/include/odbcinst.h
221%attr(0755, root, root) /usr/bin/iodbc-config
222%attr(0644, root, root) /usr/lib/libiodbc.a
223%attr(0644, root, root) /usr/lib/libiodbc.la
224%attr(0755, root, root) /usr/lib/libiodbc.so
225%attr(0644, root, root) /usr/lib/libiodbcinst.a
226%attr(0644, root, root) /usr/lib/libiodbcinst.la
227%attr(0755, root, root) /usr/lib/libiodbcinst.so
228%attr(0644, root, root) %{_mandir}/man1/iodbc-config.1*
229%attr(0644, root, root) /usr/share/libiodbc/samples/Makefile
230%attr(0644, root, root) /usr/share/libiodbc/samples/iodbctest.c
231%attr(0644, root, root) /usr/lib/pkgconfig/libiodbc.pc
232
233%files admin
234%attr(0755, root, root) /usr/bin/iodbcadm-gtk
235%attr(0644, root, root) /usr/lib/libdrvproxy.a
236%attr(0644, root, root) /usr/lib/libdrvproxy.la
237%attr(0755, root, root) /usr/lib/libdrvproxy.so*
238%attr(0644, root, root) /usr/lib/libiodbcadm.a
239%attr(0644, root, root) /usr/lib/libiodbcadm.la
240%attr(0755, root, root) /usr/lib/libiodbcadm.so*
241%attr(0644, root, root) %{_mandir}/man1/iodbcadm-gtk.1*
242