File hk_classes.spec of Package hk_classes

#
# spec file for package hk_classes (Version 0.8.3)
#
# Copyright (c) 2009 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:           hk_classes
# skip-check-libtool-deps
BuildRequires:  doxygen graphviz krb5-devel libjpeg-devel mysql-devel pkgconfig
BuildRequires:  postgresql-devel python-devel qt3-devel sqlite3-devel
BuildRequires:  libxml2-devel unixODBC-devel update-desktop-files libtool
BuildRequires:  file-devel
BuildRequires:  libdrm-devel
Url:            http://www.knoda.org
License:        LGPL v2.1 or later
Group:          Productivity/Databases/Tools
Summary:        Database Interface Library and Classes
Version:        0.8.3
Release:        175
Source0:        hk_classes-%{version}.tar.bz2
Source1:        Doxyfile
Patch1:         fix_python_install.patch
Patch2:         external-sqlite.diff
Patch3:         strict-aliasing.diff
Patch4:         fix-return-value.diff
Patch5:         fix-libtool.diff
Patch6:         hk_classes-0.8.3-gcc43.diff
Patch7:         acinclude.diff
Patch8:         fix-strncpy-buffer-overflow.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%py_requires

%description
The hk_classes are a set of nonvisual routines that allow you to
develop database front-end applications as easily as possible. You also
need a database driver to run applications. This package contains a
driver for MySQL, PostrgeSQL, and ODBC, which will be automatically
installed if configure finds a working database installation on your
computer.

Optionally, you can use graphical front-end libraries (for example:
hk_kdeclasses from the knoda package) to write intermediate X Window
System database applications in just a few lines.

%package devel
License:        LGPL v2.1 or later
Summary:        Include Files and Libraries mandatory for Development
PreReq:         /bin/sh
Group:          Development/Libraries/C and C++
Requires:       qt3-devel file-devel

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.

%prep
%setup -q -n %name-%version
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8

sed -i 1i\ '#include <unistd.h>' hk_dbaseclasses/xbase/xblock.cpp
sed -i 1i\ '#include <unistd.h>' hk_dbaseclasses/xbase/xbdbf.cpp

%build
# make sure we use the system copy
rm -rf hk_sqlite{,3}classes/sqlite
libtoolize --force
aclocal
autoheader
automake --add-missing
autoconf
export HK_CLASSESDIR=%_libdir/hk_classes
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS -DNDEBUG"
export CFLAGS="$RPM_OPT_FLAGS"
#export LDFLAGS="-L%{_libdir}/mysql"
./configure \
  --prefix=$HK_CLASSESDIR \
  --mandir=%_mandir \
  --libdir=%_libdir \
  --with-pythondir=%_prefix 
make -j1 -k

%install
export HK_CLASSESDIR=%_libdir/hk_classes
make DESTDIR=$RPM_BUILD_ROOT install
#ln -sf hk_classes/libhk_classes.so.15 $RPM_BUILD_ROOT%_libdir/libhk_classes.so.15
KDEDOCDIR=/usr/share/doc/KDE3-API
doxygen %SOURCE1
mkdir -p ${RPM_BUILD_ROOT}${KDEDOCDIR}
mv apidocs ${RPM_BUILD_ROOT}${KDEDOCDIR}/hk_classes
echo "Database connection classes"\
       > ${RPM_BUILD_ROOT}${KDEDOCDIR}/hk_classes/description.SuSE
echo "hk_classes"                 \
       > ${RPM_BUILD_ROOT}${KDEDOCDIR}/hk_classes/package.SuSE

%post devel
if test -x opt/kde3/share/apps/kdelibs/create-kdeapi; then
   opt/kde3/share/apps/kdelibs/create-kdeapi
fi

%postun devel
if test -x opt/kde3/share/apps/kdelibs/create-kdeapi; then
   opt/kde3/share/apps/kdelibs/create-kdeapi
fi

%files
%defattr(-,root,root)
%doc NEWS README AUTHORS ChangeLog COPYING 
%dir %_libdir/hk_classes
%_libdir/hk_classes/bin
%_libdir/hk_classes/drivers
%_libdir/hk_classes/lib*
%{_libdir}/python%py_ver/site-packages/_hk_classes.so
%{_libdir}/python%py_ver/site-packages/hk_classes*py*

%files devel 
%defattr(-,root,root)
%_libdir/hk_classes/include
%{_mandir}/*/*
%doc /usr/share/doc/KDE3-API

%changelog
openSUSE Build Service is sponsored by