diff --git a/.gitignore b/.gitignore index c8724bd..13ff518 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ results/ *.diffs *.out *.BAK +*.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index f91a896..a20d8c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/Makefile b/Makefile index 19984f6..632c5bd 100644 --- a/Makefile +++ b/Makefile @@ -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 + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..80c0225 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +pg-sampletolog (0.0.2-1) unstable; urgency=low + + * Initial release. + + -- Adrien Nayrat Sun, 10 Feb 2019 11:24:39 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..ac7f12f --- /dev/null +++ b/debian/control @@ -0,0 +1,55 @@ +Source: pg-sampletolog +Section: database +Priority: optional +Maintainer: Adrien Nayrat +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) + diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 0000000..3d7c6a5 --- /dev/null +++ b/debian/control.in @@ -0,0 +1,18 @@ +Source: pg-sampletolog +Section: database +Priority: optional +Maintainer: Adrien Nayrat +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) diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..a311455 --- /dev/null +++ b/debian/copyright @@ -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. + diff --git a/debian/pgversions b/debian/pgversions new file mode 100644 index 0000000..0245897 --- /dev/null +++ b/debian/pgversions @@ -0,0 +1 @@ +9.4+ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..00eac66 --- /dev/null +++ b/debian/rules @@ -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 $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..d3827e7 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..1385119 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,3 @@ +Depends: @, postgresql-contrib-11, postgresql-server-dev-all +Tests: installcheck +Restrictions: allow-stderr diff --git a/debian/tests/control.in b/debian/tests/control.in new file mode 100644 index 0000000..3266963 --- /dev/null +++ b/debian/tests/control.in @@ -0,0 +1,3 @@ +Depends: @, postgresql-contrib-PGVERSION, postgresql-server-dev-all +Tests: installcheck +Restrictions: allow-stderr diff --git a/debian/tests/installcheck b/debian/tests/installcheck new file mode 100755 index 0000000..d378813 --- /dev/null +++ b/debian/tests/installcheck @@ -0,0 +1,5 @@ +#!/bin/sh + +set -eu + +pg_buildext installcheck diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..6a1ac9d --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts="uversionmangle=s/_/./g" \ + https://github.com/anayrat/pg_sampletolog/releases .*/archive/REL(.*).tar.gz