It actually wasn't very hard at all. I spun up a builder instance, built the rpms, copied them to an S3 bucket and then installed them on a fresh instance. Here's the steps:
1. prep the builder instance as root, getting all the dependencies installed.
yum -y --enablerepo=epel install fedora-packager rpmdevtools yum -y --enablerepo=epel install gcc gd-devel zlib-devel libpng-devel libjpeg-devel libdbi-devel perl-ExtUtils-Embed yum -y --enablerepo=epel install httpd-devel php php-devel php-gd php-ldap php-pdo php-xml php-pear useradd makerpm
2. Never build an rpm as root. Use the "makerpm" user:
sudo su - makerpm rpmdev-setuptree cd rpmbuild/ cat > .rpmmacros << EOF %_topdir %(echo $HOME)/rpmbuild %_smp_mflags -j3 %__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot EOF
3. Build icinga-core rpms:
sudo su - makerpm cd rpmbuild/SOURCES/ wget https://github.com/Icinga/icinga-core/releases/download/v1.11.0/icinga-1.11.0.tar.gz tar zxvf icinga-1.11.0.tar.gz icinga-1.11.0/icinga.spec mv icinga-1.11.0/icinga.spec ../SPECS/ rmdir icinga-1.11.0 cd .. rpmbuild -ba --define="_vendor redhat" SPECS/icinga.spec
4. Build icinga-web rpms:
sudo su - makerpm cd rpmbuild/SOURCES/ wget https://github.com/Icinga/icinga-web/releases/download/v1.11.0/icinga-web-1.11.0.tar.gz tar zxvf icinga-web-1.11.0.tar.gz icinga-web-1.11.0/icinga-web.spec mv icinga-web-1.11.0/icinga-web.spec ../SPECS/ rmdir icinga-web-1.11.0 cd .. rpmbuild -ba --define="_vendor redhat" SPECS/icinga-web.spec
This process leans heavily on the Build Icinga RPMS page which is based on the How to create an RPM package page.
2 comments:
You are my hero! Thank you so much; built flawlessly.
Works great on icinga version 2 as well, although you have to modify the spec file to remove the systemd requirement for el>=7. It looks like AWS linux might not be moving to systemd anytime soon.
Simply set that to 0, and you should be good to go, as long as you have added the additional dependencies.
openssl-devel gcc-c++ libstdc++-devel cmake flex bison boost-devel mysql-devel postgresql-devel
Post a Comment