diff --git a/Makefile b/Makefile index 5a3278c..9d45108 100644 --- a/Makefile +++ b/Makefile @@ -23,19 +23,39 @@ PG_VERSION := $(shell pg_config --version | awk {'print $$1 $$2'}) MAJOR := $(shell echo $(PG_VERSION) | sed -e 's/\.[^./]*$$//') ifneq (,$(findstring PostgreSQL14,$(MAJOR))) - CP := $(shell cp pg_stat_monitor--1.0.14.sql.in pg_stat_monitor--1.0.sql) + ifneq (,$(wildcard ../pg_stat_monitor--1.0.14.sql.in)) + CP := $(shell cp ../pg_stat_monitor--1.0.14.sql.in ../pg_stat_monitor--1.0.sql) + endif + ifneq (,$(wildcard pg_stat_monitor--1.0.14.sql.in)) + CP := $(shell cp pg_stat_monitor--1.0.14.sql.in pg_stat_monitor--1.0.sql) + endif endif ifneq (,$(findstring PostgreSQL13,$(MAJOR))) - CP := $(shell cp pg_stat_monitor--1.0.13.sql.in pg_stat_monitor--1.0.sql) + ifneq (,$(wildcard ../pg_stat_monitor--1.0.13.sql.in)) + CP := $(shell cp ../pg_stat_monitor--1.0.13.sql.in ../pg_stat_monitor--1.0.sql) + endif + ifneq (,$(wildcard pg_stat_monitor--1.0.13.sql.in)) + CP := $(shell cp pg_stat_monitor--1.0.13.sql.in pg_stat_monitor--1.0.sql) + endif endif ifneq (,$(findstring PostgreSQL12,$(MAJOR))) - CP := $(shell cp pg_stat_monitor--1.0.sql.in pg_stat_monitor--1.0.sql) + ifneq (,$(wildcard ../pg_stat_monitor--1.0.sql.in)) + CP := $(shell cp ../pg_stat_monitor--1.0.sql.in ../pg_stat_monitor--1.0.sql) + endif + ifneq (,$(wildcard pg_stat_monitor--1.0.sql.in)) + CP := $(shell cp pg_stat_monitor--1.0.sql.in pg_stat_monitor--1.0.sql) + endif endif ifneq (,$(findstring PostgreSQL11,$(MAJOR))) - CP := $(shell cp pg_stat_monitor--1.0.sql.in pg_stat_monitor--1.0.sql) + ifneq (,$(wildcard ../pg_stat_monitor--1.0.sql.in)) + CP := $(shell cp ../pg_stat_monitor--1.0.sql.in ../pg_stat_monitor--1.0.sql) + endif + ifneq (,$(wildcard pg_stat_monitor--1.0.sql.in)) + CP := $(shell cp pg_stat_monitor--1.0.sql.in pg_stat_monitor--1.0.sql) + endif endif ifdef USE_PGXS diff --git a/percona-packaging/debian/changelog b/debian/changelog similarity index 100% rename from percona-packaging/debian/changelog rename to debian/changelog diff --git a/percona-packaging/debian/compat b/debian/compat similarity index 100% rename from percona-packaging/debian/compat rename to debian/compat diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..8e77a49 --- /dev/null +++ b/debian/control @@ -0,0 +1,24 @@ +Source: percona-pg-stat-monitor +Section: database +Priority: optional +Maintainer: Percona Development Team +Build-Depends: + debhelper (>= 9), + postgresql-server-dev-all (>= 153~), + +Package: percona-pg-stat-monitor@@PG_REL@@ +Architecture: any +Depends: + postgresql-@@PG_REL@@, + ${misc:Depends}, + ${shlibs:Depends}, +Description: enhancement query planning and execution statistics collector + The pg_stat_monitor is a Query Performance Monitoring tool for PostgreSQL. + It attempts to provide a more holistic picture by providing much-needed query + performance insights in a single view. + . + pg_stat_monitor provides improved insights that allow database users to + understand query origins, execution, planning statistics and details, query + information, and metadata. This significantly improves observability, enabling + users to debug and tune query performance. pg_stat_monitor is developed on the + basis of pg_stat_statements as its more advanced replacement. diff --git a/percona-packaging/debian/control.in b/debian/control.in similarity index 78% rename from percona-packaging/debian/control.in rename to debian/control.in index 662d898..66a62c4 100644 --- a/percona-packaging/debian/control.in +++ b/debian/control.in @@ -4,12 +4,12 @@ Priority: optional Maintainer: Percona Development Team Build-Depends: debhelper (>= 9), - percona-postgresql-server-dev-all (>= 153~), + postgresql-server-dev-all (>= 153~) | percona-postgresql-server-dev-all (>= 153~), -Package: percona-pg-stat-monitor@@PG_REL@@ +Package: percona-pg-stat-monitorPGVERSION Architecture: any Depends: - percona-postgresql-@@PG_REL@@ | postgresql-@@PG_REL@@, + postgresql-PGVERSION, ${misc:Depends}, ${shlibs:Depends}, Description: The pg_stat_monitor is statistics collector tool diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..dfbbbf6 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,26 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: pg_stat_monitor +Source: https://github.com/percona/pg_stat_monitor + +Files: * +Copyright: Portions Copyright © 2018-2021, Percona LLC and/or its affiliates + Portions Copyright © 1996-2021, The PostgreSQL Global Development Group + Portions Copyright © 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/percona-packaging/debian/pgversions b/debian/pgversions similarity index 100% rename from percona-packaging/debian/pgversions rename to debian/pgversions diff --git a/percona-packaging/debian/rules b/debian/rules similarity index 100% rename from percona-packaging/debian/rules rename to debian/rules diff --git a/percona-packaging/debian/source/format b/debian/source/format similarity index 100% rename from percona-packaging/debian/source/format rename to debian/source/format diff --git a/percona-packaging/debian/source/lintian-overrides b/debian/source/lintian-overrides similarity index 100% rename from percona-packaging/debian/source/lintian-overrides rename to debian/source/lintian-overrides diff --git a/percona-packaging/debian/control b/percona-packaging/debian/control deleted file mode 100644 index 662d898..0000000 --- a/percona-packaging/debian/control +++ /dev/null @@ -1,20 +0,0 @@ -Source: percona-pg-stat-monitor -Section: database -Priority: optional -Maintainer: Percona Development Team -Build-Depends: - debhelper (>= 9), - percona-postgresql-server-dev-all (>= 153~), - -Package: percona-pg-stat-monitor@@PG_REL@@ -Architecture: any -Depends: - percona-postgresql-@@PG_REL@@ | postgresql-@@PG_REL@@, - ${misc:Depends}, - ${shlibs:Depends}, -Description: The pg_stat_monitor is statistics collector tool - based on PostgreSQL's contrib module "pg_stat_statements". - . - pg_stat_monitor is developed on the basis of pg_stat_statments - as more advanced replacement for pg_stat_statment. - It provides all the features of pg_stat_statment plus its own feature set. diff --git a/percona-packaging/debian/copyright b/percona-packaging/debian/copyright deleted file mode 100644 index 621a1ee..0000000 --- a/percona-packaging/debian/copyright +++ /dev/null @@ -1,27 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: PostgreSQL -Source: https://github.com/percona/pg_stat_monitor - -pg_stat_monitor - Statistics collector for PostgreSQL. - -Portions Copyright © 2018-2020, Percona LLC and/or its affiliates - -Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group - -Portions Copyright (c) 1994, The Regents of the University of California - -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/percona-packaging/scripts/pg_stat_monitor_builder.sh b/percona-packaging/scripts/pg_stat_monitor_builder.sh index 52b2ccb..92986dc 100644 --- a/percona-packaging/scripts/pg_stat_monitor_builder.sh +++ b/percona-packaging/scripts/pg_stat_monitor_builder.sh @@ -128,9 +128,6 @@ get_sources(){ fi REVISION=$(git rev-parse --short HEAD) echo "REVISION=${REVISION}" >> ${WORKDIR}/pg-stat-monitor.properties - rm -rf rpm debian - cp -r percona-packaging/rpm ./ - cp -r percona-packaging/debian ./ EDITFILES="debian/control debian/control.in debian/rules rpm/pg-stat-monitor.spec" for file in $EDITFILES; do @@ -193,9 +190,10 @@ install_deps() { percona-release enable ppg-12 release fi yum -y install git wget + PKGLIST="percona-postgresql-common percona-postgresql${PG_RELEASE}-devel" PKGLIST+=" clang-devel git clang llvm-devel rpmdevtools vim wget" PKGLIST+=" perl binutils gcc gcc-c++" - PKGLIST+=" percona-postgresql-common clang-devel llvm-devel percona-postgresql${PG_RELEASE}-devel git rpm-build rpmdevtools wget gcc make autoconf" + PKGLIST+=" clang-devel llvm-devel git rpm-build rpmdevtools wget gcc make autoconf" if [[ "${RHEL}" -eq 8 ]]; then dnf -y module disable postgresql elif [[ "${RHEL}" -eq 7 ]]; then @@ -225,6 +223,15 @@ install_deps() { elif [[ "${PG_RELEASE}" == "12" ]]; then percona-release enable ppg-12 release fi + + + PKGLIST="percona-postgresql-${PG_RELEASE} percona-postgresql-common percona-postgresql-server-dev-all" + + # ---- using a community version of postgresql + #wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - + #echo "deb http://apt.postgresql.org/pub/repos/apt/ ${PG_RELEASE}"-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list + #PKGLIST="postgresql-${PG_RELEASE} postgresql-common postgresql-server-dev-all" + apt-get update if [[ "${OS_NAME}" != "focal" ]]; then @@ -237,8 +244,9 @@ install_deps() { fi fi - PKGLIST+=" percona-postgresql-${PG_RELEASE} debconf debhelper clang-7 devscripts dh-exec dh-systemd git wget libkrb5-dev libssl-dev percona-postgresql-common percona-postgresql-server-dev-all" - PKGLIST+=" build-essential debconf debhelper devscripts dh-exec dh-systemd git wget libxml-checker-perl libxml-libxml-perl libio-socket-ssl-perl libperl-dev libssl-dev libxml2-dev txt2man zlib1g-dev libpq-dev" + PKGLIST+=" debconf debhelper clang-7 devscripts dh-exec dh-systemd git wget libkrb5-dev libssl-dev" + PKGLIST+=" build-essential debconf debhelper devscripts dh-exec dh-systemd git wget libxml-checker-perl" + PKGLIST+=" libxml-libxml-perl libio-socket-ssl-perl libperl-dev libssl-dev libxml2-dev txt2man zlib1g-dev libpq-dev" until DEBIAN_FRONTEND=noninteractive apt-get -y install ${PKGLIST}; do sleep 1 @@ -402,6 +410,7 @@ build_source_deb(){ cd ${BUILDDIR} dch -D unstable --force-distribution -v "${VERSION}-${DEB_RELEASE}" "Update to new percona-pg-stat-monitor${PG_RELEASE} version ${VERSION}" + pg_buildext updatecontrol dpkg-buildpackage -S cd ../ mkdir -p $WORKDIR/source_deb @@ -444,6 +453,7 @@ build_deb(){ dpkg-source -x ${DSC} # cd percona-pg-stat-monitor-${VERSION} + sed -i "s:\. :${WORKDIR}/percona-pg-stat-monitor-${VERSION} :g" debian/rules dch -m -D "${OS_NAME}" --force-distribution -v "1:${VERSION}-${DEB_RELEASE}.${OS_NAME}" 'Update distribution' unset $(locale|cut -d= -f1) dpkg-buildpackage -rfakeroot -us -uc -b diff --git a/percona-packaging/rpm/pg-stat-monitor.spec b/rpm/pg-stat-monitor.spec similarity index 100% rename from percona-packaging/rpm/pg-stat-monitor.spec rename to rpm/pg-stat-monitor.spec