Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debian package build support #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/.vscode
/bench-results.txt
/bench-report.txt
/build-*/
/aggs_for_vecs*.zip
/regression.*
/results
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.debhelper
/debhelper-build-stamp
/files
/postgresql-*
/tmp
34 changes: 34 additions & 0 deletions debian/README.md
Original file line number Diff line number Diff line change
@@ -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
```
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
aggs-for-vecs (1.3.0-1) UNRELEASED; urgency=medium

* Initial release.

-- Matt <[email protected]> Tue, 01 Feb 2022 15:15:12 +1300
69 changes: 69 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Source: aggs-for-vecs
Section: database
Priority: optional
Maintainer: Debian PostgreSQL Maintainers <[email protected]>
Uploaders:
Matt <[email protected]>,
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.
25 changes: 25 additions & 0 deletions debian/control.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Source: aggs-for-vecs
Section: database
Priority: optional
Maintainer: Debian PostgreSQL Maintainers <[email protected]>
Uploaders:
Matt <[email protected]>,
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.
24 changes: 24 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions debian/gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: https://salsa.debian.org/postgresql/postgresql-common/raw/master/gitlab/gitlab-ci.yml
1 change: 1 addition & 0 deletions debian/pgversions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9.6+
36 changes: 36 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -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 $@
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
5 changes: 5 additions & 0 deletions debian/tests/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Depends:
make,
@,
Tests: installcheck
Restrictions: allow-stderr
3 changes: 3 additions & 0 deletions debian/tests/installcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

pg_buildext installcheck
2 changes: 2 additions & 0 deletions debian/watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version=4
https://github.com/pjungwir/aggs_for_vecs/releases .*/(.*).tar.gz