diff --git a/KDb.pc.cmake b/KDb.pc.cmake --- a/KDb.pc.cmake +++ b/KDb.pc.cmake @@ -4,9 +4,9 @@ includedir=${prefix}/include Name: @PROJECT_NAME@@PROJECT_STABLE_VERSION_MAJOR@ -Description: A database connectivity and creation library +Description: A database connectivity and creation framework Version: @PROJECT_VERSION@ URL: http://community.kde.org/KDb -Requires: Qt5Core Qt5Gui Qt5Xml icu-lo KF5CoreAddons +Requires: Qt5Core Qt5Gui Qt5Widgets Qt5Xml icu-lo KF5CoreAddons Libs: -L${libdir} Cflags: -I${includedir} diff --git a/README-PACKAGERS.md b/README-PACKAGERS.md --- a/README-PACKAGERS.md +++ b/README-PACKAGERS.md @@ -8,42 +8,46 @@ * helps to reduce packaging conflicts for users with non-standard package selections. +In this document {MAJOR_VERSION} is 3 for KDb 3.x.y, and so on. + ## KDb libraries -KDb offers the following libraries: - * kdb +The base KDb package offers the following libraries: + * KDb{MAJOR_VERSION} ## Database and migration drivers KDb provides database drivers in a form of plugins for a number of database types or data sources. * SQLite - * kdb_sqlite.so - the database driver - * kdb_sqlite.desktop - * kdb_sqlite_icu.so - SQLite's plugin for unicode support - * kdb_sqlite3_dump - A minimal command line tool for compacting files + * kdb_sqlitedriver.so - the database driver with the following dependencies: + * kdb_sqlite_icu.so - SQLite's plugin for unicode support + * kdb{MAJOR_VERSION}_sqlite3_dump - A minimal command line tool for compacting files * MySQL - * kdb_mysql.so - the database driver - * kdb_mysql.desktop + * kdb_mysqldriver.so - the database driver * PostgreSQL - * kdb_postgresql.so - the database driver - * kdb_postgresql.desktop + * kdb_postgresqldriver.so - the database driver Other drivers are work in progress and are not currently distributed. -Plugin .so and .desktop service files typically go -to $PREFIX/lib/plugins/kdb/ directory. +Plugin `kdb_*driver.so` files typically go to $LIBDIR/plugins/kdb{MAJOR_VERSION}/ directory. +Location of these files means that multiple KDb packages with different MAJOR_VERSIONs +are co-installable. Also header and cmake files are cleanly separated by installing +to subdirectories called KDb{MAJOR_VERSION}. + +Please note a special case: KDb 3.0 is binary and source incompatible with KDb >= 3.1. +All other versions are compatible within given MAJOR_VERSION. We suggest putting each driver in a separate package, and that installation of these packages be optional. Each driver's package may then depend on the corresponding lower-level, native client libraries for performing connectivity. -For example, it's libmysqlclient for the MySQL driver and libpq for PostgreSQL. +For example, it's libmysqlclient for the MySQL driver and libpq for PostgreSQL driver. ## Versions of client libraries diff --git a/cmake/modules/KDbMacros.cmake b/cmake/modules/KDbMacros.cmake --- a/cmake/modules/KDbMacros.cmake +++ b/cmake/modules/KDbMacros.cmake @@ -1,6 +1,6 @@ # Additional CMake macros # -# Copyright (C) 2015-2017 Jarosław Staniek +# Copyright (C) 2015-2018 Jarosław Staniek # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. @@ -82,25 +82,38 @@ endmacro() # Sets detailed version information for library co-installability. -# - adds PROJECT_VERSION_MAJOR to the lib name -# - sets VERSION and SOVERSION to PROJECT_VERSION_MAJOR.PROJECT_VERSION_MINOR +# - adds PROJECT_STABLE_VERSION_MAJOR to the lib name +# - sets VERSION to PROJECT_STABLE_VERSION_MAJOR.PROJECT_STABLE_VERSION_MINOR.PROJECT_STABLE_VERSION_PATCH +# - sets SOVERSION to PROJECT_STABLE_VERSION_MAJOR +# (special case for 3.0 < PROJECT_STABLE_VERSION < 4.0: sets SOVERSION to PROJECT_STABLE_VERSION_MAJOR + 1 +# to separate from incompatible version 3.0) # - sets ${_target_upper}_BASE_NAME variable to the final lib name # - sets ${_target_upper}_BASE_NAME_LOWER variable to the final lib name, lowercase # - sets ${_target_upper}_INCLUDE_INSTALL_DIR to include dir for library headers # - (where _target_upper is uppercase ${_target} macro(set_coinstallable_lib_version _target) set(_name ${_target}${PROJECT_STABLE_VERSION_MAJOR}) + set(_soversion ${PROJECT_STABLE_VERSION_MAJOR}) + if(${PROJECT_STABLE_VERSION_MAJOR} EQUAL 3) + math(EXPR _soversion "${PROJECT_STABLE_VERSION_MAJOR} + 1") + math(EXPR _version "${PROJECT_STABLE_VERSION_MAJOR} + 1") + else() + set(_soversion ${PROJECT_STABLE_VERSION_MAJOR}) + endif() + set(_version "${_version}.${PROJECT_STABLE_VERSION_MINOR}.${PROJECT_STABLE_VERSION_PATCH}") set_target_properties(${_target} - PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} - SOVERSION ${PROJECT_VERSION_MAJOR} + PROPERTIES VERSION ${_version} + SOVERSION ${_soversion} EXPORT_NAME ${_target} OUTPUT_NAME ${_name} ) string(TOUPPER ${_target} _target_upper) string(TOUPPER ${_target_upper}_BASE_NAME _var) set(${_var} ${_name}) string(TOLOWER ${_name} ${_var}_LOWER) set(${_target_upper}_INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR}/${_name}) + unset(_soversion) + unset(_version) unset(_target_upper) unset(_var) endmacro()