Skip to content

Commit

Permalink
Debian packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
anayrat committed Feb 10, 2019
1 parent b086b95 commit 77b558a
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ results/
*.diffs
*.out
*.BAK
*.zip
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Changelog
=========

2019-01-27 v0.0.2:
2019-02-10 v0.0.2:
- Change formating
- Fix missing utility statements
- Add debian packaging

2019-01-27 v0.0.1:

Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ PG_CONFIG = pg_config

PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

DEBUILD_ROOT = /tmp/$(EXTENSION)

deb: release-zip
mkdir -p $(DEBUILD_ROOT) && rm -rf $(DEBUILD_ROOT)/*
unzip ./${EXTENSION}-$(EXTVERSION).zip -d $(DEBUILD_ROOT)
cd $(DEBUILD_ROOT)/${EXTENSION}-$(EXTVERSION) && make -f debian/rules orig
cd $(DEBUILD_ROOT)/${EXTENSION}-$(EXTVERSION) && debuild -us -uc -sa

5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pg-sampletolog (0.0.2-1) unstable; urgency=low

* Initial release.

-- Adrien Nayrat <[email protected]> Sun, 10 Feb 2019 11:24:39 +0100
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
55 changes: 55 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Source: pg-sampletolog
Section: database
Priority: optional
Maintainer: Adrien Nayrat <[email protected]>
Standards-Version: 4.1.3
Build-Depends: debhelper (>=9~), postgresql-server-dev-all (>= 141~)
Homepage: https://github.com/anayrat/pg_sampletolog
Vcs-Browser: https://github.com/anayrat/pg_sampletolog
Vcs-Git: https://github.com/anayrat/pg_sampletolog.git

Package: postgresql-9.4-pg-sampletolog
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-9.4,
postgresql-contrib-9.4
Description: Postgres extension to sample statements or transactions to logs.
pg_sampletolog is a PostgreSQL extension which allows to sample statements
and/or transactions to logs. It add in PostgreSQL (from 9.4 to 11) same kind
of statement sampling added in PostgreSQL 12 (currently not released)

Package: postgresql-9.5-pg-sampletolog
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-9.5,
postgresql-contrib-9.5
Description: Postgres extension to sample statements or transactions to logs.
pg_sampletolog is a PostgreSQL extension which allows to sample statements
and/or transactions to logs. It add in PostgreSQL (from 9.4 to 11) same kind
of statement sampling added in PostgreSQL 12 (currently not released)

Package: postgresql-9.6-pg-sampletolog
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-9.6,
postgresql-contrib-9.6
Description: Postgres extension to sample statements or transactions to logs.
pg_sampletolog is a PostgreSQL extension which allows to sample statements
and/or transactions to logs. It add in PostgreSQL (from 9.4 to 11) same kind
of statement sampling added in PostgreSQL 12 (currently not released)

Package: postgresql-10-pg-sampletolog
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-10,
postgresql-contrib-10
Description: Postgres extension to sample statements or transactions to logs.
pg_sampletolog is a PostgreSQL extension which allows to sample statements
and/or transactions to logs. It add in PostgreSQL (from 9.4 to 11) same kind
of statement sampling added in PostgreSQL 12 (currently not released)

Package: postgresql-11-pg-sampletolog
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-11,
postgresql-contrib-11
Description: Postgres extension to sample statements or transactions to logs.
pg_sampletolog is a PostgreSQL extension which allows to sample statements
and/or transactions to logs. It add in PostgreSQL (from 9.4 to 11) same kind
of statement sampling added in PostgreSQL 12 (currently not released)

18 changes: 18 additions & 0 deletions debian/control.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Source: pg-sampletolog
Section: database
Priority: optional
Maintainer: Adrien Nayrat <[email protected]>
Standards-Version: 4.1.3
Build-Depends: debhelper (>=9~), postgresql-server-dev-all (>= 141~)
Homepage: https://github.com/anayrat/pg_sampletolog
Vcs-Browser: https://github.com/anayrat/pg_sampletolog
Vcs-Git: https://github.com/anayrat/pg_sampletolog.git

Package: postgresql-PGVERSION-pg-sampletolog
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-PGVERSION,
postgresql-contrib-PGVERSION
Description: Postgres extension to sample statements or transactions to logs.
pg_sampletolog is a PostgreSQL extension which allows to sample statements
and/or transactions to logs. It add in PostgreSQL (from 9.4 to 11) same kind
of statement sampling added in PostgreSQL 12 (currently not released)
18 changes: 18 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Portions Copyright (c) 2019, Adrien Nayrat

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 COPYRIGHT HOLDER 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 COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE COPYRIGHT HOLDER 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 COPYRIGHT HOLDER HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

1 change: 1 addition & 0 deletions debian/pgversions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9.4+
28 changes: 28 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/make -f

PKGVER = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
EXCLUDE = --exclude-vcs --exclude=debian

include /usr/share/postgresql-common/pgxs_debian_control.mk

override_dh_auto_build:
# do nothing

override_dh_auto_test:
# nothing to do here, upstream tests used, see debian/tests/*

override_dh_auto_install:
# build all supported versions
+pg_buildext loop postgresql-%v-pg-sampletolog

override_dh_installdocs:
dh_installdocs --all README.md
rm -rvf debian/*/usr/share/doc/postgresql-doc-*

override_dh_installchangelogs:
dh_installchangelogs CHANGELOG.md upstream

orig: debian/control clean
cd .. && tar czf pg-sampletolog_$(PKGVER).orig.tar.gz $(EXCLUDE) pg_sampletolog-$(PKGVER)
%:
dh $@
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0
3 changes: 3 additions & 0 deletions debian/tests/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Depends: @, postgresql-contrib-11, postgresql-server-dev-all
Tests: installcheck
Restrictions: allow-stderr
3 changes: 3 additions & 0 deletions debian/tests/control.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Depends: @, postgresql-contrib-PGVERSION, postgresql-server-dev-all
Tests: installcheck
Restrictions: allow-stderr
5 changes: 5 additions & 0 deletions debian/tests/installcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -eu

pg_buildext installcheck
3 changes: 3 additions & 0 deletions debian/watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version=3
opts="uversionmangle=s/_/./g" \
https://github.com/anayrat/pg_sampletolog/releases .*/archive/REL(.*).tar.gz

0 comments on commit 77b558a

Please sign in to comment.