Skip to content

built-in package infrastructure #418

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

Merged
merged 55 commits into from
Sep 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
249c672
[Issue #413] deb packages
gsmolk Aug 2, 2021
4d672f1
[Issue #413] rpm packages
gsmolk Aug 2, 2021
77a8a42
[Issue #413] minor fixes
gsmolk Aug 2, 2021
0d50b5d
[Issue #413] packaging for Alt Linux
gsmolk Aug 3, 2021
cad265f
[Issue #413] packaging for Oracle Linux and Rhel
gsmolk Aug 3, 2021
1ed4848
[Issue #413] fallback to PG 13.2
gsmolk Aug 3, 2021
c85babf
[skip travis] packaging for suse
gsmolk Aug 3, 2021
ae7334f
[skip travis] repo for debian and centos
gsmolk Aug 3, 2021
41dba2b
[skip travis] repo for suse
gsmolk Aug 4, 2021
a06638e
[skip travis] repo refactoring
gsmolk Aug 4, 2021
ec734f3
[skip travis] minor cleanup
gsmolk Aug 4, 2021
52462a1
[skip travis] minor fix
gsmolk Aug 4, 2021
9c89134
[skip travis] minor fix
gsmolk Aug 4, 2021
ad111ce
[skip travis] pkg testing infrastructure
gsmolk Aug 7, 2021
a748784
[skip travis] pkg testing infrastructure
gsmolk Aug 7, 2021
680b64f
[skip travis] disable pkg testing for PG 9.5
gsmolk Aug 7, 2021
75df3c3
[skip travis] disable pkg testing for Debian 8
gsmolk Aug 7, 2021
645e355
[skip travis] fix deb.sh
gsmolk Aug 7, 2021
45e42fe
[skip travis] fix deb.sh
gsmolk Aug 7, 2021
97e8f13
[skip travis] fix deb.sh
gsmolk Aug 7, 2021
cd15ba2
[skip travis] fix deb.sh
gsmolk Aug 7, 2021
8151b9c
[skip travis] fix deb.sh
gsmolk Aug 7, 2021
90b2935
[skip travis] fix rpm.sh
gsmolk Aug 7, 2021
1344d42
[skip travis] fix alt and suse tests
gsmolk Aug 7, 2021
7356479
[skip travis] remove oracle linux 6
gsmolk Aug 7, 2021
07f73ee
[skip travis] correct repo path for rhel and oracle linux
gsmolk Aug 7, 2021
90ae537
[skip travis] minor fix
gsmolk Aug 7, 2021
c8bde0d
[skip travis] minor fix
gsmolk Aug 7, 2021
e58bc18
[skip travis] minor fix
gsmolk Aug 7, 2021
be12d6c
[skip travis] minor fix
gsmolk Aug 7, 2021
f223bf2
[skip travis] minor fix
gsmolk Aug 7, 2021
104d7c3
[skip travis] minor fix
gsmolk Aug 7, 2021
24d4c1d
[skip travis] minor fix
gsmolk Aug 7, 2021
14a6d75
[skip travis] minor fix
gsmolk Aug 7, 2021
4f97058
[skip travis] fix alt
gsmolk Aug 7, 2021
64fd5a8
[skip travis] fix alt
gsmolk Aug 7, 2021
03ebf3b
[skip travis] fix alt
gsmolk Aug 7, 2021
55f1f8a
[skip travis] fix alt
gsmolk Aug 7, 2021
97e2c3b
[skip travis] disable rhel packaging
gsmolk Aug 8, 2021
eca6c71
[skip travis] build repo packages for std|ent
gsmolk Aug 8, 2021
6f4bc2b
[skip travis] build repo packages for std|ent
gsmolk Aug 8, 2021
08b18e3
[skip travis] build repo packages for std|ent
gsmolk Aug 8, 2021
4ff6290
[skip travis] build repo packages for std|ent
gsmolk Aug 8, 2021
0533def
[skip travis] build repo packages for std|ent
gsmolk Aug 8, 2021
62863f7
[skip travis] build repo packages for std|ent
gsmolk Aug 8, 2021
a427694
[skip travis] test packages for std|ent
gsmolk Aug 8, 2021
2fa47cf
[skip travis] test packages for std|ent
gsmolk Aug 8, 2021
efe6bf8
[skip travis] test packages for std|ent
gsmolk Aug 8, 2021
76a6c91
[skip travis] test packages for std|ent
gsmolk Aug 8, 2021
29e97a1
[skip travis] test packages for std|ent
gsmolk Aug 8, 2021
3c7fb9f
[skip travis] test packages for std|ent
gsmolk Aug 8, 2021
77fd5f9
[skip travis] test packages for std|ent
gsmolk Aug 8, 2021
ddf5199
[skip travis] fix rhel
gsmolk Sep 3, 2021
23397f4
[Issue #427] build pkg repo for Debian 11
gsmolk Sep 3, 2021
7418c0b
Merge branch 'master' into issue_413
gsmolk Sep 3, 2021
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
/make_dockerfile.sh
/backup_restore.sh

# Packaging
/build
/packaging/pkg/tarballs/pgpro.tar.bz2
/packaging/repo/pg_probackup
/packaging/repo/pg_probackup-forks

# Misc
.python-version
.vscode
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
PROGRAM = pg_probackup
WORKDIR ?= $(CURDIR)
BUILDDIR = $(WORKDIR)/build/
PBK_GIT_REPO = http://github.com/postgrespro/pg_probackup

# utils
OBJS = src/utils/configuration.o src/utils/json.o src/utils/logger.o \
Expand Down Expand Up @@ -80,3 +83,7 @@ src/walmethods.h: $(srchome)/src/bin/pg_basebackup/walmethods.h
ifeq ($(PORTNAME), aix)
CC=xlc_r
endif

include packaging/Makefile.pkg
include packaging/Makefile.repo
include packaging/Makefile.test
5 changes: 5 additions & 0 deletions packaging/Dockerfiles/Dockerfile-altlinux_8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alt:p8
RUN ulimit -n 1024 && apt-get update -y && apt-get install -y tar wget rpm-build
RUN ulimit -n 1024 && apt-get install -y make perl libicu-devel glibc-devel bison flex
RUN ulimit -n 1024 && apt-get install -y git perl-devel readline-devel libxml2-devel libxslt-devel python-devel zlib-devel openssl-devel libkrb5 libkrb5-devel
RUN ulimit -n 1024 && apt-get upgrade -y
5 changes: 5 additions & 0 deletions packaging/Dockerfiles/Dockerfile-altlinux_9
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alt:p9
RUN ulimit -n 1024 && apt-get update -y && apt-get install -y tar wget rpm-build
RUN ulimit -n 1024 && apt-get install -y make perl libicu-devel glibc-devel bison flex
RUN ulimit -n 1024 && apt-get install -y git perl-devel readline-devel libxml2-devel libxslt-devel python-devel zlib-devel openssl-devel libkrb5 libkrb5-devel
RUN ulimit -n 1024 && apt-get dist-upgrade -y
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-astra_1.11
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM pgpro/astra:1.11
RUN apt-get update -y
RUN apt-get install -y devscripts
RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN apt-get install -y cmake bison flex libboost-all-dev
RUN apt-get install reprepro -y
RUN apt-get upgrade -y
5 changes: 5 additions & 0 deletions packaging/Dockerfiles/Dockerfile-centos_7
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM centos:7
RUN yum install -y tar wget rpm-build yum-utils
RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex
RUN yum install -y git
RUN yum upgrade -y
5 changes: 5 additions & 0 deletions packaging/Dockerfiles/Dockerfile-centos_8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM centos:8
RUN yum install -y tar wget rpm-build yum-utils
RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex
RUN yum install -y git
RUN yum upgrade -y
4 changes: 4 additions & 0 deletions packaging/Dockerfiles/Dockerfile-createrepo1C
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM ubuntu:17.10
RUN apt-get -qq update -y
RUN apt-get -qq install -y reprepro rpm createrepo gnupg rsync perl less wget expect rsync dpkg-dev
RUN apt-get upgrade -y
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-debian_10
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:10
RUN apt-get update -y
RUN apt-get install -y devscripts
RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN apt-get install -y cmake bison flex libboost-all-dev
RUN apt-get install -y reprepro
RUN apt-get upgrade -y
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-debian_11
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:11
RUN apt-get update -y
RUN apt-get install -y devscripts
RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN apt-get install -y cmake bison flex libboost-all-dev
RUN apt-get install -y reprepro
RUN apt-get upgrade -y
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-debian_8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:8
RUN apt-get update -y
RUN apt-get install -y devscripts
RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN apt-get install -y cmake bison flex libboost-all-dev
RUN apt-get install -y reprepro
RUN apt-get upgrade -y
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-debian_9
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:9
RUN apt-get update -y
RUN apt-get install -y devscripts
RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN apt-get install -y cmake bison flex libboost-all-dev
RUN apt-get install -y reprepro
RUN apt-get upgrade -y
5 changes: 5 additions & 0 deletions packaging/Dockerfiles/Dockerfile-oraclelinux_6
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM oraclelinux:6
RUN yum install -y tar wget rpm-build yum-utils
RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex
RUN yum install -y git openssl
RUN yum upgrade -y
5 changes: 5 additions & 0 deletions packaging/Dockerfiles/Dockerfile-oraclelinux_7
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM oraclelinux:7
RUN yum install -y tar wget rpm-build yum-utils
RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex
RUN yum install -y git openssl
RUN yum upgrade -y
5 changes: 5 additions & 0 deletions packaging/Dockerfiles/Dockerfile-oraclelinux_8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM oraclelinux:8
RUN yum install -y tar wget rpm-build yum-utils
RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex
RUN yum install -y git openssl
RUN yum upgrade -y
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-rhel_7
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM registry.access.redhat.com/ubi7
RUN yum install -y http://mirror.centos.org/centos/7/os/x86_64/Packages/elfutils-0.176-5.el7.x86_64.rpm
RUN yum install -y http://mirror.centos.org/centos/7/os/x86_64/Packages/rpm-build-4.11.3-45.el7.x86_64.rpm
RUN yum install -y tar wget yum-utils
RUN yum install -y gcc make perl libicu-devel glibc-devel
RUN yum install -y git
RUN yum upgrade -y
5 changes: 5 additions & 0 deletions packaging/Dockerfiles/Dockerfile-rhel_8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM registry.access.redhat.com/ubi8
RUN yum install -y tar wget rpm-build yum-utils
RUN yum install -y gcc make perl libicu-devel glibc-devel
RUN yum install -y git
RUN yum upgrade -y
5 changes: 5 additions & 0 deletions packaging/Dockerfiles/Dockerfile-rosa_6
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM pgpro/rosa-6
RUN yum install -y tar wget rpm-build yum-utils
RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex
RUN yum install -y git
RUN yum upgrade -y
4 changes: 4 additions & 0 deletions packaging/Dockerfiles/Dockerfile-suse_15.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM opensuse/leap:15.1
RUN ulimit -n 1024 && zypper install -y tar wget rpm-build
RUN ulimit -n 1024 && zypper install -y gcc make perl libicu-devel glibc-devel bison flex
RUN ulimit -n 1024 && zypper install -y git rsync
4 changes: 4 additions & 0 deletions packaging/Dockerfiles/Dockerfile-suse_15.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM opensuse/leap:15.2
RUN ulimit -n 1024 && zypper install -y tar wget rpm-build
RUN ulimit -n 1024 && zypper install -y gcc make perl libicu-devel glibc-devel bison flex
RUN ulimit -n 1024 && zypper install -y git rsync
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-ubuntu_14.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:14.04
RUN apt-get update -y
RUN apt-get install -y devscripts
RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN apt-get install -y cmake bison flex libboost-all-dev
RUN apt-get install -y reprepro
RUN apt-get upgrade -y
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-ubuntu_16.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:16.04
RUN apt-get update -y
RUN apt-get install -y devscripts
RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN apt-get install -y cmake bison flex libboost-all-dev
RUN apt-get install -y reprepro
RUN apt-get upgrade -y
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-ubuntu_18.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:18.04
RUN apt-get update -y
RUN apt-get install -y devscripts
RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN apt-get install -y cmake bison flex libboost-all-dev
RUN apt-get install -y reprepro
RUN apt-get upgrade -y
7 changes: 7 additions & 0 deletions packaging/Dockerfiles/Dockerfile-ubuntu_18.10
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:18.10
RUN apt-get update -y
RUN apt-get install -y devscripts
RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN apt-get install -y cmake bison flex libboost-all-dev
RUN apt-get install -y reprepro
RUN apt-get upgrade -y
8 changes: 8 additions & 0 deletions packaging/Dockerfiles/Dockerfile-ubuntu_20.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
RUN ulimit -n 1024 && apt-get update -y
RUN ulimit -n 1024 && apt-get install -y devscripts
RUN ulimit -n 1024 && apt-get install -y dpkg-dev lsb-release git equivs wget vim
RUN ulimit -n 1024 && apt-get install -y cmake bison flex libboost-all-dev
RUN ulimit -n 1024 && apt-get install -y reprepro
RUN ulimit -n 1024 && apt-get upgrade -y
191 changes: 191 additions & 0 deletions packaging/Makefile.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
ifeq ($(PBK_EDITION),std)
PBK_PKG_REPO = pg_probackup-forks
PBK_EDITION_FULL = Standart
PKG_NAME_SUFFIX = std-
else ifeq ($(PBK_EDITION),ent)
PBK_PKG_REPO = pg_probackup-forks
PBK_EDITION_FULL = Enterprise
PKG_NAME_SUFFIX = ent-
else
PBK_PKG_REPO = pg_probackup
PBK_EDITION_FULL =
PBK_EDITION =
PKG_NAME_SUFFIX =
endif

check_env:
@if [ -z ${PBK_VERSION} ] ; then \
echo "Env variable PBK_VERSION is not set" ; \
false ; \
fi

@if [ -z ${PBK_RELEASE} ] ; then \
echo "Env variable PBK_RELEASE is not set" ; \
false ; \
fi

@if [ -z ${PBK_HASH} ] ; then \
echo "Env variable PBK_HASH is not set" ; \
false ; \
fi

pkg: check_env build/prepare build/all
@echo Build for all platform: done

build/prepare:
mkdir -p build

build/clean: build/prepare
find $(BUILDDIR) -maxdepth 1 -type f -exec rm -f {} \;

build/all: build/debian build/ubuntu build/centos build/oraclelinux build/alt build/suse # build/rhel
@echo Packaging is done

### DEBIAN
build/debian: build/debian_8 build/debian_9 build/debian_10 build/debian_11
@echo Debian: done

build/debian_8: build/debian_8_9.5 build/debian_8_9.6 build/debian_8_10 build/debian_8_11 build/debian_8_12 build/debian_8_13
@echo Debian 8: done

build/debian_9: build/debian_9_9.5 build/debian_9_9.6 build/debian_9_10 build/debian_9_11 build/debian_9_12 build/debian_9_13
@echo Debian 9: done

build/debian_10: build/debian_10_9.5 build/debian_10_9.6 build/debian_10_10 build/debian_10_11 build/debian_10_12 build/debian_10_13
@echo Debian 10: done

build/debian_11: build/debian_11_9.5 build/debian_11_9.6 build/debian_11_10 build/debian_11_11 build/debian_11_12 build/debian_11_13
@echo Debian 11: done

### UBUNTU
build/ubuntu: build/ubuntu_14.04 build/ubuntu_16.04 build/ubuntu_18.04 build/ubuntu_20.04
@echo Ubuntu: done

build/ubuntu_14.04: build/ubuntu_14.04_9.5 build/ubuntu_14.04_9.6 build/ubuntu_14.04_10 build/ubuntu_14.04_11 build/ubuntu_14.04_12 build/ubuntu_14.04_13
@echo Ubuntu 14.04: done

build/ubuntu_16.04: build/ubuntu_16.04_9.5 build/ubuntu_16.04_9.6 build/ubuntu_16.04_10 build/ubuntu_16.04_11 build/ubuntu_16.04_12 build/ubuntu_16.04_13
@echo Ubuntu 16.04: done

build/ubuntu_18.04: build/ubuntu_18.04_9.5 build/ubuntu_18.04_9.6 build/ubuntu_18.04_10 build/ubuntu_18.04_11 build/ubuntu_18.04_12 build/ubuntu_18.04_13
@echo Ubuntu 18.04: done

build/ubuntu_20.04: build/ubuntu_20.04_9.5 build/ubuntu_20.04_9.6 build/ubuntu_20.04_10 build/ubuntu_20.04_11 build/ubuntu_20.04_12 build/ubuntu_20.04_13
@echo Ubuntu 20.04: done

define build_deb
docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \
docker run \
-v $(WORKDIR)/packaging/pkg:/app/in \
-v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg-probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \
-e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \
-e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg-probackup-$(PKG_NAME_SUFFIX)$4" \
-e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \
--name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \
--rm pgpro/$1:$2 /app/in/scripts/deb.sh
endef

include packaging/pkg/Makefile.debian
include packaging/pkg/Makefile.ubuntu

# CENTOS
build/centos: build/centos_7 build/centos_8 #build/rpm_repo_package_centos
@echo Centos: done

build/centos_7: build/centos_7_9.5 build/centos_7_9.6 build/centos_7_10 build/centos_7_11 build/centos_7_12 build/centos_7_13
@echo Centos 7: done

build/centos_8: build/centos_8_9.5 build/centos_8_9.6 build/centos_8_10 build/centos_8_11 build/centos_8_12 build/centos_8_13
@echo Centos 8: done

# Oracle Linux
build/oraclelinux: build/oraclelinux_6 build/oraclelinux_7 build/oraclelinux_8 #build/rpm_repo_package_oraclelinux
@echo Oraclelinux: done

build/oraclelinux_6: build/oraclelinux_6_9.5 build/oraclelinux_6_9.6 build/oraclelinux_6_10 build/oraclelinux_6_11 build/oraclelinux_6_12 build/oraclelinux_6_13
@echo Oraclelinux 6: done

build/oraclelinux_7: build/oraclelinux_7_9.5 build/oraclelinux_7_9.6 build/oraclelinux_7_10 build/oraclelinux_7_11 build/oraclelinux_7_12 build/oraclelinux_7_13
@echo Oraclelinux 7: done

build/oraclelinux_8: build/oraclelinux_8_9.5 build/oraclelinux_8_9.6 build/oraclelinux_8_10 build/oraclelinux_8_11 build/oraclelinux_8_12 build/oraclelinux_8_13
@echo Oraclelinux 8: done

# RHEL
build/rhel: build/rhel_7 build/rhel_8 #build/rpm_repo_package_rhel
@echo Rhel: done

build/rhel_7: build/rhel_7_9.5 build/rhel_7_9.6 build/rhel_7_10 build/rhel_7_11 build/rhel_7_12 build/rhel_7_13
@echo Rhel 7: done

build/rhel_8: build/rhel_8_9.5 build/rhel_8_9.6 build/rhel_8_10 build/rhel_8_11 build/rhel_8_12 build/rhel_8_13
@echo Rhel 8: done


define build_rpm
docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \
docker run \
-v $(WORKDIR)/packaging/pkg:/app/in \
-v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \
-e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \
-e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \
-e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \
--name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \
--rm pgpro/$1:$2 /app/in/scripts/rpm.sh
endef

include packaging/pkg/Makefile.centos
include packaging/pkg/Makefile.rhel
include packaging/pkg/Makefile.oraclelinux


# Alt Linux
build/alt: build/alt_7 build/alt_8 build/alt_9
@echo Alt Linux: done

build/alt_7: build/alt_7_9.5 build/alt_7_9.6 build/alt_7_10 build/alt_7_11 build/alt_7_12 build/alt_7_13
@echo Alt Linux 7: done

build/alt_8: build/alt_8_9.5 build/alt_8_9.6 build/alt_8_10 build/alt_8_11 build/alt_8_12 build/alt_8_13
@echo Alt Linux 8: done

build/alt_9: build/alt_9_9.5 build/alt_9_9.6 build/alt_9_10 build/alt_9_11 build/alt_9_12 build/alt_9_13
@echo Alt Linux 9: done

define build_alt
docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \
docker run \
-v $(WORKDIR)/packaging/pkg:/app/in \
-v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \
-e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \
-e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \
-e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \
--name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \
--rm pgpro/$1:$2 /app/in/scripts/alt.sh
endef

include packaging/pkg/Makefile.alt

# SUSE Linux
build/suse: build/suse_15.1 build/suse_15.2
@echo Suse: done

build/suse_15.1: build/suse_15.1_9.5 build/suse_15.1_9.6 build/suse_15.1_10 build/suse_15.1_11 build/suse_15.1_12 build/suse_15.1_13
@echo Rhel 15.1: done

build/suse_15.2: build/suse_15.2_9.5 build/suse_15.2_9.6 build/suse_15.2_10 build/suse_15.2_11 build/suse_15.2_12 build/suse_15.2_13
@echo Rhel 15.1: done

define build_suse
docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \
docker run \
-v $(WORKDIR)/packaging/pkg:/app/in \
-v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \
-e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \
-e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \
-e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \
--name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \
--rm pgpro/$1:$2 /app/in/scripts/suse.sh
endef

include packaging/pkg/Makefile.suse
Loading