libs: gdbm: enable/install Berkley DBM compat layer
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Wed, 19 May 2021 14:16:43 +0000 (17:16 +0300)
committerAlexandru Ardelean <ardeleanalex@gmail.com>
Tue, 13 Jul 2021 08:22:32 +0000 (11:22 +0300)
Python supports both GNU dbm and Berkley DBM.
GNU dbm also has a compatibility layer for Berkeley.

The current Berkley DB in OpenWrt is 4.7 and hasn't been updated in ages.
It's also pretty big.

So, an alternative for Python is to use GNU dbm for both (GNU and Berkley).

Also, removing static shared libraries from the build, to encourage the
usage of the shared ones.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
libs/gdbm/Makefile

index 8e0e85d706f75f957e33d376bcc593a3fbe9fec9..b23cb74c964b5a5eea4150be569494afe6f51923 100644 (file)
@@ -19,7 +19,7 @@ PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_LICENSE_FILES:=COPYING
 
-PKG_INSTALL:=1
+PKG_INSTALL:=2
 PKG_BUILD_PARALLEL:=0
 
 include $(INCLUDE_DIR)/package.mk
@@ -38,8 +38,8 @@ define Package/libgdbm/description
 endef
 
 CONFIGURE_ARGS += \
-       --enable-shared \
-       --enable-static
+       --enable-libgdbm-compat \
+       --enable-shared
 
 define Build/Compile
        +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
@@ -51,14 +51,16 @@ endef
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/gdbm.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/{gdbm,ndbm}.h $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm_compat.so* $(1)/usr/lib/
 endef
 
 define Package/libgdbm/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm_compat.so* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,libgdbm))