Skip to content

Commit

Permalink
Merge pull request #3784 from sysown/build-almalinux
Browse files Browse the repository at this point in the history
Build almalinux
  • Loading branch information
renecannao authored Feb 18, 2022
2 parents 7dc82cd + d7a3a3e commit 75af8d6
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ oldcode/tests/connect_speed

*.swp

*.sha1

# SQLITE files
*.db
Expand Down
46 changes: 45 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,34 @@ clean:
packages: amd64-packages arm64-packages
.PHONY: packages

amd64-packages: centos6 centos6-dbg centos6.7 centos6.7-dbg centos7 centos7-dbg centos8 centos8-clang centos8-dbg ubuntu14 ubuntu14-dbg ubuntu16 ubuntu16-dbg ubuntu18 ubuntu18-dbg ubuntu20 ubuntu20-clang ubuntu20-dbg debian8 debian8-dbg debian9 debian9-dbg debian10 debian10-dbg debian11 debian11-clang debian11-dbg fedora24 fedora24-dbg fedora27 fedora27-dbg fedora28 fedora28-dbg fedora33 fedora33-dbg fedora34 fedora34-clang fedora34-dbg opensuse15 opensuse15-clang opensuse15-dbg
amd64-packages: amd64-centos amd64-ubuntu amd64-debian amd64-fedora amd64-opensuse amd64-almalinux
.PHONY: amd64-packages

amd64-centos: centos6 centos6-dbg centos7 centos7-dbg centos8 centos8-clang centos8-dbg
.PHONY: amd64-centos

amd64-ubuntu: ubuntu14 ubuntu14-dbg ubuntu16 ubuntu16-dbg ubuntu18 ubuntu18-dbg ubuntu20 ubuntu20-clang ubuntu20-dbg
.PHONY: amd64-ubuntu

amd64-debian: debian8 debian8-dbg debian9 debian9-dbg debian10 debian10-dbg debian11 debian11-clang debian11-dbg
.PHONY: amd64-debian

amd64-fedora: fedora24 fedora24-dbg fedora27 fedora27-dbg fedora28 fedora28-dbg fedora33 fedora33-dbg fedora34 fedora34-clang fedora34-dbg
.PHONY: amd64-fedora

amd64-opensuse: opensuse15 opensuse15-clang opensuse15-dbg
.PHONY: amd64-opensuse

amd64-almalinux: almalinux8 almalinux8-clang almalinux8-dbg
.PHONY: amd64-almalinux



arm64-packages: centos7-arm64 centos8-arm64 debian9-arm64 debian10-arm64 debian11-arm64 ubuntu18-arm64 ubuntu20-arm64 fedora32-arm64 fedora33-arm64
.PHONY: arm64-packages



centos5: binaries/proxysql-${CURVER}-1-centos5.x86_64.rpm
.PHONY: centos5

Expand Down Expand Up @@ -384,6 +405,16 @@ opensuse15-dbg: binaries/proxysql-${CURVER}-1-opensuse15-dbg.x86_64.rpm
.PHONY: opensuse15-dbg


almalinux8: binaries/proxysql-${CURVER}-1-almalinux8.x86_64.rpm
.PHONY: almalinux8

almalinux8-clang: binaries/proxysql-${CURVER}-1-almalinux8-clang.x86_64.rpm
.PHONY: almalinux8-clang

almalinux8-dbg: binaries/proxysql-${CURVER}-1-almalinux8-dbg.x86_64.rpm
.PHONY: almalinux8-dbg



binaries/proxysql-${CURVER}-1-centos5.x86_64.rpm:
docker-compose up centos5_build
Expand Down Expand Up @@ -638,6 +669,19 @@ binaries/proxysql-${CURVER}-1-opensuse15-dbg.x86_64.rpm:
docker-compose rm -f


binaries/proxysql-${CURVER}-1-almalinux8.x86_64.rpm:
docker-compose up almalinux8_build
docker-compose rm -f

binaries/proxysql-${CURVER}-1-almalinux8-clang.x86_64.rpm:
docker-compose up almalinux8_clang_build
docker-compose rm -f

binaries/proxysql-${CURVER}-1-almalinux8-dbg.x86_64.rpm:
docker-compose up almalinux8_dbg_build
docker-compose rm -f



.PHONY: cleanall
cleanall:
Expand Down
55 changes: 55 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "2.0"
services:


centos6_build:
image: proxysql/packaging:build-centos6
volumes:
Expand Down Expand Up @@ -179,6 +180,7 @@ services:
command:
- /opt/entrypoint/entrypoint.bash


fedora24_build:
image: proxysql/packaging:build-fedora24
volumes:
Expand Down Expand Up @@ -387,6 +389,7 @@ services:
command:
- /opt/entrypoint/entrypoint.bash


debian8_build:
image: proxysql/packaging:build-debian8
volumes:
Expand Down Expand Up @@ -610,6 +613,7 @@ services:
command:
- /opt/entrypoint/entrypoint.bash


ubuntu14_build:
image: proxysql/packaging:build-ubuntu14
volumes:
Expand Down Expand Up @@ -785,6 +789,7 @@ services:
command:
- /opt/entrypoint/entrypoint.bash


opensuse15_build:
image: proxysql/packaging:build-opensuse15
volumes:
Expand Down Expand Up @@ -832,3 +837,53 @@ services:
- PROXYSQL_BUILD_ARCH=x86_64
command:
- /opt/entrypoint/entrypoint.bash


almalinux8_build:
image: proxysql/packaging:build-almalinux8
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=almalinux8
- PROXYSQL_BUILD_TYPE=clickhouse
- PROXYSQL_BUILD_ARCH=x86_64
command:
- /opt/entrypoint/entrypoint.bash

almalinux8_clang_build:
image: proxysql/packaging:build-clang-almalinux8
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=almalinux8-clang
- PROXYSQL_BUILD_TYPE=clickhouse
- PROXYSQL_BUILD_ARCH=x86_64
command:
- /opt/entrypoint/entrypoint.bash

almalinux8_dbg_build:
image: proxysql/packaging:build-almalinux8
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-almalinux8
- PROXYSQL_BUILD_TYPE=debug
- PROXYSQL_BUILD_ARCH=x86_64
command:
- /opt/entrypoint/entrypoint.bash

55 changes: 30 additions & 25 deletions docker/images/proxysql/deb-compliant/entrypoint/entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rm -f /opt/proxysql/proxysql.ctl /opt/proxysql/proxysql || true
# Clean and build dependancies and source
echo "==> Building"
cd /opt/proxysql
export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)
if [[ -z ${PROXYSQL_BUILD_TYPE:-} ]] ; then
deps_target="build_deps"
build_target=""
Expand All @@ -34,32 +35,36 @@ fi
touch /opt/proxysql/src/proxysql

# Prepare package files and build DEB
#echo "==> Packaging"
#cp /root/ctl/proxysql.ctl /opt/proxysql/proxysql.ctl
#sed -i "s/PKG_VERSION_CURVER/${CURVER}/g" /opt/proxysql/proxysql.ctl
#sed -i "s/PKG_ARCH/${ARCH}/g" /opt/proxysql/proxysql.ctl
#cp /opt/proxysql/src/proxysql /opt/proxysql/
#equivs-build proxysql.ctl
#mv "/opt/proxysql/proxysql_${CURVER}_$ARCH.deb" "./binaries/proxysql_${CURVER}-${PKG_RELEASE}_$ARCH.deb"
#cp "/opt/proxysql/src/proxysql.sha1" "/opt/proxysql/binaries/proxysql-${CURVER}-${PKG_RELEASE}.$ARCH.id-hash"
echo "==> Packaging"
mkdir -p /opt/proxysql/pkgroot/tmp || true
pushd /opt/proxysql/pkgroot
cp /root/ctl/proxysql.ctl ./proxysql.ctl
sed -i "s/PKG_VERSION_CURVER/${CURVER}/g" ./proxysql.ctl
sed -i "s/PKG_ARCH/${ARCH}/g" ./proxysql.ctl
cp ../src/proxysql ./
cp -r ../etc ./etc
cp -r ../tools ./tools
cp -r ../systemd ./systemd
equivs-build proxysql.ctl
cp ./proxysql_${CURVER}_${ARCH}.deb ../binaries/proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}.deb
# get SHA1 of the packaged executable
ar -p proxysql_${CURVER}_${ARCH}.deb data.tar.xz | unxz -c - | tar xvf - ./usr/bin/proxysql -O > tmp/proxysql
sha1sum tmp/proxysql | sed 's|tmp/||' | tee tmp/proxysql.sha1
cp tmp/proxysql.sha1 ../binaries/proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}.id-hash
popd
# Cleanup current build
#rm -f /opt/proxysql/proxysql.ctl /opt/proxysql/proxysql
rm -rf /opt/proxysql/pkgroot
exit 0

# Prepare package files and build DEB
echo "==> Packaging"
# prepare build root
cd /opt/proxysql
rm -rf ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}
mkdir -p ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}/DEBIAN
# prepare files
cp /root/ctl/proxysql.ctl ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}/DEBIAN/control
sed -i "/^$/d; /^#/d" ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}/DEBIAN/control
sed -i "s/PKG_VERSION_CURVER/${CURVER}/g" ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}/DEBIAN/control
sed -i "s/PKG_ARCH/${ARCH}/g" ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}/DEBIAN/control
cp ./src/proxysql ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}
# build package
dpkg-deb --build ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}
mv ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}.deb ./binaries/proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}.deb
cp ./src/proxysql.sha1 ./binaries/proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}.id-hash
# cleanup
rm -rf ./proxysql_${CURVER}-${PKG_RELEASE}_${ARCH}
cp /root/ctl/proxysql.ctl /opt/proxysql/proxysql.ctl
sed -i "s/PKG_VERSION_CURVER/${CURVER}/g" /opt/proxysql/proxysql.ctl
sed -i "s/PKG_ARCH/${ARCH}/g" /opt/proxysql/proxysql.ctl
cp /opt/proxysql/src/proxysql /opt/proxysql/
equivs-build proxysql.ctl
mv "/opt/proxysql/proxysql_${CURVER}_$ARCH.deb" "./binaries/proxysql_${CURVER}-${PKG_RELEASE}_$ARCH.deb"
cp "/opt/proxysql/src/proxysql.sha1" "/opt/proxysql/binaries/proxysql_${CURVER}-${PKG_RELEASE}_$ARCH.id-hash"
# Cleanup current build
rm -f /opt/proxysql/proxysql.ctl /opt/proxysql/proxysql
exit 0
13 changes: 10 additions & 3 deletions docker/images/proxysql/rhel-compliant/entrypoint/entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/p
# Clean and build dependancies and source
echo "==> Building"
cd /opt/proxysql
export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)
if [[ -z ${PROXYSQL_BUILD_TYPE:-} ]] ; then
deps_target="build_deps"
build_target=""
Expand Down Expand Up @@ -46,7 +47,13 @@ mkdir -p /root/rpmbuild/{RPMS,SRPMS,BUILD,SOURCES,SPECS,tmp}
chown -R root:root /root/rpmbuild/SPECS
mv "/opt/proxysql/proxysql-${CURVER}.tar.gz" /root/rpmbuild/SOURCES
cd /root/rpmbuild && rpmbuild -ba SPECS/proxysql.spec --define "version ${CURVER}"
mv "/root/rpmbuild/RPMS/$ARCH/proxysql-${CURVER}-1.$ARCH.rpm" "/opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.$ARCH.rpm"
cp "/opt/proxysql/src/proxysql.sha1" "/opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.$ARCH.id-hash"
cp "/root/rpmbuild/RPMS/$ARCH/proxysql-${CURVER}-1.$ARCH.rpm" "/opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.$ARCH.rpm"
# get SHA1 of the packaged executable
mkdir -p /opt/proxysql/pkgroot/tmp
pushd /opt/proxysql/pkgroot
rpm2cpio /root/rpmbuild/RPMS/${ARCH}/proxysql-${CURVER}-1.${ARCH}.rpm | cpio -iu --to-stdout ./usr/bin/proxysql > tmp/proxysql
sha1sum tmp/proxysql | sed 's|tmp/||' | tee tmp/proxysql.sha1
cp tmp/proxysql.sha1 ../binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.${ARCH}.id-hash
popd
# Cleanup current build
rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/proxysql/proxysql "/opt/proxysql/proxysql-${CURVER}"
rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/proxysql/proxysql /opt/proxysql/proxysql-${CURVER} /opt/proxysql/pkgroot
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/p
# Clean and build dependancies and source
echo "==> Building"
cd /opt/proxysql
export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)
if [[ -z ${PROXYSQL_BUILD_TYPE:-} ]] ; then
deps_target="build_deps"
build_target=""
Expand Down Expand Up @@ -43,9 +44,16 @@ cp -a tools/proxysql_galera_checker.sh tools/proxysql_galera_writer.pl proxysql/
mv proxysql "proxysql-${CURVER}"
tar czvf "proxysql-${CURVER}.tar.gz" proxysql-${CURVER}
mkdir -p /root/rpmbuild/{RPMS,SRPMS,BUILD,SOURCES,SPECS,tmp}
chown -R root:root /root/rpmbuild/SPECS
mv "/opt/proxysql/proxysql-${CURVER}.tar.gz" /root/rpmbuild/SOURCES
cd /root/rpmbuild && rpmbuild -ba SPECS/proxysql.spec --define "version ${CURVER}"
mv "/root/rpmbuild/RPMS/$ARCH/proxysql-${CURVER}-1.$ARCH.rpm" "/opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.$ARCH.rpm"
cp "/opt/proxysql/src/proxysql.sha1" "/opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.$ARCH.id-hash"
cp "/root/rpmbuild/RPMS/$ARCH/proxysql-${CURVER}-1.$ARCH.rpm" "/opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.$ARCH.rpm"
# get SHA1 of the packaged executable
mkdir -p /opt/proxysql/pkgroot/tmp
pushd /opt/proxysql/pkgroot
rpm2cpio /root/rpmbuild/RPMS/${ARCH}/proxysql-${CURVER}-1.${ARCH}.rpm | cpio -iu --to-stdout ./usr/bin/proxysql > tmp/proxysql
sha1sum tmp/proxysql | sed 's|tmp/||' | tee tmp/proxysql.sha1
cp tmp/proxysql.sha1 ../binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.${ARCH}.id-hash
popd
# Cleanup current build
rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/proxysql/proxysql "/opt/proxysql/proxysql-${CURVER}"
rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/proxysql/proxysql /opt/proxysql/proxysql-${CURVER} /opt/proxysql/pkgroot
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/p
# Clean and build dependancies and source
echo "==> Building"
cd /opt/proxysql
export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)
if [[ -z ${PROXYSQL_BUILD_TYPE:-} ]] ; then
deps_target="build_deps"
build_target=""
Expand Down Expand Up @@ -45,9 +46,16 @@ cp -a tools/proxysql_galera_checker.sh tools/proxysql_galera_writer.pl proxysql/
mv proxysql "proxysql-${CURVER}"
tar czvf "proxysql-${CURVER}.tar.gz" proxysql-${CURVER}
mkdir -p /root/rpmbuild/{RPMS,SRPMS,BUILD,SOURCES,SPECS,tmp}
chown -R root:root /root/rpmbuild/SPECS
mv "/opt/proxysql/proxysql-${CURVER}.tar.gz" /root/rpmbuild/SOURCES
cd /root/rpmbuild && rpmbuild -ba SPECS/proxysql.spec --define "version ${CURVER}"
mv "/root/rpmbuild/RPMS/$ARCH/proxysql-${CURVER}-1.$ARCH.rpm" "/opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.$ARCH.rpm"
cp "/opt/proxysql/src/proxysql.sha1" "/opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.$ARCH.id-hash"
cp "/root/rpmbuild/RPMS/$ARCH/proxysql-${CURVER}-1.$ARCH.rpm" "/opt/proxysql/binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.$ARCH.rpm"
# get SHA1 of the packaged executable
mkdir -p /opt/proxysql/pkgroot/tmp
pushd /opt/proxysql/pkgroot
rpm2cpio /root/rpmbuild/RPMS/${ARCH}/proxysql-${CURVER}-1.${ARCH}.rpm | cpio -iu --to-stdout ./usr/bin/proxysql > tmp/proxysql
sha1sum tmp/proxysql | sed 's|tmp/||' | tee tmp/proxysql.sha1
cp tmp/proxysql.sha1 ../binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.${ARCH}.id-hash
popd
# Cleanup current build
rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/proxysql/proxysql "/opt/proxysql/proxysql-${CURVER}"
rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/proxysql/proxysql /opt/proxysql/proxysql-${CURVER} ./pkgroot
16 changes: 11 additions & 5 deletions docker/images/proxysql/suse-compliant/entrypoint/entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} /opt/p
# Clean and build dependancies and source
echo "==> Building"
cd /opt/proxysql
export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)
if [[ -z ${PROXYSQL_BUILD_TYPE:-} ]] ; then
deps_target="build_deps"
build_target=""
Expand Down Expand Up @@ -52,11 +53,16 @@ cp -a etc/proxysql.cnf proxysql-${CURVER}/etc/
cp -a etc/logrotate.d proxysql-${CURVER}/etc/
cp -a tools/proxysql_galera_checker.sh tools/proxysql_galera_writer.pl proxysql-${CURVER}/usr/share/proxysql/tools
tar czvf "proxysql-${CURVER}.tar.gz" proxysql-${CURVER}
mv "/opt/proxysql/proxysql-${CURVER}.tar.gz" /root/rpmbuild/SOURCES
mv "/opt/proxysql/proxysql-${CURVER}.tar.gz" "/root/rpmbuild/SOURCES"
# build package
#cd /root/rpmbuild && rpmbuild -bb SPECS/proxysql.spec --define "version ${CURVER}"
rpmbuild -bb --define "version ${CURVER}" /root/rpmbuild/SPECS/proxysql.spec
mv /root/rpmbuild/RPMS/${ARCH}/proxysql-${CURVER}-1.${ARCH}.rpm .//binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.${ARCH}.rpm
cp ./src/proxysql.sha1 ./binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.${ARCH}.id-hash
cp /root/rpmbuild/RPMS/${ARCH}/proxysql-${CURVER}-1.${ARCH}.rpm ./binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.${ARCH}.rpm
# get SHA1 of the packaged executable
mkdir -p /opt/proxysql/pkgroot/tmp
pushd /opt/proxysql/pkgroot
rpm2cpio /root/rpmbuild/RPMS/${ARCH}/proxysql-${CURVER}-1.${ARCH}.rpm | cpio -iu --to-stdout ./usr/bin/proxysql > tmp/proxysql
sha1sum tmp/proxysql | sed 's|tmp/||' | tee tmp/proxysql.sha1
cp tmp/proxysql.sha1 ../binaries/proxysql-${CURVER}-1-${PKG_RELEASE}.${ARCH}.id-hash
popd
# cleanup
rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} ./proxysql-${CURVER}
rm -fr /root/.pki /root/rpmbuild/{BUILDROOT,RPMS,SRPMS,BUILD,SOURCES,tmp} ./proxysql-${CURVER} ./pkgroot

0 comments on commit 75af8d6

Please sign in to comment.