Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 249c672

Browse files
committed
[Issue #413] deb packages
1 parent 817b79b commit 249c672

File tree

13 files changed

+641
-0
lines changed

13 files changed

+641
-0
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,5 @@ src/walmethods.h: $(srchome)/src/bin/pg_basebackup/walmethods.h
8080
ifeq ($(PORTNAME), aix)
8181
CC=xlc_r
8282
endif
83+
84+
include packaging/Makefile.pkg

packaging/Makefile.debian

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# DEBIAN 8
2+
build/debian_8_9.5:
3+
$(call build_deb,debian,8,jessie,9.5,9.5.25)
4+
touch build/debian_8_9.5
5+
6+
build/debian_8_9.6:
7+
$(call build_deb,debian,8,jessie,9.6,9.6.21)
8+
touch build/debian_8_9.6
9+
10+
build/debian_8_10:
11+
$(call build_deb,debian,8,jessie,10,10.16)
12+
touch build/debian_8_10
13+
14+
build/debian_8_11:
15+
$(call build_deb,debian,8,jessie,11,11.11)
16+
touch build/debian_8_11
17+
18+
build/debian_8_12:
19+
$(call build_deb,debian,8,jessie,12,12.6)
20+
touch build/debian_8_12
21+
22+
build/debian_8_13:
23+
$(call build_deb,debian,8,jessie,13,13.3)
24+
touch build/debian_8_13
25+
26+
# DEBIAN 9
27+
build/debian_9_9.5:
28+
$(call build_deb,debian,9,stretch,9.5,9.5.25)
29+
touch build/debian_9_9.5
30+
31+
build/debian_9_9.6:
32+
$(call build_deb,debian,9,stretch,9.6,9.6.21)
33+
touch build/debian_9_9.6
34+
35+
build/debian_9_10:
36+
$(call build_deb,debian,9,stretch,10,10.16)
37+
touch build/debian_9_10
38+
39+
build/debian_9_11:
40+
$(call build_deb,debian,9,stretch,11,11.11)
41+
touch build/debian_9_11
42+
43+
build/debian_9_12:
44+
$(call build_deb,debian,9,stretch,12,12.6)
45+
touch build/debian_9_12
46+
47+
build/debian_9_13:
48+
$(call build_deb,debian,9,stretch,13,13.3)
49+
touch build/debian_9_13
50+
51+
# DEBIAN 10
52+
build/debian_10_9.5:
53+
$(call build_deb,debian,10,buster,9.5,9.5.25)
54+
touch build/debian_10_9.5
55+
56+
build/debian_10_9.6:
57+
$(call build_deb,debian,10,buster,9.6,9.6.21)
58+
touch build/debian_10_9.6
59+
60+
build/debian_10_10:
61+
$(call build_deb,debian,10,buster,10,10.16)
62+
touch build/debian_10_10
63+
64+
build/debian_10_11:
65+
$(call build_deb,debian,10,buster,11,11.11)
66+
touch build/debian_10_11
67+
68+
build/debian_10_12:
69+
$(call build_deb,debian,10,buster,12,12.6)
70+
touch build/debian_10_12
71+
72+
build/debian_10_13:
73+
$(call build_deb,debian,10,buster,13,13.3)
74+
touch build/debian_10_13

packaging/Makefile.pkg

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
WORKDIR ?= $(CURDIR)
2+
BUILDDIR = $(WORKDIR)/build/
3+
PBK_GIT_REPO = http://github.com/postgrespro/pg_probackup
4+
5+
ifeq ($(PBK_EDITION),std)
6+
PBK_PKG_REPO = pg_probackup-forks
7+
PBK_EDITION_FULL = Standart
8+
PKG_NAME_SUFFIX = std-
9+
else ifeq ($(PBK_EDITION),ent)
10+
PBK_PKG_REPO = pg_probackup-forks
11+
PBK_EDITION_FULL = Enterprise
12+
PKG_NAME_SUFFIX = ent-
13+
else
14+
PBK_PKG_REPO = pg_probackup
15+
PBK_EDITION_FULL =
16+
PBK_EDITION =
17+
PKG_NAME_SUFFIX =
18+
endif
19+
20+
#ifndef $(PG_VERSIONS)
21+
#PG_VERSIONS = $(PG_VERSIONS_DEFAULT)
22+
#endif
23+
24+
pkg: prepare_builddir build/all
25+
@echo Build for all platform: done
26+
# echo "HELLO"
27+
28+
prepare_builddir:
29+
@if [ -z ${PBK_VERSION} ] ; then \
30+
echo "Env variable PBK_VERSION is not set" ; \
31+
false ; \
32+
fi
33+
34+
@if [ -z ${PBK_RELEASE} ] ; then \
35+
echo "Env variable PBK_RELEASE is not set" ; \
36+
false ; \
37+
fi
38+
39+
@if [ -z ${PBK_HASH} ] ; then \
40+
echo "Env variable PBK_HASH is not set" ; \
41+
false ; \
42+
fi
43+
mkdir -p $(BUILDDIR)
44+
45+
#deb: prepare_builddir
46+
# cd $(BUILDDIR) && cp -a $(WORKDIR)/packaging/debian . && dpkg-buildpackage -b
47+
# cp -av build/mamonsu*.deb .
48+
49+
#rpm: prepare_builddir $(BUILDDIR)/packaging/rpm/SPECS/$(SPEC)
50+
# mkdir -p $(BUILDDIR)/packaging/rpm/RPMS $(BUILDDIR)/packaging/rpm/BUILD $(BUILDDIR)/packaging/rpm/SRPMS
51+
# rpmbuild -ba --define '_topdir $(BUILDDIR)/packaging/rpm'\
52+
# $(BUILDDIR)/packaging/rpm/SPECS/$(SPEC)
53+
# cp -av $(BUILDDIR)/packaging/rpm/RPMS/noarch/mamonsu*.rpm .
54+
55+
#build/prepare:
56+
# mkdir -p build
57+
# touch build/prepare
58+
59+
#build/all: build/debian build/ubuntu build/centos build/oraclelinux build/rhel build/alt build/pkg_suse
60+
# @echo Build for all platform: done
61+
# touch build/all
62+
63+
build/all: build/debian build/ubuntu
64+
@echo Packaging is done
65+
66+
### DEBIAN
67+
build/debian: build/debian_8 #build/debian_9 build/debian_10
68+
@echo Debian: done
69+
70+
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
71+
@echo Debian 8: done
72+
73+
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
74+
@echo Debian 9: done
75+
76+
build/debian_10: 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
77+
@echo Debian 10: done
78+
79+
### UBUNTU
80+
build/ubuntu: build/ubuntu_14.04 #build/ubuntu_16.04 build/ubuntu_18.04 build/ubuntu_20.04
81+
@echo Ubuntu: done
82+
83+
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
84+
@echo Ubuntu 14.04:
85+
86+
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
87+
@echo Ubuntu 16.04: done
88+
89+
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
90+
@echo Ubuntu 18.04: done
91+
92+
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
93+
@echo Ubuntu 20.04: done
94+
95+
#build/centos: build/centos_6 build/centos_7 build/rpm_repo_package_centos
96+
# @echo Centos: done
97+
98+
define build_deb
99+
docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \
100+
docker run \
101+
-v "$(WORKDIR)":/app/in \
102+
-v $(WORKDIR)/build/data/$(PBK_PKG_REPO):/app/out \
103+
-e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \
104+
-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" \
105+
-e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \
106+
--name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \
107+
--rm pgpro/$1:$2 /app/in/packaging/scripts/deb.sh
108+
endef
109+
110+
111+
#define build_rpm
112+
# docker run -v "$(WORKDIR)":/app/in \
113+
# -v "$(WORKDIR)/build/pkg/$1/$2/mamonsu/$(VERSION)":/app/out \
114+
# -e "VERSION=$(VERSION)" -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" \
115+
# --rm $1:$2 /app/in/packaging/scripts/rpm.sh
116+
#endef
117+
#
118+
#define build_rpm_repo_pkg
119+
# docker run -v "$(WORKDIR)":/app/in \
120+
# -v "$(WORKDIR)/build/pkg/keys":/app/out \
121+
# -e "VERSION=$(VERSION)" -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" \
122+
# --rm $1:$2 /app/in/packaging/scripts/repo_rpm.sh
123+
#endef
124+
125+
#build/rpm_repo_package_centos:
126+
# $(call build_rpm_repo_pkg,centos,7)
127+
# touch build/rpm_repo_package_centos
128+
#
129+
include packaging/Makefile.debian
130+
include packaging/Makefile.ubuntu
131+
132+
#build/ubuntu_14_04:
133+
# $(call build_deb,ubuntu,14.04,trusty)
134+
# touch build/ubuntu_14_04
135+
#
136+
#build/ubuntu_16_04:
137+
# $(call build_deb,ubuntu,16.04,xenial)
138+
# touch build/ubuntu_16_04
139+
#
140+
#build/ubuntu_18_04:
141+
# $(call build_deb,ubuntu,18.04,bionic)
142+
# touch build/ubuntu_18_04
143+
#
144+
#build/centos_6:
145+
# $(call build_rpm,centos,6)
146+
# touch build/centos_6
147+
#
148+
#build/centos_7:
149+
# $(call build_rpm,centos,7)
150+
# touch build/centos_7
151+
152+
#build/centos_8:
153+
# $(call build_rpm,centos,8)
154+
# touch build/centos_8
155+
156+
repo/all: repo/debian repo/ubuntu repo/centos repo/finish
157+
@echo Build repo for all platform: done
158+
touch build/repo_all
159+
160+
repo/debian: repo/debian_8 repo/debian_9 repo/debian_10
161+
@echo Build repo for debian platforms: done
162+
touch build/repo_debian
163+
164+
repo/ubuntu: repo/ubuntu_16_04 repo/ubuntu_18_04
165+
@echo Build repo for ubuntu platforms: done
166+
touch build/repo_ubuntu
167+
168+
repo/centos: repo/centos_6 repo/centos_7
169+
@echo Build repo for centos platforms: done
170+
touch build/repo_centos
171+
172+
repo/centos_6:
173+
$(call build_repo_rpm,centos,6,6)
174+
touch build/repo_centos_6
175+
176+
repo/centos_7:
177+
$(call build_repo_rpm,centos,7,7)
178+
touch build/repo_centos_7
179+
180+
repo/debian_8:
181+
$(call build_repo_deb,debian,8,jessie)
182+
touch build/repo_debian_8
183+
184+
repo/debian_9:
185+
$(call build_repo_deb,debian,9,stretch)
186+
touch build/repo_debian_9
187+
188+
repo/debian_10:
189+
$(call build_repo_deb,debian,10,buster)
190+
touch build/repo_debian_10
191+
192+
repo/ubuntu_14_04:
193+
$(call build_repo_deb,ubuntu,14.04,trusty)
194+
touch build/repo_ubuntu_14_04
195+
196+
repo/ubuntu_16_04:
197+
$(call build_repo_deb,ubuntu,16.04,xenial)
198+
touch build/repo_ubuntu_16_04
199+
200+
repo/ubuntu_18_04:
201+
$(call build_repo_deb,ubuntu,18.04,bionic)
202+
touch build/repo_ubuntu_18_04
203+
204+
repo/finish:
205+
$(call repo_finish,centos,7)
206+
touch build/repo_finish
207+
208+
define build_repo_deb
209+
docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \
210+
-v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \
211+
-e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \
212+
--rm $1:$2 /app/repo/scripts/deb.sh
213+
endef
214+
215+
define build_repo_rpm
216+
docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \
217+
-v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \
218+
-e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \
219+
--rm $1:$2 /app/repo/scripts/rpm.sh
220+
endef
221+
222+
define repo_finish
223+
docker run -v $(WORKDIR)/build/pkg/keys:/app/in -v $(WORKDIR)/build/www:/app/www \
224+
-e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \
225+
--rm $1:$2 bash -exc "cp -av /app/in/*rpm /app/www/mamonsu/keys && cd /app/www/mamonsu/ && \
226+
ln -s $(VERSION) latest"
227+
endef

0 commit comments

Comments
 (0)