Skip to content

Commit 0086825

Browse files
authored
Linux DEB ODBC installer support
* Initial draft of DEB installer * reuse script for RPM, and rename script to indicate `postinst` (postinstall) * Add `file` to dockerfile to enable Debian installation * Fix component settings with DEB * Fix package name * Clean up comments * Fix file name * Fix postinst variable for DEB * Fix upload artifact file name and doc file name
1 parent 56c0480 commit 0086825

4 files changed

Lines changed: 26 additions & 10 deletions

File tree

.github/workflows/cpp_extra.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,13 @@ jobs:
384384
run-options: >-
385385
-e ARROW_FLIGHT_SQL_ODBC_INSTALLER=ON
386386
-e ODBC_PACKAGE_FORMAT=RPM
387+
- image: ubuntu-cpp-odbc
388+
title: AMD64 Ubuntu DEB Release
389+
build-type: release
390+
format: deb
391+
run-options: >-
392+
-e ARROW_FLIGHT_SQL_ODBC_INSTALLER=ON
393+
-e ODBC_PACKAGE_FORMAT=DEB
387394
# GH-49582: TODO Enable Debian build for ODBC
388395
# - image: debian-cpp-odbc
389396
# title: AMD64 Debian
@@ -415,8 +422,8 @@ jobs:
415422
uses: actions/cache@v5
416423
with:
417424
path: .docker
418-
key: ${{ matrix.image }}-${{ matrix.build-type }}-${{ hashFiles('cpp/**') }}
419-
restore-keys: ${{ matrix.image }}-${{ matrix.build-type }}-
425+
key: ${{ matrix.image }}-${{ matrix.build-type }}-${{ matrix.format }}-${{ hashFiles('cpp/**') }}
426+
restore-keys: ${{ matrix.image }}-${{ matrix.build-type }}-${{ matrix.format }}-
420427
- name: Setup Python on hosted runner
421428
uses: actions/setup-python@v6
422429
with:
@@ -437,8 +444,8 @@ jobs:
437444
if: matrix.build-type == 'release'
438445
uses: actions/upload-artifact@v7
439446
with:
440-
name: flight-sql-odbc-pkg-installer-${{ matrix.format }}
441-
path: build/cpp/ArrowFlightSqlOdbcODBC-*.${{ matrix.format }}
447+
name: flight-sql-odbc-${{ matrix.format }}-installer
448+
path: build/cpp/ArrowFlightSqlOdbc-*.${{ matrix.format }}
442449
if-no-files-found: error
443450

444451
- name: Docker Push
@@ -564,7 +571,7 @@ jobs:
564571
uses: actions/upload-artifact@v7
565572
with:
566573
name: flight-sql-odbc-pkg-installer-${{ matrix.architecture }}
567-
path: build/cpp/ArrowFlightSqlOdbcODBC-*.pkg
574+
path: build/cpp/ArrowFlightSqlOdbc-*.pkg
568575
if-no-files-found: error
569576
- name: Register Flight SQL ODBC Driver
570577
run: |

ci/docker/ubuntu-24.04-cpp.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ RUN apt-get update -y -q && \
7070
ccache \
7171
cmake \
7272
curl \
73+
file \
7374
gdb \
7475
git \
7576
libbenchmark-dev \

cpp/src/arrow/flight/sql/odbc/CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER)
157157
"${CMAKE_CURRENT_SOURCE_DIR}/install/windows/arrow-wix-banner.bmp")
158158
else()
159159
set(ODBC_UNIX_FILE_NAME
160-
"ArrowFlightSqlOdbcODBC-${CPACK_PACKAGE_VERSION_MAJOR}.${ODBC_PACKAGE_VERSION_MINOR}.${ODBC_PACKAGE_VERSION_PATCH}"
160+
"ArrowFlightSqlOdbc-${CPACK_PACKAGE_VERSION_MAJOR}.${ODBC_PACKAGE_VERSION_MINOR}.${ODBC_PACKAGE_VERSION_PATCH}"
161161
)
162162
if(APPLE)
163163
set(CPACK_PACKAGE_FILE_NAME "${ODBC_UNIX_FILE_NAME}")
@@ -178,13 +178,21 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER)
178178
# Linux
179179
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
180180
if(${ODBC_PACKAGE_FORMAT} STREQUAL "DEB")
181-
# GH-49595 TODO: implement DEB installer
182-
message(STATUS "ODBC_PACKAGE_FORMAT DEB not implemented, see GH-49595")
181+
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64)
182+
set(CPACK_GENERATOR DEB)
183+
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
184+
"${CMAKE_CURRENT_SOURCE_DIR}/install/linux/postinst")
185+
set(CPACK_DEBIAN_FILE_NAME "${ODBC_UNIX_FILE_NAME}.deb")
186+
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}")
187+
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
188+
# Exclude Unspecified components
189+
set(CPACK_DEB_COMPONENT_INSTALL ON)
190+
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
183191
elseif(${ODBC_PACKAGE_FORMAT} STREQUAL "RPM")
184192
set(CPACK_RPM_PACKAGE_ARCHITECTURE x86_64)
185193
set(CPACK_GENERATOR RPM)
186194
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE
187-
"${CMAKE_CURRENT_SOURCE_DIR}/install/linux/rpm/postinstall")
195+
"${CMAKE_CURRENT_SOURCE_DIR}/install/linux/postinst")
188196
set(CPACK_RPM_FILE_NAME "${ODBC_UNIX_FILE_NAME}.rpm")
189197
# Disable dependency check as ODBC embeds all third party dependencies
190198
set(CPACK_RPM_PACKAGE_AUTOREQPROV "no")
@@ -231,7 +239,7 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER)
231239
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../LICENSE.txt"
232240
DESTINATION "${DOC_INSTALL_DIR}"
233241
COMPONENT Docs)
234-
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/Connection-Options.md"
242+
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/connection-options.md"
235243
DESTINATION "${DOC_INSTALL_DIR}"
236244
COMPONENT Docs)
237245
endif()

cpp/src/arrow/flight/sql/odbc/install/linux/rpm/postinstall renamed to cpp/src/arrow/flight/sql/odbc/install/linux/postinst

File renamed without changes.

0 commit comments

Comments
 (0)