Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.25 KB

File metadata and controls

44 lines (36 loc) · 1.25 KB

Setup a development environment

In order to build your own RPMs you have to setup your own development environment as explained here.

Quick setup

  1. Install the rpm-build and rpmdevtools packages.

  2. Login as normal user and create the following structure in the home directory:

mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
  1. Create the RPM macros file with the following content:
echo "%_topdir $HOME/rpmbuild" > ~/.rpmmacros

Prepare the build

  1. Clone this repo:
git clone https://github.com/vpenso/prometheus-slurm-exporter.git
  1. 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
  1. Copy the SPEC file in the proper directory:
cd prometheus-slurm-exporter
cp packaging/rpm/*.spec ~/rpmbuild/SPECS

Build the RPM package

  1. Build the RPM based on your SPEC file:
cd $HOME/rpmbuild/SPECS
rpmbuild -ba prometheus-slurm-exporter.spec
  1. The RPM package will be placed under $HOME/rpmbuild/RPMS/x86_64