-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding dirver UnixODBC template ini file to installation(RPM/DEB/TGZ)
Adding (post)installation script to RPM and DEB to register the driver with DM Adding source rpm build
- Loading branch information
Showing
3 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,7 +210,7 @@ IF(NOT USE_SYSTEM_INSTALLED_LIB) | |
ELSE() | ||
INSTALL(FILES | ||
$<TARGET_FILE:libmariadb> | ||
DESTINATION ${INSTALL_LIBDIR} | ||
DESTINATION "${INSTALL_LIBDIR}" | ||
COMPONENT ConCLib) | ||
MESSAGE(STATUS "Configuring to install libmariadb to ${INSTALL_LIBDIR}") | ||
IF(NOT ALL_PLUGINS_STATIC) | ||
|
@@ -474,8 +474,44 @@ ELSE() | |
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmaodbc.pc | ||
DESTINATION "${INSTALL_PCDIR}" | ||
COMPONENT Development) | ||
IF(RPM) | ||
SET(CPACK_RPM_Development_USER_FILELIST "%ignore ${CMAKE_INSTALL_PREFIX}/${INSTALL_PCDIR}") | ||
# Not doing this with MacOS(iOdbc). So far, at least | ||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/packaging/linux/maodbc.ini.in | ||
${CMAKE_BINARY_DIR}/packaging/linux/maodbc.ini @ONLY) | ||
INSTALL(FILES | ||
${CMAKE_BINARY_DIR}/packaging/linux/maodbc.ini | ||
DESTINATION | ||
"${INSTALL_DOCDIR}" | ||
COMPONENT Documentation) | ||
IF(RPM OR DEB) | ||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/packaging/linux/postinstall.in | ||
${CMAKE_BINARY_DIR}/packaging/linux/postinstall @ONLY) | ||
|
||
IF(RPM) | ||
SET(CPACK_RPM_Development_USER_FILELIST "%ignore ${CMAKE_INSTALL_PREFIX}/${INSTALL_PCDIR}") | ||
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CMAKE_INSTALL_PREFIX}/${INSTALL_PCDIR}) | ||
MESSAGE(STATUS "Excluding ${CMAKE_INSTALL_PREFIX}/${INSTALL_PCDIR} from RPM filelist") | ||
SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_BINARY_DIR}/packaging/linux/postinstall) | ||
|
||
IF(CMAKE_VERSION VERSION_GREATER "3.9.99") | ||
|
||
SET(CPACK_SOURCE_GENERATOR "RPM") | ||
SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-DRPM=${RPM}") | ||
|
||
MACRO(ADDIF var) | ||
IF(DEFINED ${var}) | ||
SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-D${var}=${${var}}") | ||
ENDIF() | ||
ENDMACRO() | ||
|
||
ADDIF(CMAKE_BUILD_TYPE) | ||
ADDIF(BUILD_CONFIG) | ||
#ADDIF(WITH_SSL) | ||
|
||
ENDIF() | ||
ELSE() | ||
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/packaging/linux/postinstall") | ||
ENDIF() | ||
|
||
ENDIF() | ||
ENDIF() | ||
INSTALL(TARGETS | ||
|
@@ -488,6 +524,7 @@ ELSE() | |
DESTINATION | ||
"${INSTALL_DOCDIR}" | ||
COMPONENT Documentation) | ||
|
||
INSTALL(FILES | ||
${CMAKE_SOURCE_DIR}/COPYING | ||
DESTINATION | ||
|
@@ -573,7 +610,7 @@ SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") | |
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") | ||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mariadb-connector-odbc-${CPACK_PACKAGE_VERSION}${QUALITY_SUFFIX}-src") | ||
SET(CPACK_PACKAGE_CONTACT "[email protected]") | ||
SET(CPACK_PACKAGE_VENDOR "MariaDB Corporation AB") | ||
SET(CPACK_PACKAGE_VENDOR "MariaDB plc") | ||
SET(CPACK_SOURCE_IGNORE_FILES | ||
/test/ | ||
/.git/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[MariaDB] | ||
Driver = @CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/libmaodbc.so | ||
DESCRIPTION = MariaDB ODBC Connector | ||
Threading = 0 | ||
|
||
[@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/libmaodbc.so] | ||
Driver = @CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/libmaodbc.so | ||
DESCRIPTION = MariaDB ODBC Connector | ||
Threading = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
if ! odbcinst -i -d -n "MariaDB ODBC Connector" -f @CMAKE_INSTALL_PREFIX@/@INSTALL_DOCDIR@/maodbc.ini ; then | ||
if [-z ${ODBCINSTINI+x}]; then | ||
if [-z ${ODBCSYSINI+x}]; then | ||
ODBCINIFILE="/etc/odbcinst.ini"; | ||
else | ||
ODBCINIFILE="$ODBCSYSINI/odbcinst.ini"; | ||
fi | ||
else | ||
ODBCINIFILE="$ODBCINSTINI"; | ||
fi | ||
|
||
cat @CMAKE_INSTALL_PREFIX@/@INSTALL_DOCDIR@/maodbc.ini >> $ODBCINIFILE | ||
fi |