opendbx/opendbx.spec

201 lines
6.0 KiB
RPMSpec

Name: opendbx
Version: 1.4.6
Release: 1mamba
Summary: An extremely lightweight but extensible database access library
Group: Applications/Databases
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://www.linuxnetworks.de/doc/index.php/OpenDBX
Source: http://linuxnetworks.de/opendbx/download/opendbx-%{version}.tar.gz
Patch0: opendbx-1.4.6-dynamic-exceptions.patch
Patch1: opendbx-1.4.6-freetds-fix.patch
Patch2: opendbx-1.4.6-doxygen-1.9.1.patch
Patch3: opendbx-1.4.6-c99.patch
License: LGPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libfbclient
BuildRequires: libfreetds-devel
BuildRequires: libgcc
BuildRequires: libmariadb-devel
BuildRequires: libncurses-devel
BuildRequires: libpostgresql-devel
BuildRequires: libreadline-devel
BuildRequires: libsqlite-devel
BuildRequires: libstdc++6-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description
OpenDBX is an extremely lightweight but extensible database access library written in C. It provides an abstraction layer to all supported databases with a single, clean and simple interface that leads to an elegant code design automatically.
%package -n lib%{name}
Group: System/Libraries
Summary: Shared libraries for %{name}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}
This package contains shared libraries for %{name}.
%package -n lib%{name}-firebird
Group: System/Libraries
Summary: Firebird plugin for %{name}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}-firebird
This package contains the Firebird plugin for %{name}.
%package -n lib%{name}-mssql
Group: System/Libraries
Summary: MSSql plugin for %{name}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}-mssql
This package contains the MSSql plugin for %{name}.
%package -n lib%{name}-mysql
Group: System/Libraries
Summary: MySQL plugin for %{name}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}-mysql
This package contains the MySql plugin for %{name}.
%package -n lib%{name}-postgresql
Group: System/Libraries
Summary: PostgreSQL plugin for %{name}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}-postgresql
This package contains the PostgreSQL plugin for %{name}.
%package -n lib%{name}-devel
Group: Development/Libraries
Summary: Development files for %{name}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}-devel
This package contains libraries and header files for developing applications that use %{name}.
%package -n lib%{name}-sqlite3
Group: System/Libraries
Summary: SQLite3 plugin for %{name}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}-sqlite3
This package contains the SQLite3 plugin for %{name}.
%package -n lib%{name}-sybase
Group: System/Libraries
Summary: SyBase plugin for %{name}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}-sybase
This package contains the SyBase plugin for %{name}.
%prep
%setup -q
%patch 0 -p1 -b .dynamic-exceptions
%patch 1 -p1 -b .freetds-fix
%patch 2 -p1 -b .doxygen-1.9.1
%patch 3 -p1 -b .c99
# To fix Doxygen parsing issue
ln -s api lib/opendbx/api.dox
# C++ API file must have extension .hpp to be parsed correctly by doxygen
cp lib/opendbx/api lib/opendbx/api.hpp
# regenerate stale libtool files
autoreconf -vfi
# fix hardcoded RPATH issue
sed \
-e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
-i m4/libtool.m4
%build
export CXXFLAGS="-std=c++14 -Wno-error=incompatible-pointer-types -Wno-error=int-conversion %optflags"
export CFLAGS="-Wno-error=incompatible-pointer-types -Wno-error=int-conversion %optflags"
%configure \
--with-backends="mysql pgsql sqlite3 firebird mssql sybase" \
--disable-test \
--disable-static \
CPPFLAGS="-I%{_includedir}/mysql -I%{_includedir}/firebird" \
LDFLAGS="-L%{_libdir}/mysql"
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
%find_lang %{name} --all-name || touch %{name}.lang
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/odbx-sql
%dir %{_datadir}/opendbx
%{_datadir}/opendbx/keywords
%{_mandir}/man1/odbx-sql.1*
%files -n lib%{name}
%defattr(-,root,root)
%{_libdir}/libopendbx.so.*
%{_libdir}/libopendbxplus.so.*
%doc AUTHORS COPYING
%files -n lib%{name}-firebird
%defattr(-,root,root)
%{_libdir}/opendbx/libfirebirdbackend.so
%{_libdir}/opendbx/libfirebirdbackend.so.*
%files -n lib%{name}-mssql
%defattr(-,root,root)
%{_libdir}/opendbx/libmssqlbackend.so
%{_libdir}/opendbx/libmssqlbackend.so.*
%files -n lib%{name}-mysql
%defattr(-,root,root)
%{_libdir}/opendbx/libmysqlbackend.so
%{_libdir}/opendbx/libmysqlbackend.so.*
%files -n lib%{name}-postgresql
%defattr(-,root,root)
%{_libdir}/opendbx/libpgsqlbackend.so
%{_libdir}/opendbx/libpgsqlbackend.so.*
%files -n lib%{name}-sqlite3
%defattr(-,root,root)
%{_libdir}/opendbx/libsqlite3backend.so
%{_libdir}/opendbx/libsqlite3backend.so.*
%files -n lib%{name}-sybase
%defattr(-,root,root)
%{_libdir}/opendbx/libsybasebackend.so
%{_libdir}/opendbx/libsybasebackend.so.*
%files -n lib%{name}-devel
%defattr(-,root,root)
%{_includedir}/odbx.h
%{_includedir}/opendbx/api
%{_includedir}/opendbx/api.h
%{_libdir}/libopendbx.so
%{_libdir}/libopendbxplus.so
%{_libdir}/pkgconfig/opendbx.pc
%{_libdir}/pkgconfig/opendbxplus.pc
%{_mandir}/man3/OpenDBX*.3*
%{_mandir}/man3/odbx_*.3*
%doc ChangeLog NEWS README TODO
%changelog
* Sat Feb 01 2025 Silvan Calarco <silvan.calarco@mambasoft.it> 1.4.6-1mamba
- package created using the webbuild interface