In order to build your own RPMs you have to setup your own development environment as explained here.
-
Install the
rpm-build
andrpmdevtools
packages. -
Login as normal user and create the following structure in the home directory:
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
- Create the RPM macros file with the following content:
echo "%_topdir $HOME/rpmbuild" > ~/.rpmmacros
- Clone this repo:
git clone https://github.com/vpenso/prometheus-slurm-exporter.git
- Get into the source directory and copy the following files under
~/rpmbuild/SOURCES
:
cd prometheus-slurm-exporter
cp README.md ~/rpmbuild/SOURCES
cp LICENSE ~/rpmbuild/SOURCES
cp lib/systemd/prometheus-slurm-exporter.service ~/rpmbuild/SOURCES
- Copy the SPEC file in the proper directory:
cd prometheus-slurm-exporter
cp packaging/rpm/*.spec ~/rpmbuild/SPECS
- Build the RPM based on your SPEC file:
cd $HOME/rpmbuild/SPECS
rpmbuild -ba prometheus-slurm-exporter.spec
- The RPM package will be placed under $HOME/rpmbuild/RPMS/x86_64