Skip to content

Commit 78d3a67

Browse files
committed
Debian packaging
1 parent 4c7549e commit 78d3a67

File tree

13 files changed

+134
-1
lines changed

13 files changed

+134
-1
lines changed

Makefile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MODULE_big = pg_wait_sampling
44
OBJS = pg_wait_sampling.o collector.o compat.o
55

66
EXTENSION = pg_wait_sampling
7-
EXTVERSION = 1.1
7+
EXTVERSION = 1.1.1
88
DATA_built = pg_wait_sampling--$(EXTVERSION).sql
99
DATA = pg_wait_sampling--1.0--1.1.sql
1010

@@ -35,3 +35,23 @@ dist:
3535

3636
dist/$(EXTENSION)-$(EXTVERSION).zip:
3737
git archive --format zip --prefix=$(EXTENSION)-$(EXTVERSION)/ --output $@ master
38+
39+
DEBUILD_ROOT = /tmp/$(EXTENSION)
40+
41+
all:
42+
43+
release-zip: all
44+
git archive --format zip --prefix=$(EXTENSION)-${EXTVERSION}/ --output ./$(EXTENSION)-${EXTVERSION}.zip HEAD
45+
unzip ./$(EXTENSION)-$(EXTVERSION).zip
46+
rm ./$(EXTENSION)-$(EXTVERSION).zip
47+
rm ./$(EXTENSION)-$(EXTVERSION)/.gitignore
48+
sed -i -e "s/__VERSION__/$(EXTVERSION)/g" ./$(EXTENSION)-$(EXTVERSION)/META.json
49+
zip -r ./$(EXTENSION)-$(EXTVERSION).zip ./$(EXTENSION)-$(EXTVERSION)/
50+
rm ./$(EXTENSION)-$(EXTVERSION) -rf
51+
52+
53+
deb: release-zip
54+
mkdir -p $(DEBUILD_ROOT) && rm -rf $(DEBUILD_ROOT)/*
55+
unzip ./${EXTENSION}-$(EXTVERSION).zip -d $(DEBUILD_ROOT)
56+
cd $(DEBUILD_ROOT)/${EXTENSION}-$(EXTVERSION) && make -f debian/rules orig
57+
cd $(DEBUILD_ROOT)/${EXTENSION}-$(EXTVERSION) && debuild -us -uc -sa

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pg-wait-sampling (1.1.1) UNRELEASED; urgency=medium
2+
3+
* Initial release.
4+
5+
-- Adrien Nayrat <[email protected]> Wed, 17 Jun 2020 12:26:59 +0000

debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

debian/control

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Source: pg-wait-sampling
2+
Section: database
3+
Priority: optional
4+
Maintainer: Adrien Nayrat <[email protected]>
5+
Standards-Version: 4.1.3
6+
Build-Depends: debhelper (>=9~), postgresql-server-dev-all (>= 141~)
7+
Homepage: https://github.com/postgrespro/pg_wait-sampling
8+
Vcs-Browser: https://github.com/postgrespro/pg_wait-sampling
9+
Vcs-Git: https://github.com/postgrespro/pg_wait-sampling.git
10+
11+
Package: postgresql-9.6-pg-wait-sampling
12+
Architecture: any
13+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-9.6,
14+
postgresql-contrib-9.6
15+
Description: pg_wait-sampling provides functions for detailed per backend
16+
and per query statistics about PostgreSQL wait events
17+
18+
Package: postgresql-10-pg-wait-sampling
19+
Architecture: any
20+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-10,
21+
postgresql-contrib-10
22+
Description: pg_wait-sampling provides functions for detailed per backend
23+
and per query statistics about PostgreSQL wait events
24+
25+
Package: postgresql-11-pg-wait-sampling
26+
Architecture: any
27+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-11,
28+
postgresql-contrib-11
29+
Description: pg_wait-sampling provides functions for detailed per backend
30+
and per query statistics about PostgreSQL wait events
31+
32+
Package: postgresql-12-pg-wait-sampling
33+
Architecture: any
34+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-12,
35+
postgresql-contrib-12
36+
Description: pg_wait-sampling provides functions for detailed per backend
37+
and per query statistics about PostgreSQL wait events

debian/control.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Source: pg-wait-sampling
2+
Section: database
3+
Priority: optional
4+
Maintainer: Adrien Nayrat <[email protected]>
5+
Standards-Version: 4.1.3
6+
Build-Depends: debhelper (>=9~), postgresql-server-dev-all (>= 141~)
7+
Homepage: https://github.com/postgrespro/pg_wait-sampling
8+
Vcs-Browser: https://github.com/postgrespro/pg_wait-sampling
9+
Vcs-Git: https://github.com/postgrespro/pg_wait-sampling.git
10+
11+
Package: postgresql-PGVERSION-pg-wait-sampling
12+
Architecture: any
13+
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-PGVERSION,
14+
postgresql-contrib-PGVERSION
15+
Description: pg_wait-sampling provides functions for detailed per backend
16+
and per query statistics about PostgreSQL wait events

debian/copyright

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
pg_wait_sampling is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
2+
3+
Copyright (c) 2015-2017, Postgres Professional
4+
Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
5+
Portions Copyright (c) 1994, The Regents of the University of California
6+
7+
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.
8+
9+
IN NO EVENT SHALL POSTGRES PROFESSIONAL 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 POSTGRES PROFESSIONAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10+
11+
POSTGRES PROFESSIONAL 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 POSTGRES PROFESSIONAL HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

debian/pgversions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9.6+

debian/rules

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/make -f
2+
3+
PKGVER = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
4+
EXCLUDE = --exclude-vcs --exclude=debian
5+
6+
include /usr/share/postgresql-common/pgxs_debian_control.mk
7+
8+
override_dh_auto_build:
9+
# do nothing
10+
11+
override_dh_auto_test:
12+
# nothing to do here, upstream tests used, see debian/tests/*
13+
14+
override_dh_auto_install:
15+
# build all supported versions
16+
+pg_buildext loop postgresql-%v-pg-wait-sampling
17+
18+
override_dh_installdocs:
19+
dh_installdocs --all README.md
20+
21+
override_dh_auto_clean:
22+
$(MAKE) clean USE_PGXS=1 PG_CONFIG=/usr/bin/pg_config
23+
24+
orig: debian/control clean
25+
cd .. && tar czf pg-wait-sampling_$(PKGVER).orig.tar.gz $(EXCLUDE) pg_wait_sampling-$(PKGVER)
26+
%:
27+
dh $@

debian/source/format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0

debian/tests/control

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Depends: @, postgresql-server-dev-all
2+
Tests: installcheck
3+
Restrictions: allow-stderr

debian/tests/control.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Depends: @, postgresql-server-dev-all
2+
Tests: installcheck
3+
Restrictions: allow-stderr

debian/tests/installcheck

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
pg_buildext -o "shared_preload_libraries = 'pg_wait_sampling'" installcheck

debian/watch

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version=3
2+
opts="uversionmangle=s/_/./g" \
3+
https://github.com/postgrespro/pg_wait_sampling/releases .*/archive/REL(.*).tar.gz

0 commit comments

Comments
 (0)