#4 Add convert util as a subpackage
Merged 8 months ago by fjanus. Opened 9 months ago by fjanus.
rpms/ fjanus/libdb rawhide  into  rawhide

file modified
+70 -3
@@ -1,6 +1,13 @@ 

+ %if 0%{?fedora}

+ %bcond_without subpackages

+ %else

+ %bcond_with subpackages

+ %endif

+ 

  %define __soversion_major 5

  %define __soversion %{__soversion_major}.3

  %define __tclversion 8.6

+ %define _converter_version 1.0.2

  

  # The SQLite configure script does not support --runstatedir and is not

  # regenerated.
@@ -9,13 +16,14 @@ 

  Summary: The Berkeley DB database library for C

  Name: libdb

  Version: 5.3.28

- Release: 56%{?dist}

+ Release: 57%{?dist}

  Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz

  Source1: http://download.oracle.com/berkeley-db/db.1.85.tar.gz

  # For mt19937db.c

  Source2: http://www.gnu.org/licenses/lgpl-2.1.txt

  # libdb man pages generated from the 5.3.28 documentation

  Source3: libdb-5.3.28-manpages.tar.gz

+ Source4: https://github.com/fila43/db_converter/archive/refs/tags/v%{_converter_version}.tar.gz

  Patch0: libdb-multiarch.patch

  # db-1.85 upstream patches

  Patch10: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.1
@@ -75,7 +83,7 @@ 

  BuildRequires: tcl-devel >= %{__tclversion}

  BuildRequires: chrpath

  BuildRequires: zlib-devel

- BuildRequires: make

+ BuildRequires: make gdbm-devel lmdb-devel

  Conflicts: filesystem < 3

  

  # libdb was marked as deprecated in F33:
@@ -228,10 +236,23 @@ 

  client/server applications. This package contains the libraries

  for building programs which use the Berkeley DB in SQL.

  

+ %package convert-util

+ Summary: Development files for using the Berkeley DB with sql

+ 

+ %description convert-util

+ The Berkeley Database (Berkeley DB) is a programmatic toolkit that

+ provides embedded database support for both traditional and

+ client/server applications. This package contains the libraries

+ for building programs which use the Berkeley DB in SQL.

+ 

+ 

  %prep

  %setup -q -n db-%{version} -a 1

  cp %{SOURCE2} .

  tar -xf %{SOURCE3}

+ # db_converter

+ tar -xf %{SOURCE4}

+ 

  

  %patch0 -p1

  pushd db.1.85/PORT/linux
@@ -314,12 +335,20 @@ 

  echo "source ../../test/tcl/test.tcl; r env; r mut; r memp" | tclsh

  popd

  

+ pushd db_converter-%{_converter_version}

+ # libdb-5.3.a is part of static package, build produces libdb.a

+ sed -i 's/-ldb-5.3/-ldb/g' Makefile

+ # Set path to headers and library to previously built files

+ # since this tool is intended to build statically

+ make LDFLAGS="-I../dist/dist-tls -L../dist/dist-tls -Wl,-z,now" CFLAGS="-g -fPIC %build_cflags" static

+ popd

+ 

  %install

+ %if %{with subpackages}

  rm -rf ${RPM_BUILD_ROOT}

  mkdir -p ${RPM_BUILD_ROOT}%{_includedir}

  mkdir -p ${RPM_BUILD_ROOT}%{_libdir}

  mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1

- 

  %make_install STRIP=/bin/true -C dist/dist-tls

  

  # XXX Nuke non-versioned archives and symlinks
@@ -360,13 +389,22 @@ 

  %ldconfig_scriptlets cxx

  %ldconfig_scriptlets sql

  %ldconfig_scriptlets tcl

+ %else

+ mkdir -p %{buildroot}%{_bindir}

+ %endif

+ install -m 0755 db_converter-%{_converter_version}/db_converter %{buildroot}/%{_bindir}/db_converter

  

  %files

  %license LICENSE lgpl-2.1.txt

+ %if %{with subpackages}

  %doc README

  %{_libdir}/libdb-%{__soversion}.so

  %{_libdir}/libdb-%{__soversion_major}.so

+ %else

+ %{_bindir}/db_converter

+ %endif

  

+ %if %{with subpackages}

  %files devel

  %{_libdir}/libdb.so

  %dir %{_includedir}/%{name}
@@ -374,16 +412,22 @@ 

  %{_includedir}/%{name}/db_185.h

  %{_includedir}/db.h

  %{_includedir}/db_185.h

+ %endif

  

