Skip to content

Commit fd0f5c6

Browse files
committed
Add RPM build instructions
1 parent 3cc07e3 commit fd0f5c6

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

packaging/rpm/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Setup a development environment
2+
3+
In order to build your own RPMs you have to setup your own _development environment_ as explained [here](https://wiki.centos.org/HowTos/SetupRpmBuildEnvironment).
4+
5+
### Quick setup
6+
7+
1. Install the ``rpm-build`` and ``rpmdevtools`` packages.
8+
9+
2. Login as **normal user** and create the following structure in the home directory:
10+
```bash
11+
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
12+
```
13+
3. Create the RPM macros file with the following content:
14+
```bash
15+
echo "%_topdir $HOME/rpmbuild" > ~/.rpmmacros
16+
```
17+
18+
### Prepare the build
19+
20+
4. Clone this repo:
21+
```bash
22+
git clone https://github.com/vpenso/prometheus-slurm-exporter.git
23+
```
24+
5. Get into the source directory and copy the following files under ``~/rpmbuild/SOURCES``:
25+
```bash
26+
cd prometheus-slurm-exporter
27+
cp README.md ~/rpmbuild/SOURCES
28+
cp LICENSE ~/rpmbuild/SOURCES
29+
cp lib/systemd/prometheus-slurm-exporter.service ~/rpmbuild/SOURCES
30+
```
31+
6. Copy the SPEC file in the proper directory:
32+
```bash
33+
cd prometheus-slurm-exporter
34+
cp packaging/rpm/*.spec ~/rpmbuild/SPECS
35+
```
36+
37+
### Build the RPM package
38+
39+
8. Build the RPM based on your SPEC file:
40+
```bash
41+
cd $HOME/rpmbuild/SPECS
42+
rpmbuild -ba prometheus-slurm-exporter.spec
43+
```
44+
9. The RPM package will be placed under $HOME/rpmbuild/RPMS/x86_64

0 commit comments

Comments
 (0)