diff --git a/.gitignore b/.gitignore index 2e47aec..0ec196a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ /.vscode /bench-results.txt /bench-report.txt +/build-*/ /aggs_for_vecs*.zip /regression.* /results diff --git a/Makefile b/Makefile index ebfc241..03b20bc 100644 --- a/Makefile +++ b/Makefile @@ -60,3 +60,11 @@ release: .PHONY: test bench release +deb: + make clean + git archive --format tar --prefix=aggs-for-vecs-$(EXTENSION_VERSION)/ master |gzip >../aggs-for-vecs_$(EXTENSION_VERSION).orig.tar.gz + pg_buildext updatecontrol + make -f debian/rules debian/control + dh clean + make all + dpkg-buildpackage -us -uc diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000..a9f138f --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,5 @@ +.debhelper +/debhelper-build-stamp +/files +/postgresql-* +/tmp diff --git a/debian/README.md b/debian/README.md new file mode 100644 index 0000000..0db19e4 --- /dev/null +++ b/debian/README.md @@ -0,0 +1,34 @@ +# Debian Package Build Support + +To setup to build for multiple Postgres releases: + +```sh +sudo apt install debhelper + +# Add Postgres Debian repository key +wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - + +# Add Debian repository +echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" |sudo tee /etc/apt/sources.list.d/pgdg.list +sudo apt update + +# Install server support +sudo apt -y install \ + postgresql-9.6 postgresql-client-9.6 postgresql-server-dev-9.6 \ + postgresql-10 postgresql-client-10 postgresql-server-dev-10 \ + postgresql-11 postgresql-client-11 postgresql-server-dev-11 \ + postgresql-12 postgresql-client-12 postgresql-server-dev-12 \ + postgresql-13 postgresql-client-13 postgresql-server-dev-13 +``` + +Then edit `/etc/postgresql-common/supported_versions` to replace contents with + +``` +pgdg +``` + +From that point you can build all supported packages with: + +```sh +make deb +``` diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..119cb9c --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +aggs-for-vecs (1.3.0-1) UNRELEASED; urgency=medium + + * Initial release. + + -- Matt Tue, 01 Feb 2022 15:15:12 +1300 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..5147610 --- /dev/null +++ b/debian/control @@ -0,0 +1,69 @@ +Source: aggs-for-vecs +Section: database +Priority: optional +Maintainer: Debian PostgreSQL Maintainers +Uploaders: + Matt , +Build-Depends: + debhelper-compat (= 13), + postgresql-all (>= 217~), +Standards-Version: 4.5.1 +Rules-Requires-Root: no +Homepage: https://github.com/pjungwir/aggs_for_vecs +Vcs-Browser: https://salsa.debian.org/postgresql/aggs-for-vecs +Vcs-Git: https://salsa.debian.org/postgresql/aggs-for-vecs.git + +Package: postgresql-9.6-aggs-for-vecs +Architecture: any +Depends: + postgresql-9.6, + ${misc:Depends}, + ${shlibs:Depends}, +Description: Postgres C extension with aggregate functions for array inputs. + This is a C-based Postgres extension offering various aggregate functions + like min, max, avg, and var_samp that operate on arrays instead of scalars. + It treats each array as a "vector" and handles each element independently. + +Package: postgresql-10-aggs-for-vecs +Architecture: any +Depends: + postgresql-10, + ${misc:Depends}, + ${shlibs:Depends}, +Description: Postgres C extension with aggregate functions for array inputs. + This is a C-based Postgres extension offering various aggregate functions + like min, max, avg, and var_samp that operate on arrays instead of scalars. + It treats each array as a "vector" and handles each element independently. + +Package: postgresql-11-aggs-for-vecs +Architecture: any +Depends: + postgresql-11, + ${misc:Depends}, + ${shlibs:Depends}, +Description: Postgres C extension with aggregate functions for array inputs. + This is a C-based Postgres extension offering various aggregate functions + like min, max, avg, and var_samp that operate on arrays instead of scalars. + It treats each array as a "vector" and handles each element independently. + +Package: postgresql-12-aggs-for-vecs +Architecture: any +Depends: + postgresql-12, + ${misc:Depends}, + ${shlibs:Depends}, +Description: Postgres C extension with aggregate functions for array inputs. + This is a C-based Postgres extension offering various aggregate functions + like min, max, avg, and var_samp that operate on arrays instead of scalars. + It treats each array as a "vector" and handles each element independently. + +Package: postgresql-13-aggs-for-vecs +Architecture: any +Depends: + postgresql-13, + ${misc:Depends}, + ${shlibs:Depends}, +Description: Postgres C extension with aggregate functions for array inputs. + This is a C-based Postgres extension offering various aggregate functions + like min, max, avg, and var_samp that operate on arrays instead of scalars. + It treats each array as a "vector" and handles each element independently. diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 0000000..f6519f7 --- /dev/null +++ b/debian/control.in @@ -0,0 +1,25 @@ +Source: aggs-for-vecs +Section: database +Priority: optional +Maintainer: Debian PostgreSQL Maintainers +Uploaders: + Matt , +Build-Depends: + debhelper-compat (= 13), + postgresql-all (>= 217~), +Standards-Version: 4.5.1 +Rules-Requires-Root: no +Homepage: https://github.com/pjungwir/aggs_for_vecs +Vcs-Browser: https://salsa.debian.org/postgresql/aggs-for-vecs +Vcs-Git: https://salsa.debian.org/postgresql/aggs-for-vecs.git + +Package: postgresql-PGVERSION-aggs-for-vecs +Architecture: any +Depends: + postgresql-PGVERSION, + ${misc:Depends}, + ${shlibs:Depends}, +Description: Postgres C extension with aggregate functions for array inputs. + This is a C-based Postgres extension offering various aggregate functions + like min, max, avg, and var_samp that operate on arrays instead of scalars. + It treats each array as a "vector" and handles each element independently. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..0cc8e27 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,24 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: aggs_for_vecs +Source: https://github.com/pjungwir/aggs_for_vecs + +Files: * +Copyright: Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group + Portions Copyright (c) 1994, The Regents of the University of California +License: PostgreSQL + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose, without fee, and without a written agreement + is hereby granted, provided that the above copyright notice and this + paragraph and the following two paragraphs appear in all copies. + . + IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING + LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS + DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + . + THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO + PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. diff --git a/debian/gitlab-ci.yml b/debian/gitlab-ci.yml new file mode 100644 index 0000000..67e4816 --- /dev/null +++ b/debian/gitlab-ci.yml @@ -0,0 +1 @@ +include: https://salsa.debian.org/postgresql/postgresql-common/raw/master/gitlab/gitlab-ci.yml diff --git a/debian/pgversions b/debian/pgversions new file mode 100644 index 0000000..7e9cdc1 --- /dev/null +++ b/debian/pgversions @@ -0,0 +1 @@ +9.6+ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..ceb0f0a --- /dev/null +++ b/debian/rules @@ -0,0 +1,36 @@ +#!/usr/bin/make -f + +%: + dh $@ --with pgxs + +override_dh_installdocs: + dh_installdocs --all README.* + +# if the package does not support building from subdirectories, use +# `--with pgxs_loop` above. +# +# change the way tests are run: +# override_dh_pgxs_test: +# +pg_buildext installcheck . . postgresql-%v-aggs-for-vecs + +# classic `pg_buildext` interface: + +#include /usr/share/postgresql-common/pgxs_debian_control.mk +# +#override_dh_auto_build: +# +pg_buildext build build-%v +# +#override_dh_auto_test: +# # nothing to do here, see debian/tests/* instead +# +#override_dh_auto_install: +# +pg_buildext install build-%v postgresql-%v-aggs-for-vecs +# +#override_dh_installdocs: +# dh_installdocs --all README.* +# +#override_dh_auto_clean: +# +pg_buildext clean build-%v +# +#%: +# dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..74b0464 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,5 @@ +Depends: + make, + @, +Tests: installcheck +Restrictions: allow-stderr diff --git a/debian/tests/installcheck b/debian/tests/installcheck new file mode 100755 index 0000000..5a20e78 --- /dev/null +++ b/debian/tests/installcheck @@ -0,0 +1,3 @@ +#!/bin/sh + +pg_buildext installcheck diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..170e0e4 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=4 +https://github.com/pjungwir/aggs_for_vecs/releases .*/(.*).tar.gz