+ %if %{with subpackages}

  %files devel-doc

  %doc	docs/*

+ %endif

  

+ %if %{with subpackages}

  %files devel-static

  %{_libdir}/libdb-%{__soversion}.a

  %{_libdir}/libdb_cxx-%{__soversion}.a

  %{_libdir}/libdb_tcl-%{__soversion}.a

  %{_libdir}/libdb_sql-%{__soversion}.a

+ %endif

  

+ %if %{with subpackages}

  %files utils

  %{_bindir}/db*_archive

  %{_bindir}/db*_checkpoint
@@ -399,33 +443,56 @@ 

  %{_bindir}/db*_verify

  %{_bindir}/db*_tuner

  %{_mandir}/man1/db_*

+ %endif

+ 

+ %if %{with subpackages}

+ %files convert-util

+ %{_bindir}/db_converter

+ %endif

  

+ %if %{with subpackages}

  %files cxx

  %{_libdir}/libdb_cxx-%{__soversion}.so

  %{_libdir}/libdb_cxx-%{__soversion_major}.so

+ %endif

  

+ %if %{with subpackages}

  %files cxx-devel

  %{_includedir}/%{name}/db_cxx.h

  %{_includedir}/db_cxx.h

  %{_libdir}/libdb_cxx.so

+ %endif

  

+ %if %{with subpackages}

  %files tcl

  %{_libdir}/libdb_tcl-%{__soversion}.so

  %{_libdir}/libdb_tcl-%{__soversion_major}.so

+ %endif

  

+ %if %{with subpackages}

  %files tcl-devel

  %{_libdir}/libdb_tcl.so

+ %endif

  

+ %if %{with subpackages}

  %files sql

  %{_libdir}/libdb_sql-%{__soversion}.so

  %{_libdir}/libdb_sql-%{__soversion_major}.so

+ %endif

  

+ %if %{with subpackages}

  %files sql-devel

  %{_bindir}/dbsql

  %{_libdir}/libdb_sql.so

  %{_includedir}/%{name}/dbsql.h

+ %endif

  

  %changelog

+ * Tue Aug 29 2023 Filip Janus <fjanus@redhat.com> - 5.3.25-57

+ - Add convert-util subpackage

+ - It allowes to convert BerkeleyDB database format to GDBM/LMDB format

+ - Disable shiping libdb for rhel except convert-tool

+ 

  * Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-56

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

  

file modified
+4 -3
@@ -1,3 +1,4 @@ 

- b99454564d5b4479750567031d66fe24  db-5.3.28.tar.gz

- 42cc6c1e1e25818bd3e3f91328edb0f1  db.1.85.tar.gz

- 541c8b55eb210d05bc31d67436a9db10  libdb-5.3.28-manpages.tar.gz

+ SHA512 (db-5.3.28.tar.gz) = e91bbe550fc147a8be7e69ade86fdb7066453814971b2b0223f7d17712bd029a8eff5b2b6b238042ff6ec1ffa6879d44cb95c5645a922fee305c26c3eeaee090

+ SHA512 (db.1.85.tar.gz) = 03bf3a2b0947efdca4e38719542e96378b5eeb57da64d5030dd23ab710773c1826f1c867032d0bea658b7fdd8272db253e97bbc490d198b9437025ffdf9e880e

+ SHA512 (libdb-5.3.28-manpages.tar.gz) = b3744e8ea8973b91084dc2f4351eedd189a07df8eb32b236f0b5ae23e7182129ab8b882898a1cfaa68f761ad18c27478c52b3032ae1b4db906504765cc2582c1

+ SHA512 (v1.0.2.tar.gz) = b7bde73dfbba9fa2c03748dc261a20e01998906d769594d748ca30b00ee1f22275b19fbdf6977ac8c2c44f28139290d4c1af044957e3716f691283bfcbbf7018

Add convert util as a subpackage. Since libdb was marked as deprecated. So this tool provides ability to convert databases to other supported format BerkeleyDB ->GDBM/LMDB
add if{rhel/fedora} macros to ensure building only converting tool on RHEL-based systems

I see more separate parts of spec file that must be edited -- for that purpose, it would be better to have a new %bcond macro and set the value of that macro based on %fedora.

As it is now, it would be hard to turn the sub-package off for example, because it would be hard to distinguish these changes from other chunks with %if %fedora that are not related to this sub-package.

The %bcond macro is a great tool exactly for this purpose.

rebased onto 1615145

8 months ago

Pull-Request has been merged by fjanus

8 months ago
Metadata