RBM_TUTORIAL(7)
β¨ rbm_tutorial β¨
okay bestie, gather round, we're learning rbm_tutorial π (that's the page name, and also literally what this is: a tutorial intro to rbm)
πΈ NAME πΈ
rbm_tutorial β a tutorial introduction to rbm, but make it actually make sense π«Ά
π DESCRIPTION π
So this tutorial is gonna walk you through starting to use rbm to build rpm and debian packages for different distributions. no gatekeeping here.
And for the example we're packaging the tor software. iconic choice tbh.
π CREATING A NEW WORKSPACE π
Step one, bestie: make yourself an rbm workspace. In this example we're using ~/rbm, but fr fr you could use literally anything:
$ mkdir ~/rbm
$ cd ~/rbm
Now the first thing you gotta do is create the main configuration file, which holds the config for all the projects in this workspace. For now we're just adding the compress_tar option, and we'll add more options later whenever we need them. lowkey minimal, highkey efficient.
$ cat > rbm.conf <<END
compress_tar: xz
END
And what does compress_tar do? It means we want tarballs compressed using xz. periodt. β¨
π¦ CREATING A NEW PROJECT π¦
Next up we're adding the tor project. To do that we just make the directory inside the projects directory and drop a config file in there with the configuration for the project. The main option we're setting is git_url, which is the url used to clone the git repository of the software. And if your project uses mercurial instead of git, no worries β you could set hg_url instead. iykyk.
$ mkdir -p projects/tor
$ cat > projects/tor/config <<END
git_url: https://git.torproject.org/tor.git
END
We can vibe check that the project is correctly defined using the projects command:
$ rbm projects
tor
And we can display the tor project configuration using the showconf command:
$ rbm showconf tor
---
git_url: https://git.torproject.org/tor.git
look at that. she's defined. π
β VERSION SETTINGS β
First thing you do when adding a new project: configure the version settings. rbm needs to be able to compute the version of the software, for any git commit. no exceptions.
By default, rbm will use the latest tag on which a commit is based as the version number. Sometimes that works β when the project uses version numbers as tags β but bestie, that is not always the case π. Alternatively you can define a var/version_command option with a shell script or command that will print the version number. your call.
For tor, we're gonna use a var/version_command option. The version of the software is defined in the ChangeLog file, so we'll use a simple command to get it. The tor config file now looks like this:
git_url: https://git.torproject.org/tor.git
version: '[% exec(c("var/version_command")) %]'
var:
version_command: perl -ne 'if (m/^Changes in version ([^-]+)-.*$/) { print "$1\n"; exit }' < ChangeLog
Using the showconf command, we can check the value of the version option for different commits:
$ rbm showconf tor version --git-hash master
0.2.5.1
$ rbm showconf tor version --git-hash tor-0.2.4.17-rc
0.2.4.17
heads up π«Ά the first time you run this command, the git repository will have to be cloned, which can take some time. go get a snack, you've earned it.
π CREATING A TARBALL π
Okay so now that the version configuration is set, we're ready to create a tarball based on a git commit. We do this with the tar command:
$ rbm tar tor --git-hash master
Created /home/boklm/rbm/out/tor-0.2.5.1.tar.xz
$ rbm tar tor --git-hash tor-0.2.4.17-rc
Created /home/boklm/rbm/out/tor-0.2.4.17.tar.xz
ate. π
π BUILDING AN RPM PACKAGE π
To build rpm packages, you're gonna need to define an rpm step (peep rbm_steps(7) for that) in rbm.conf.
The rbm.conf file should define an rpm option containing the commands to build an rpm package:
rpm: |
#!/bin/bash
[ here the commands for building an rpm package ]
π unfortunately, this part of the tutorial β the whole details-about-the-definition-of-the-rpm-step thing β has not been written yet. it's giving "coming soon" energy, not gonna lie.
You should be able to start a build with the build command and the --step option:
$ rbm build --step rpm tor
π§ BUILDING A DEBIAN PACKAGE π§
Similarly to the rpm package, building debian packages will require that you define a deb step in rbm.conf. And yeah β this part of the tutorial has not been written yet either. π same vibe, different step.
π₯ USING A BUILD CONTAINER π₯
Using the remote options (see rbm_remote(7)) you can do the builds inside containers. Unfortunately this part of the tutorial has not been written yet π. But bestie, you can look at the Tor Browser build repository for an example:
https://gitweb.torproject.org/builders/tor-browser-build.git/
π SEE ALSO π
and that's the whole page, bestie π₯° go build something gorgeous. this was rbm_tutorial(7) from the 07/25/2025 era β mwah, drink some water, clone that repo, slay πβ¨π
π¦ where this page comes from
- fedora 43: rbm 0.4^20241205gitc6a4095-3.fc43 Β· CC0-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms