Compare commits

...

4 Commits
2.13.8 ... main

Author SHA1 Message Date
Gitouche a6b23f98e7 2.14.2 2024-02-24 17:26:37 +01:00
Gitouche 046ba8237e Release 2.13.9 2023-12-22 10:29:59 +01:00
Gitouche 7542070678 Release 2.14.0 2023-07-19 09:01:27 +02:00
Gitouche f47e903451 maj rebuild script 2023-07-18 16:01:21 +02:00
2 changed files with 18 additions and 11 deletions

View File

@ -1,5 +1,5 @@
---
icinga2_version: 2.13.8
icinga2_version: 2.14.2
icinga_selinux_common_version: 1.0.0
icinga2_rpmfiles:
- https://git.garbaye.fr/api/packages/Garbaye/generic/icinga2/{{ icinga2_version }}/icinga2-{{ icinga2_version }}-1.el{{ ansible_distribution_major_version }}.{{ ansible_architecture }}.rpm

View File

@ -6,25 +6,32 @@ cd ${ABSDIR}
type -P docker >/dev/null && DOCKER=$(which docker)
type -P podman >/dev/null && DOCKER=$(which podman)
ICINGA2_VERSION=2.13.8
ICINGA2_SPECSOURCE='https://archive.softwareheritage.org/browse/content/sha1_git:6ad9b69b021045c50ada3f1b19f746bbeb51d949/raw/?filename=icinga2.spec'
ICINGA_SELINUX_COMMON_SOURCE='https://packages.icinga.com/fedora/36/release/src/icinga-selinux-common/icinga-selinux-common-1.0.0-1.fc36.icinga.src.rpm'
ICINGA2_SOURCERPM='https://packages.icinga.com/fedora/38/release/src/icinga2/icinga2-2.14.2-1.fc38.src.rpm'
ICINGA_SELINUX_COMMON_SOURCERPM='https://packages.icinga.com/fedora/38/release/src/icinga-selinux-common/icinga-selinux-common-1.0.0-1.fc38.src.rpm'
ARCH=$(${DOCKER} run --rm docker.io/library/rockylinux:8 uname -i)
ICINGA2_DIST=$(echo $ICINGA2_SOURCERPM | awk -F "/" '{print $NF}' | awk -F "." '{print $(NF-2)}')
ICINGA2_REVISION=$(echo $ICINGA2_SOURCERPM | awk -F "/" '{print $NF}' | awk -F ".${ICINGA2_DIST}" '{print $1}' | awk -F "-" '{print $NF}')
ICINGA_SELINUX_COMMON_DIST=$(echo $ICINGA_SELINUX_COMMON_SOURCERPM | awk -F "/" '{print $NF}' | awk -F "." '{print $(NF-2)}')
ICINGA_SELINUX_COMMON_REVISION=$(echo $ICINGA_SELINUX_COMMON_SOURCERPM | awk -F "/" '{print $NF}' | awk -F ".${ICINGA_SELINUX_COMMON_DIST}" '{print $1}' | awk -F "-" '{print $NF}')
mkdir /tmp/dockerrpmbuild-$$
for rocky_version in 8 9; do
${DOCKER} run -i --rm -v /tmp/dockerrpmbuild-$$:/out:Z docker.io/library/rockylinux:${rocky_version} <<EOF
rpm -E %{rhel} | grep -q 8 && {
dnf -y install dnf-plugins-core hardlink
dnf -y install dnf-plugins-core hardlink mysql-devel
dnf config-manager --set-enabled powertools
}
dnf install -qy rpm-build rpmdevtools bison boost-devel cmake flex gcc-c++ libedit-devel libstdc++-devel logrotate make mariadb-connector-c-devel ncurses-devel openssl-devel postgresql-devel selinux-policy-devel systemd-devel
rpm -E %{rhel} | grep -q 9 && {
dnf -y install --enablerepo=crb mysql-devel
}
dnf install -qy rpm-build rpmdevtools bison boost-devel cmake flex gcc-c++ libedit-devel libstdc++-devel logrotate make ncurses-devel openssl-devel postgresql-devel selinux-policy-devel systemd-devel
useradd -m dontbuildasroot -s /bin/bash
runuser -l dontbuildasroot -c 'mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}'
runuser -l dontbuildasroot -c 'rpm2cpio ${ICINGA_SELINUX_COMMON_SOURCE} | cpio -idmvD ~/rpmbuild/SPECS/'
runuser -l dontbuildasroot -c 'curl -sSL -o ~/rpmbuild/SPECS/icinga2.spec ${ICINGA2_SPECSOURCE}'
runuser -l dontbuildasroot -c 'sed -i "s|Version: 2.13.5|Version: ${ICINGA2_VERSION}|g" ~/rpmbuild/SPECS/icinga2.spec'
runuser -l dontbuildasroot -c 'rpm -i ${ICINGA2_SOURCERPM}'
runuser -l dontbuildasroot -c 'rpm -i ${ICINGA_SELINUX_COMMON_SOURCERPM}'
runuser -l dontbuildasroot -c 'sed -i "s|Release: ${ICINGA2_REVISION}\.${ICINGA2_DIST}$|Release: ${ICINGA2_REVISION}%{?dist}|" ~/rpmbuild/SPECS/icinga2.spec'
runuser -l dontbuildasroot -c 'sed -i "s|\.${ICINGA2_DIST}|\$(rpm -E %{dist})|g" ~/rpmbuild/SPECS/icinga2.spec'
runuser -l dontbuildasroot -c 'sed -i "s|Release: ${ICINGA_SELINUX_COMMON_REVISION}\.${ICINGA_SELINUX_COMMON_DIST}$|Release: ${ICINGA_SELINUX_COMMON_REVISION}%{?dist}|" ~/rpmbuild/SPECS/icinga-selinux-common.spec'
runuser -l dontbuildasroot -c 'spectool -g -R ~/rpmbuild/SPECS/icinga-selinux-common.spec'
runuser -l dontbuildasroot -c 'spectool -g -R ~/rpmbuild/SPECS/icinga2.spec'
runuser -l dontbuildasroot -c 'rpmbuild -ba ~/rpmbuild/SPECS/icinga-selinux-common.spec'
runuser -l dontbuildasroot -c 'rpmbuild -ba ~/rpmbuild/SPECS/icinga2.spec'