alinaliBQ commented on code in PR #49766:
URL: https://github.com/apache/arrow/pull/49766#discussion_r3211720741


##########
cpp/src/arrow/flight/sql/odbc/CMakeLists.txt:
##########
@@ -159,6 +158,66 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER)
 
     set(CPACK_WIX_UI_BANNER
         "${CMAKE_CURRENT_SOURCE_DIR}/install/windows/arrow-wix-banner.bmp")
+  else()
+    if(APPLE)
+      set(CPACK_PACKAGE_FILE_NAME
+          
"ArrowFlightSqlOdbcODBC-${CPACK_PACKAGE_VERSION_MAJOR}.${ODBC_PACKAGE_VERSION_MINOR}.${ODBC_PACKAGE_VERSION_PATCH}"
+      )
+      set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
+
+      set(CPACK_SET_DESTDIR ON)
+      set(CPACK_INSTALL_PREFIX "/Library/ODBC")
+      # Register ODBC after install
+      set(CPACK_POSTFLIGHT_ARROW_FLIGHT_SQL_ODBC_SCRIPT
+          "${CMAKE_CURRENT_SOURCE_DIR}/install/mac/postinstall")
+      set(CPACK_RESOURCE_FILE_README 
"${CMAKE_CURRENT_SOURCE_DIR}/install/mac/README.txt")
+      set(CPACK_RESOURCE_FILE_WELCOME
+          "${CMAKE_CURRENT_SOURCE_DIR}/install/mac/Welcome.txt")
+
+      set(ODBC_INSTALL_DIR "arrow-odbc/lib")
+      set(DOC_INSTALL_DIR "arrow-odbc/doc")
+    else()
+      # Linux
+      # GH-49595: TODO implement DEB installer
+      # GH-47977: TODO implement RPM installer
+      message(STATUS "ODBC_PACKAGE_FORMAT DEB not implemented, see GH-49595")
+      message(STATUS "ODBC_PACKAGE_FORMAT RPM not implemented, see GH-47977")
+    endif()
+
+    # Install ODBC
+    install(TARGETS arrow_flight_sql_odbc_shared
+            DESTINATION "${ODBC_INSTALL_DIR}"
+            COMPONENT arrow_flight_sql_odbc)
+
+    # Install temporary driver registration scripts, they will be removed 
after driver registration is complete
+    install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/install/unix/install_odbc.sh"
+            DESTINATION "${ODBC_INSTALL_DIR}"
+            COMPONENT arrow_flight_sql_odbc
+            PERMISSIONS OWNER_EXECUTE
+                        OWNER_WRITE
+                        OWNER_READ
+                        GROUP_EXECUTE
+                        GROUP_READ
+                        WORLD_EXECUTE
+                        WORLD_READ)
+    install(FILES 
"${CMAKE_CURRENT_SOURCE_DIR}/install/unix/install_odbc_ini.sh"
+            DESTINATION "${ODBC_INSTALL_DIR}"
+            COMPONENT arrow_flight_sql_odbc
+            PERMISSIONS OWNER_EXECUTE
+                        OWNER_WRITE
+                        OWNER_READ
+                        GROUP_EXECUTE
+                        GROUP_READ
+                        WORLD_EXECUTE
+                        WORLD_READ)
+
+    # Install documentation files
+    install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../LICENSE.txt"
+            DESTINATION "${DOC_INSTALL_DIR}"
+            COMPONENT Docs)

Review Comment:
   Theoretically it can work for ODBC installer, but adding `COMPONENT Docs` in 
`arrow/cpp/CMakeLists.txt` will change the Arrow installer behavior. When the 
`COMPONENT` is the default `Unspecified`, these files are installed by default 
(unless we actively exclude `Unspecified` components like we do with ODBC 
installer). Once assigned to a `COMPONENT`, these files will only be installed 
when `Docs` is explicitly included in the Arrow installer. I don't have enough 
context with Arrow installer to make this change, and I will leave this to 
folks with more context. 
   
   cc @justing-bq For ODBC, I suggest we can do these 2 things:
   1. add `NOTICE.txt` to the ODBC `Doc` component.
   2. add `Doc` component to Windows platform by changing the 
`set(CPACK_COMPONENTS_ALL` line to
   ```
   set(CPACK_COMPONENTS_ALL "ArrowFlightSQLODBC" "Docs")
   ```
   and remove 
   ```
   list(APPEND CPACK_COMPONENTS_ALL Docs)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to