This is an automated email from the ASF dual-hosted git repository.
apkhmv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new ab98c3e075 IGNITE-18621 Support ODBC Deb and RPM packages (#2338)
ab98c3e075 is described below
commit ab98c3e075ce8bb8bedd52446dc55ac805ff45ed
Author: Mikhail <[email protected]>
AuthorDate: Thu Jul 20 18:04:11 2023 +0300
IGNITE-18621 Support ODBC Deb and RPM packages (#2338)
---
modules/platforms/build.gradle | 36 +++++++++++
modules/platforms/cpp/DEVNOTES.md | 1 +
packaging/odbc/build.gradle | 103 ++++++++++++++++++++++++++++++++
packaging/odbc/ignite3-odbc.ini | 5 ++
packaging/odbc/scripts/postInstall.sh | 18 ++++++
packaging/odbc/scripts/postUninstall.sh | 16 +++++
packaging/odbc/scripts/preInstall.sh | 16 +++++
packaging/odbc/scripts/preUninstall.sh | 18 ++++++
settings.gradle | 2 +
9 files changed, 215 insertions(+)
diff --git a/modules/platforms/build.gradle b/modules/platforms/build.gradle
index 4821d89cc9..ff3ef89555 100644
--- a/modules/platforms/build.gradle
+++ b/modules/platforms/build.gradle
@@ -23,6 +23,10 @@ plugins {
import org.gradle.crypto.checksum.Checksum
+configurations {
+ odbc
+}
+
task restoreTool(type: Exec) {
workingDir "$rootDir/modules/platforms/dotnet"
@@ -56,8 +60,34 @@ cmake {
generator='Unix Makefiles'
buildConfig='Release'
buildTarget='install'
+ getDef().CMAKE_INSTALL_PREFIX="$buildDir/install"
+ getDef().CMAKE_BUILD_TYPE='Release'
+}
+
+task cmakeConfigureClient(type: net.freudasoft.CMakeConfigureTask) {
+ configureFromProject() // uses everything in the cmake { ... } section.
+ getDef().put('ENABLE_CLIENT', 'ON')
+ getDef().put('ENABLE_ODBC', 'OFF')
+}
+
+task cmakeBuildClient(type: net.freudasoft.CMakeBuildTask) {
+ configureFromProject() // uses everything in the cmake { ... } section.
+}
+
+cmakeBuildClient.dependsOn cmakeConfigureClient
+
+task cmakeConfigureOdbc(type: net.freudasoft.CMakeConfigureTask) {
+ configureFromProject() // uses everything in the cmake { ... } section.
+ getDef().put('ENABLE_CLIENT', 'OFF')
+ getDef().put('ENABLE_ODBC', 'ON')
+}
+
+task cmakeBuildOdbc(type: net.freudasoft.CMakeBuildTask) {
+ configureFromProject() // uses everything in the cmake { ... } section.
}
+cmakeBuildOdbc.dependsOn cmakeConfigureOdbc
+
task buildNuGet(type: Exec) {
workingDir "$rootDir/modules/platforms/dotnet"
@@ -120,3 +150,9 @@ if (project.hasProperty('prepareRelease')) {
}
}
}
+
+artifacts {
+ odbc(file("$buildDir/cpp/lib/libignite3-odbc.so")) {
+ builtBy cmakeBuildOdbc
+ }
+}
diff --git a/modules/platforms/cpp/DEVNOTES.md
b/modules/platforms/cpp/DEVNOTES.md
index b0b7829ed0..3530655fe6 100644
--- a/modules/platforms/cpp/DEVNOTES.md
+++ b/modules/platforms/cpp/DEVNOTES.md
@@ -32,6 +32,7 @@ The project dependencies include the following libraries:
- msgpack-c 4.0.0
- gtest 1.12.1
+ - unixodbc
When the project is configured with the `-DENABLE_CONAN=OFF` CMake option, the
Conan machinery is turned off and
the dependencies are resolved by using the standard means of the build
platform. For example, the project can be
diff --git a/packaging/odbc/build.gradle b/packaging/odbc/build.gradle
new file mode 100644
index 0000000000..25ce1e40fc
--- /dev/null
+++ b/packaging/odbc/build.gradle
@@ -0,0 +1,103 @@
+import org.apache.tools.ant.filters.ReplaceTokens
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+plugins {
+ id 'java'
+ id 'distribution'
+ id 'signing'
+ alias(libs.plugins.nebula)
+ alias(libs.plugins.checksum)
+}
+
+configurations {
+ odbc
+}
+
+dependencies {
+ odbc(project(path: ":platforms", configuration: "odbc"))
+}
+
+def tokens = [
+ VERSION : version,
+ LIB_DIR : "/usr/lib",
+ TMP_DIR : "/tmp/ignite3-odbc"
+]
+
+task replacePackageScriptVars(type: Copy) {
+ from "$rootDir/packaging/odbc/ignite3-odbc.ini"
+
+ from "$rootDir/packaging/odbc/scripts"
+
+ filter(ReplaceTokens, tokens: tokens)
+ into "$buildDir/scripts/"
+}
+
+distributions {
+ main {
+ distributionBaseName = 'ignite3-odbc'
+ contents {
+ into('') {
+ from configurations.odbc
+ }
+
+ into('tmp') {
+ from "$buildDir/scripts/ignite3-odbc.ini"
+ }
+ }
+ }
+}
+
+distZip.dependsOn replacePackageScriptVars
+distTar.dependsOn replacePackageScriptVars
+
+buildRpm {
+ dependsOn replacePackageScriptVars
+
+ preInstall file("$buildDir/scripts/preInstall.sh")
+ postInstall file("$buildDir/scripts/postInstall.sh")
+ preUninstall file("$buildDir/scripts/preUninstall.sh")
+ postUninstall file("$buildDir/scripts/postUninstall.sh")
+}
+
+buildDeb {
+ dependsOn replacePackageScriptVars
+
+ preInstall file("$buildDir/scripts/preInstall.sh")
+ postInstall file("$buildDir/scripts/postInstall.sh")
+ preUninstall file("$buildDir/scripts/preUninstall.sh")
+ postUninstall file("$buildDir/scripts/postUninstall.sh")
+}
+
+ospackage {
+ license "ASL 2.0"
+ packageName "ignite3-odbc"
+ packageGroup "Library"
+ url "https://ignite.apache.org"
+ packageDescription "This package will install Apache Ignite 3 ODBC driver"
+ os LINUX
+ requires("unixODBC")
+
+ into(tokens.LIB_DIR) {
+ from configurations.odbc
+ }
+
+ into("${tokens.TMP_DIR}/${project.version}") {
+ from "$buildDir/scripts/ignite3-odbc.ini"
+ }
+}
\ No newline at end of file
diff --git a/packaging/odbc/ignite3-odbc.ini b/packaging/odbc/ignite3-odbc.ini
new file mode 100644
index 0000000000..abd30f2b56
--- /dev/null
+++ b/packaging/odbc/ignite3-odbc.ini
@@ -0,0 +1,5 @@
+[Apache Ignite 3]
+Description=Apache Ignite 3 ODBC Driver
+Driver=@LIB_DIR@/libignite3-odbc.so
+Setup=@LIB_DIR@/libignite3-odbc.so
+DriverODBCVer=03.80
\ No newline at end of file
diff --git a/packaging/odbc/scripts/postInstall.sh
b/packaging/odbc/scripts/postInstall.sh
new file mode 100644
index 0000000000..6b7db9bf6a
--- /dev/null
+++ b/packaging/odbc/scripts/postInstall.sh
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+odbcinst -i -d -f @TMP_DIR@/@VERSION@/ignite3-odbc.ini -v
\ No newline at end of file
diff --git a/packaging/odbc/scripts/postUninstall.sh
b/packaging/odbc/scripts/postUninstall.sh
new file mode 100644
index 0000000000..334eaa2221
--- /dev/null
+++ b/packaging/odbc/scripts/postUninstall.sh
@@ -0,0 +1,16 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
diff --git a/packaging/odbc/scripts/preInstall.sh
b/packaging/odbc/scripts/preInstall.sh
new file mode 100644
index 0000000000..334eaa2221
--- /dev/null
+++ b/packaging/odbc/scripts/preInstall.sh
@@ -0,0 +1,16 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
diff --git a/packaging/odbc/scripts/preUninstall.sh
b/packaging/odbc/scripts/preUninstall.sh
new file mode 100644
index 0000000000..ad6961612b
--- /dev/null
+++ b/packaging/odbc/scripts/preUninstall.sh
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+odbcinst -u -d -n "Apache Ignite 3" -v
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index 81ee577b3a..911bb076e7 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -62,6 +62,7 @@ include(':ignite-binary-tuple')
include(':platforms')
include(':packaging-cli')
include(':packaging-db')
+include(':packaging-odbc')
include(':packaging')
include(':ignite-replicator')
include(':ignite-distribution-zones')
@@ -119,6 +120,7 @@ project(":platforms").projectDir = file('modules/platforms')
project(":ignite-replicator").projectDir = file('modules/replicator')
project(":packaging-cli").projectDir = file('packaging/cli')
project(":packaging-db").projectDir = file('packaging/db')
+project(':packaging-odbc').projectDir = file('packaging/odbc')
project(":packaging").projectDir = file('packaging')
project(":ignite-distribution-zones").projectDir =
file('modules/distribution-zones')
project(":ignite-placement-driver").projectDir =
file('modules/placement-driver')