This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/arrow-flight-sql-postgresql.git


The following commit(s) were added to refs/heads/main by this push:
     new ff3761e  Add packages for PostgreSQL 16 (#147)
ff3761e is described below

commit ff3761e8897c0dd4d3c978a39b1bb53d34a081d8
Author: Sutou Kouhei <[email protected]>
AuthorDate: Wed Oct 18 08:56:06 2023 +0900

    Add packages for PostgreSQL 16 (#147)
    
    Closes GH-139
---
 .github/workflows/package.yaml                     |  8 +++++
 dev/release/verify-rc.sh                           | 31 ++++++++--------
 package/apt/test.sh                                | 31 ++++++++--------
 .../apt/debian-bookworm-amd64/Dockerfile           | 13 ++++---
 .../apt/ubuntu-jammy-amd64/Dockerfile              | 13 ++++---
 package/postgresql-16-pgdg/Rakefile                | 32 +++++++++++++++++
 .../apt/debian-bookworm-amd64/Dockerfile           | 15 +++++---
 .../apt/ubuntu-jammy-amd64/Dockerfile              | 15 +++++---
 package/postgresql-16-pgdg/debian/changelog        |  0
 package/postgresql-16-pgdg/debian/control          | 41 ++++++++++++++++++++++
 package/postgresql-16-pgdg/debian/copyright        | 26 ++++++++++++++
 package/postgresql-16-pgdg/debian/rules            | 37 +++++++++++++++++++
 12 files changed, 215 insertions(+), 47 deletions(-)

diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml
index 480c12c..b723efc 100644
--- a/.github/workflows/package.yaml
+++ b/.github/workflows/package.yaml
@@ -78,6 +78,8 @@ jobs:
         target:
           - "debian-bookworm-amd64-postgresql-15-pgdg"
           - "ubuntu-jammy-amd64-postgresql-15-pgdg"
+          - "debian-bookworm-amd64-postgresql-16-pgdg"
+          - "ubuntu-jammy-amd64-postgresql-16-pgdg"
     steps:
       - uses: actions/checkout@v4
         with:
@@ -97,6 +99,11 @@ jobs:
           PACKAGE=postgresql-${full_target#*-postgresql-}
           echo "PACKAGE=${PACKAGE}" >> $GITHUB_ENV
           # debian-bookworm-amd64-postgresql-15-pgdg ->
+          # 15 ->
+          POSTGRESQL_VERSION=${full_target#*-postgresql-}
+          POSTGRESQL_VERSION=${POSTGRESQL_VERSION%-pgdg}
+          echo "POSTGRESQL_VERSION=${POSTGRESQL_VERSION}" >> $GITHUB_ENV
+          # debian-bookworm-amd64-postgresql-15-pgdg ->
           # debian-bookworm-amd64
           PACKAGE_TARGET=${full_target%-postgresql-*}
           echo "APT_TARGETS=${PACKAGE_TARGET}" >> $GITHUB_ENV
@@ -179,6 +186,7 @@ jobs:
             ${ARCHITECTURE}/${DISTRIBUTION}:${DISTRIBUTION_VERSION} \
             /host/package/${TASK_NAMESPACE}/test.sh \
             ${VERSION} \
+            ${POSTGRESQL_VERSION} \
             local \
             package/${PACKAGE}/${TASK_NAMESPACE}/repositories
           popd
diff --git a/dev/release/verify-rc.sh b/dev/release/verify-rc.sh
index f7eb05d..b7b9a6e 100755
--- a/dev/release/verify-rc.sh
+++ b/dev/release/verify-rc.sh
@@ -251,20 +251,23 @@ test_apt() {
     if [ "${TEST_STAGING:-0}" -gt 0 ]; then
       verify_type=staging-${verify_type}
     fi
-    for target in "debian:bookworm" \
-                  "ubuntu:jammy"; do \
-      show_info "Verifying ${target}..."
-      if ! docker run \
-           --rm \
-           --security-opt="seccomp=unconfined" \
-           --volume "${PWD}":/host:delegated \
-           "${target}" \
-           /host/package/apt/test.sh \
-           "${VERSION}" \
-           "${verify_type}"; then
-        echo "Failed to verify the APT repository for ${target}"
-        exit 1
-      fi
+    for postgresql_vesrion in 15 16; do
+      for target in "debian:bookworm" \
+                    "ubuntu:jammy"; do
+        show_info "Verifying ${target} with PostgreSQL 
${postgresql_version}..."
+        if ! docker run \
+             --rm \
+             --security-opt="seccomp=unconfined" \
+             --volume "${PWD}":/host:delegated \
+             "${target}" \
+             /host/package/apt/test.sh \
+             "${VERSION}" \
+             "${postgresql_vesrion}" \
+             "${verify_type}"; then
+          echo "Failed to verify the APT repository for ${target} with 
PostgreSQL ${postgresql_vesrion}"
+          exit 1
+        fi
+      done
     done
     popd
   else
diff --git a/package/apt/test.sh b/package/apt/test.sh
index 2cedaef..27113df 100755
--- a/package/apt/test.sh
+++ b/package/apt/test.sh
@@ -19,25 +19,26 @@
 
 set -eux
 
-if [ $# -lt 2 ]; then
-  echo "Usage: $0 VERSION rc"
-  echo "       $0 VERSION staging-rc"
-  echo "       $0 VERSION release"
-  echo "       $0 VERSION staging-release"
-  echo "       $0 VERSION local RELATIVE_REPOSITORIES_DIR"
-  echo " e.g.: $0 1.0.0 rc                # Verify 1.0.0 RC"
-  echo " e.g.: $0 1.0.0 staging-rc        # Verify 1.0.0 RC on staging"
-  echo " e.g.: $0 1.0.0 release           # Verify 1.0.0"
-  echo " e.g.: $0 1.0.0 staging-release   # Verify 1.0.0 on staging"
-  echo " e.g.: $0 1.0.0 local package/postgresql-15-pgdg/apt/repositories"
+if [ $# -lt 3 ]; then
+  echo "Usage: $0 VERSION POSTGRESQL_VESRION rc"
+  echo "       $0 VERSION POSTGRESQL_VESRION staging-rc"
+  echo "       $0 VERSION POSTGRESQL_VESRION release"
+  echo "       $0 VERSION POSTGRESQL_VESRION staging-release"
+  echo "       $0 VERSION POSTGRESQL_VESRION local RELATIVE_REPOSITORIES_DIR"
+  echo " e.g.: $0 1.0.0 15 rc              # Verify 1.0.0 RC with PostgreSQL 
15"
+  echo " e.g.: $0 1.0.0 15 staging-rc      # Verify 1.0.0 RC with PostgreSQL 
15 on staging"
+  echo " e.g.: $0 1.0.0 15 release         # Verify 1.0.0 with PostgreSQL 15"
+  echo " e.g.: $0 1.0.0 15 staging-release # Verify 1.0.0 with PostgreSQL 15 
on staging"
+  echo " e.g.: $0 1.0.0 15 local package/postgresql-15-pgdg/apt/repositories"
   echo "       # Verify 1.0.0 on local"
   exit 1
 fi
 
 VERSION="$1"
-TYPE="$2"
+POSTGRESQL_VERSION="$2"
+TYPE="$3"
 if [ "${TYPE}" = "local" ]; then
-  RELATIVE_REPOSITORIES_DIR="$3"
+  RELATIVE_REPOSITORIES_DIR="$4"
   REPOSITORIES_DIR=/host/${RELATIVE_REPOSITORIES_DIR}
 fi
 
@@ -110,13 +111,13 @@ echo "::group::Install built packages"
 
 ${APT_UPDATE}
 
-package=postgresql-15-pgdg-apache-arrow-flight-sql
+package=postgresql-${POSTGRESQL_VERSION}-pgdg-apache-arrow-flight-sql
 package_version=${VERSION}-1
 if [ "${TYPE}" = "local" ]; then
   ${APT_INSTALL} \
     
${REPOSITORIES_DIR}/${distribution}/pool/${code_name}/*/*/*/${package}_${package_version}_${architecture}.deb
 else
-  ${APT_INSTALL} postgresql-15-pgdg-apache-arrow-flight-sql=${package_version}
+  ${APT_INSTALL} 
postgresql-${POSTGRESQL_VERSION}-pgdg-apache-arrow-flight-sql=${package_version}
 fi
 
 echo "::endgroup::"
diff --git a/package/postgresql-15-pgdg/apt/debian-bookworm-amd64/Dockerfile 
b/package/postgresql-15-pgdg/apt/debian-bookworm-amd64/Dockerfile
index 35f0225..546a8ac 100644
--- a/package/postgresql-15-pgdg/apt/debian-bookworm-amd64/Dockerfile
+++ b/package/postgresql-15-pgdg/apt/debian-bookworm-amd64/Dockerfile
@@ -36,6 +36,7 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     ca-certificates \
+    gpg \
     lsb-release \
     wget && \
   distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z') && \
@@ -44,10 +45,14 @@ RUN \
   apt install -y -V ${quiet} \
     ./apache-arrow-apt-source-latest-${code_name}.deb && \
   rm apache-arrow-apt-source-latest-${code_name}.deb && \
-  echo "deb http://apt.postgresql.org/pub/repos/apt/ ${code_name}-pgdg main" > 
\
-    /etc/apt/sources.list.d/pgdg.list && \
-  wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
-    apt-key add - && \
+  wget -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
+    gpg --no-default-keyring --keyring /usr/share/keyrings/pgdg.gpg --import - 
&& \
+  (echo "Types: deb"; \
+   echo "URIs: http://apt.postgresql.org/pub/repos/apt";; \
+   echo "Suites: ${code_name}-pgdg"; \
+   echo "Components: main"; \
+   echo "Signed-By: /usr/share/keyrings/pgdg.gpg") | \
+    tee /etc/apt/sources.list.d/pgdg.sources && \
   apt update && \
   apt install -y -V ${quiet} \
     build-essential \
diff --git a/package/postgresql-15-pgdg/apt/ubuntu-jammy-amd64/Dockerfile 
b/package/postgresql-15-pgdg/apt/ubuntu-jammy-amd64/Dockerfile
index fe9af26..3254391 100644
--- a/package/postgresql-15-pgdg/apt/ubuntu-jammy-amd64/Dockerfile
+++ b/package/postgresql-15-pgdg/apt/ubuntu-jammy-amd64/Dockerfile
@@ -32,6 +32,7 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     ca-certificates \
+    gpg \
     lsb-release \
     wget && \
   distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z') && \
@@ -40,10 +41,14 @@ RUN \
   apt install -y -V ${quiet} \
     ./apache-arrow-apt-source-latest-${code_name}.deb && \
   rm apache-arrow-apt-source-latest-${code_name}.deb && \
-  echo "deb http://apt.postgresql.org/pub/repos/apt/ ${code_name}-pgdg main" > 
\
-    /etc/apt/sources.list.d/pgdg.list && \
-  wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
-    apt-key add - && \
+  wget -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
+    gpg --no-default-keyring --keyring /usr/share/keyrings/pgdg.gpg --import - 
&& \
+  (echo "Types: deb"; \
+   echo "URIs: http://apt.postgresql.org/pub/repos/apt";; \
+   echo "Suites: ${code_name}-pgdg"; \
+   echo "Components: main"; \
+   echo "Signed-By: /usr/share/keyrings/pgdg.gpg") | \
+    tee /etc/apt/sources.list.d/pgdg.sources && \
   apt update && \
   apt install -y -V ${quiet} \
     build-essential \
diff --git a/package/postgresql-16-pgdg/Rakefile 
b/package/postgresql-16-pgdg/Rakefile
new file mode 100644
index 0000000..d754c04
--- /dev/null
+++ b/package/postgresql-16-pgdg/Rakefile
@@ -0,0 +1,32 @@
+# -*- ruby -*-
+#
+# 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.
+
+require_relative "../arrow-flight-sql-postgresql-package-task"
+
+class PostgreSQL16PGDGPackageTask < ArrowFlightSQLPostgreSQLPackageTask
+  def initialize
+    super("postgresql-16-pgdg-apache-arrow-flight-sql")
+  end
+
+  def enable_yum?
+    false
+  end
+end
+
+PostgreSQL16PGDGPackageTask.new.define
diff --git a/package/postgresql-15-pgdg/apt/debian-bookworm-amd64/Dockerfile 
b/package/postgresql-16-pgdg/apt/debian-bookworm-amd64/Dockerfile
similarity index 80%
copy from package/postgresql-15-pgdg/apt/debian-bookworm-amd64/Dockerfile
copy to package/postgresql-16-pgdg/apt/debian-bookworm-amd64/Dockerfile
index 35f0225..01e6e4b 100644
--- a/package/postgresql-15-pgdg/apt/debian-bookworm-amd64/Dockerfile
+++ b/package/postgresql-16-pgdg/apt/debian-bookworm-amd64/Dockerfile
@@ -36,6 +36,7 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     ca-certificates \
+    gpg \
     lsb-release \
     wget && \
   distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z') && \
@@ -44,10 +45,14 @@ RUN \
   apt install -y -V ${quiet} \
     ./apache-arrow-apt-source-latest-${code_name}.deb && \
   rm apache-arrow-apt-source-latest-${code_name}.deb && \
-  echo "deb http://apt.postgresql.org/pub/repos/apt/ ${code_name}-pgdg main" > 
\
-    /etc/apt/sources.list.d/pgdg.list && \
-  wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
-    apt-key add - && \
+  wget -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
+    gpg --no-default-keyring --keyring /usr/share/keyrings/pgdg.gpg --import - 
&& \
+  (echo "Types: deb"; \
+   echo "URIs: http://apt.postgresql.org/pub/repos/apt";; \
+   echo "Suites: ${code_name}-pgdg"; \
+   echo "Components: main"; \
+   echo "Signed-By: /usr/share/keyrings/pgdg.gpg") | \
+    tee /etc/apt/sources.list.d/pgdg.sources && \
   apt update && \
   apt install -y -V ${quiet} \
     build-essential \
@@ -59,5 +64,5 @@ RUN \
     libkrb5-dev \
     meson \
     ninja-build \
-    postgresql-server-dev-15 && \
+    postgresql-server-dev-16 && \
   apt clean
diff --git a/package/postgresql-15-pgdg/apt/ubuntu-jammy-amd64/Dockerfile 
b/package/postgresql-16-pgdg/apt/ubuntu-jammy-amd64/Dockerfile
similarity index 79%
copy from package/postgresql-15-pgdg/apt/ubuntu-jammy-amd64/Dockerfile
copy to package/postgresql-16-pgdg/apt/ubuntu-jammy-amd64/Dockerfile
index fe9af26..4e8a6bb 100644
--- a/package/postgresql-15-pgdg/apt/ubuntu-jammy-amd64/Dockerfile
+++ b/package/postgresql-16-pgdg/apt/ubuntu-jammy-amd64/Dockerfile
@@ -32,6 +32,7 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     ca-certificates \
+    gpg \
     lsb-release \
     wget && \
   distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z') && \
@@ -40,10 +41,14 @@ RUN \
   apt install -y -V ${quiet} \
     ./apache-arrow-apt-source-latest-${code_name}.deb && \
   rm apache-arrow-apt-source-latest-${code_name}.deb && \
-  echo "deb http://apt.postgresql.org/pub/repos/apt/ ${code_name}-pgdg main" > 
\
-    /etc/apt/sources.list.d/pgdg.list && \
-  wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
-    apt-key add - && \
+  wget -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
+    gpg --no-default-keyring --keyring /usr/share/keyrings/pgdg.gpg --import - 
&& \
+  (echo "Types: deb"; \
+   echo "URIs: http://apt.postgresql.org/pub/repos/apt";; \
+   echo "Suites: ${code_name}-pgdg"; \
+   echo "Components: main"; \
+   echo "Signed-By: /usr/share/keyrings/pgdg.gpg") | \
+    tee /etc/apt/sources.list.d/pgdg.sources && \
   apt update && \
   apt install -y -V ${quiet} \
     build-essential \
@@ -55,5 +60,5 @@ RUN \
     libkrb5-dev \
     meson \
     ninja-build \
-    postgresql-server-dev-15 && \
+    postgresql-server-dev-16 && \
   apt clean
diff --git a/package/postgresql-16-pgdg/debian/changelog 
b/package/postgresql-16-pgdg/debian/changelog
new file mode 100644
index 0000000..e69de29
diff --git a/package/postgresql-16-pgdg/debian/control 
b/package/postgresql-16-pgdg/debian/control
new file mode 100644
index 0000000..eb0ba89
--- /dev/null
+++ b/package/postgresql-16-pgdg/debian/control
@@ -0,0 +1,41 @@
+# 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.
+
+Source: postgresql-16-pgdg-apache-arrow-flight-sql
+Section: database
+Priority: optional
+Maintainer: Apache Arrow Developers <[email protected]>
+Build-Depends:
+  cmake,
+  debhelper-compat (= 13),
+  libarrow-flight-sql-dev,
+  libkrb5-dev,
+  meson,
+  postgresql-server-dev-16
+Standards-Version: 4.6.0
+Homepage: https://arrow.apache.org/flight-sql-postgresql/
+
+Package: postgresql-16-pgdg-apache-arrow-flight-sql
+Architecture: any
+Depends:
+  ${misc:Depends},
+  ${shlibs:Depends},
+  postgresql-16
+Description: Apache Arrow Flight SQL adapter for PostgreSQL
+ .
+ It provides a PostgreSQL module that adds Apache Arrow Flight SQL
+ interface to PostgreSQL.
diff --git a/package/postgresql-16-pgdg/debian/copyright 
b/package/postgresql-16-pgdg/debian/copyright
new file mode 100644
index 0000000..c2452ee
--- /dev/null
+++ b/package/postgresql-16-pgdg/debian/copyright
@@ -0,0 +1,26 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Contact: Apache Arrow Developers <[email protected]>
+Source: https://packages.groonga.org/source/pgroonga/
+
+Files: *
+Copyright: 2022-2023 Apache Arrow Developers <[email protected]>
+License: Apache-2.0
+
+License: Apache-2.0
+ 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
+ .
+      https://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.
+ .
+ On Debian systems, the full text of the Apache Software License version 2 can
+ be found in the file `/usr/share/common-licenses/Apache-2.0'.
diff --git a/package/postgresql-16-pgdg/debian/rules 
b/package/postgresql-16-pgdg/debian/rules
new file mode 100755
index 0000000..1f4fdc9
--- /dev/null
+++ b/package/postgresql-16-pgdg/debian/rules
@@ -0,0 +1,37 @@
+#!/usr/bin/make -f
+# -*- makefile-gmake -*-
+#
+# 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.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+export DEB_BUILD_MAINT_OPTIONS=reproducible=-timeless
+
+%:
+       dh $@
+
+override_dh_auto_configure:
+       dh_auto_configure                       \
+         --buildsystem=meson+ninja             \
+         --                                    \
+         --buildtype=debugoptimized
+
+override_dh_auto_test:

Reply via email to