-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathMakefile.pkg
185 lines (144 loc) · 7.5 KB
/
Makefile.pkg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
ifeq ($(PBK_EDITION),std)
PBK_PKG_REPO = pg_probackup-forks
PBK_EDITION_FULL = Standard
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_9 build/debian_10 build/debian_11
@echo Debian: done
build/debian_9: build/debian_9_9.6 build/debian_9_10 build/debian_9_11 build/debian_9_12 build/debian_9_13 build/debian_9_14
@echo Debian 9: done
build/debian_10: build/debian_10_9.6 build/debian_10_10 build/debian_10_11 build/debian_10_12 build/debian_10_13 build/debian_10_14
@echo Debian 10: done
build/debian_11: build/debian_11_9.6 build/debian_11_10 build/debian_11_11 build/debian_11_12 build/debian_11_13 build/debian_11_14
@echo Debian 11: done
### UBUNTU
build/ubuntu: build/ubuntu_18.04 build/ubuntu_20.04
@echo Ubuntu: done
build/ubuntu_18.04: 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 build/ubuntu_18.04_14
@echo Ubuntu 18.04: done
build/ubuntu_20.04: 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 build/ubuntu_20.04_14
@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.6 build/centos_7_10 build/centos_7_11 build/centos_7_12 build/centos_7_13 build/centos_7_14
@echo Centos 7: done
# pgpro-9.6@centos-8 doesn't exist
build/centos_8: build/centos_8_10 build/centos_8_11 build/centos_8_12 build/centos_8_13 build/centos_8_14 #build/centos_8_9.6
@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.6 build/oraclelinux_6_10 build/oraclelinux_6_11 build/oraclelinux_6_12 build/oraclelinux_6_13 build/oraclelinux_6_14
@echo Oraclelinux 6: done
build/oraclelinux_7: build/oraclelinux_7_9.6 build/oraclelinux_7_10 build/oraclelinux_7_11 build/oraclelinux_7_12 build/oraclelinux_7_13 build/oraclelinux_7_14
@echo Oraclelinux 7: done
# pgpro-9.6@oraclelinux-8 doesn't exist
build/oraclelinux_8: build/oraclelinux_8_10 build/oraclelinux_8_11 build/oraclelinux_8_12 build/oraclelinux_8_13 build/oraclelinux_8_14 #build/oraclelinux_8_9.6
@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.6 build/rhel_7_10 build/rhel_7_11 build/rhel_7_12 build/rhel_7_13 build/rhel_7_14
@echo Rhel 7: done
build/rhel_8: build/rhel_8_9.6 build/rhel_8_10 build/rhel_8_11 build/rhel_8_12 build/rhel_8_13 build/rhel_8_14
@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.6 build/alt_7_10 build/alt_7_11 build/alt_7_12 build/alt_7_13 build/alt_7_14
@echo Alt Linux 7: done
build/alt_8: build/alt_8_9.6 build/alt_8_10 build/alt_8_11 build/alt_8_12 build/alt_8_13 build/alt_8_14
@echo Alt Linux 8: done
build/alt_9: build/alt_9_9.6 build/alt_9_10 build/alt_9_11 build/alt_9_12 build/alt_9_13 build/alt_9_14
@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
# there is no PG-14 in suse-15.1 repositories (test fails)
build/suse_15.1: 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.6 build/suse_15.2_10 build/suse_15.2_11 build/suse_15.2_12 build/suse_15.2_13 build/suse_15.2_14
@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