Files
archie/cmake/modules/FindGDBM.cmake
Mario Fetka 1e4baef047 Port Archie 3.5 to Linux/CMake, add Debian packaging and CI
- Replace autoconf/make build system with CMake (installs to /opt/archie)
- Add CPack DEB packaging for Debian Trixie (non-free/net, postinst creates
  archie user, extracts DB skeleton, sets setuid bits, enables systemd units)
- Add Gitea Actions workflow building .deb + binary/source tarballs on tag push
- Add portable archie_init.py for non-Debian post-install setup
- Port all scripts to Linux: getent passwd, systemctl, tail -n +N, gzip
- Add SFTP (libssh2) and FTPS (OpenSSL) scrapers alongside anonftp
- Add Flask web frontend (archie-web.service)
- Fix filter scripts (exec cat replaces broken sed s///g)
- Update all manpages: paths, contacts, add SFTP/FTPS section
- Update etc/: enable gzip, add webindex catalog, fix localhost refs
- Remove: AIX-2/SunOS-4.1.4/SunOS-5.4 dirs, tcl7.6/, tcl-dp/, tk4.2/,
  berkdb/, old Makefile.in/pre/post fragments, build.sh, unwrap scripts
- Add .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 23:05:12 +02:00

132 lines
3.1 KiB
CMake

# - Find gdbm and optional ndbm compatibility
#
# This module finds GNU dbm and, if available, the gdbm ndbm compatibility layer.
#
# Result variables:
#
# GDBM_FOUND - True if gdbm was found
# GDBM_INCLUDE_DIR - Directory containing gdbm.h
# GDBM_LIBRARY - Path to libgdbm
# GDBM_LIBRARIES - Libraries needed for plain gdbm
#
# GDBM_NDBM_FOUND - True if ndbm compatibility was found
# GDBM_NDBM_INCLUDE_DIR - Directory containing ndbm.h
# GDBM_COMPAT_LIBRARY - Path to libgdbm_compat
# GDBM_NDBM_LIBRARIES - Libraries needed for ndbm compatibility
#
# Imported targets:
#
# GDBM::GDBM - plain gdbm target, if found
# GDBM::NDBM - ndbm compatibility target, if found
#
# Notes:
#
# Some systems install ndbm.h as:
#
# /usr/include/ndbm.h
#
# Others, including some Gentoo setups, install it as:
#
# /usr/include/gdbm/ndbm.h
#
# This module handles both layouts. In the second case,
# GDBM_NDBM_INCLUDE_DIR will be /usr/include/gdbm so that:
#
# #include <ndbm.h>
#
# works correctly.
include(FindPackageHandleStandardArgs)
if(GDBM_INCLUDE_DIR AND GDBM_LIBRARY)
set(GDBM_FIND_QUIETLY TRUE)
endif()
find_path(GDBM_INCLUDE_DIR
NAMES gdbm.h
)
find_library(GDBM_LIBRARY
NAMES gdbm
)
find_path(GDBM_NDBM_INCLUDE_DIR
NAMES ndbm.h
)
if(NOT GDBM_NDBM_INCLUDE_DIR)
find_path(GDBM_NDBM_INCLUDE_DIR
NAMES ndbm.h
PATH_SUFFIXES gdbm
)
endif()
find_library(GDBM_COMPAT_LIBRARY
NAMES gdbm_compat
)
find_package_handle_standard_args(GDBM
REQUIRED_VARS
GDBM_INCLUDE_DIR
GDBM_LIBRARY
)
if(GDBM_FOUND)
set(GDBM_LIBRARIES
${GDBM_LIBRARY}
)
else()
set(GDBM_LIBRARIES)
endif()
if(GDBM_NDBM_INCLUDE_DIR AND GDBM_COMPAT_LIBRARY AND GDBM_LIBRARY)
set(GDBM_NDBM_FOUND TRUE)
set(GDBM_NDBM_LIBRARIES
${GDBM_COMPAT_LIBRARY}
${GDBM_LIBRARY}
)
else()
set(GDBM_NDBM_FOUND FALSE)
set(GDBM_NDBM_LIBRARIES)
endif()
if(GDBM_FOUND AND NOT TARGET GDBM::GDBM)
add_library(GDBM::GDBM UNKNOWN IMPORTED)
set_target_properties(GDBM::GDBM PROPERTIES
IMPORTED_LOCATION "${GDBM_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GDBM_INCLUDE_DIR}"
)
endif()
if(GDBM_NDBM_FOUND AND NOT TARGET GDBM::NDBM)
add_library(GDBM::NDBM UNKNOWN IMPORTED)
set_target_properties(GDBM::NDBM PROPERTIES
IMPORTED_LOCATION "${GDBM_COMPAT_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GDBM_NDBM_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES GDBM::GDBM
)
endif()
if(GDBM_FOUND AND NOT GDBM_FIND_QUIETLY)
message(STATUS "Found GDBM include: ${GDBM_INCLUDE_DIR}")
message(STATUS "Found GDBM library: ${GDBM_LIBRARY}")
endif()
if(GDBM_NDBM_FOUND AND NOT GDBM_FIND_QUIETLY)
message(STATUS "Found GDBM NDBM include: ${GDBM_NDBM_INCLUDE_DIR}")
message(STATUS "Found GDBM NDBM compat library: ${GDBM_COMPAT_LIBRARY}")
endif()
if(GDBM_FOUND AND NOT GDBM_NDBM_FOUND AND NOT GDBM_FIND_QUIETLY)
message(STATUS "GDBM NDBM compatibility not found; continuing because it is optional")
endif()
mark_as_advanced(
GDBM_INCLUDE_DIR
GDBM_LIBRARY
GDBM_NDBM_INCLUDE_DIR
GDBM_COMPAT_LIBRARY
)