/rpmbuilder

RPM package build helper

Primary LanguageShellApache License 2.0Apache-2.0

GitHub Actions CI Status

Usage demoInstallationTipsUsageBuild StatusContributingLicense


rpmbuilder is RPM package build helper.

Usage demo

rpmbuilder.mp4

Installation

sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm
sudo dnf install rpmbuilder

Build node:

sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm
sudo dnf install rpmbuilder-node

Using Makefile and Git

git clone https://kaos.sh/rpmbuilder.git
cd rpmbuilder
sudo make install

Using Docker

We provide a big variety of Docker images available on GitHub Container Registry and Docker Hub.

Official images

Basic images:

  • ghcr.io/essentialkaos/rpmbuilder:ol8 (OracleLinux 8)
  • ghcr.io/essentialkaos/rpmbuilder:ol9 (OracleLinux 9)
  • essentialkaos/rpmbuilder:ol8 (OracleLinux 8)
  • essentialkaos/rpmbuilder:ol9 (OracleLinux 9)

Build node images:

  • ghcr.io/essentialkaos/rpmbuilder:node-ol8 (OracleLinux 8 | Port: 2038)
  • ghcr.io/essentialkaos/rpmbuilder:node-ol9 (OracleLinux 9 | Port: 2039)
  • essentialkaos/rpmbuilder:node-ol8 (OracleLinux 8 | Port: 2038)
  • essentialkaos/rpmbuilder:node-ol9 (OracleLinux 9 | Port: 2039)

Package build using base image:

# Download and install rpmbuilder-docker script
curl -fL# -o rpmbuilder-docker https://kaos.sh/rpmbuilder/rpmbuilder-docker
chmod +x rpmbuilder-docker
sudo mv rpmbuilder-docker /usr/bin/

# Pull rpmbuilder image based on OracleLinux 8
docker pull ghcr.io/essentialkaos/rpmbuilder:ol8
export IMAGE=ghcr.io/essentialkaos/rpmbuilder:ol8

# Build package locally
cd my-package-dir
rpmbuilder-docker my-package.spec

# Build package using build nodes
rpmbuilder-docker my-package.spec -r buildnode-ol7.acme.corp:2022 -r buildnode-ol8.acme.corp:2022 -k $(base64 -w0 ~/.ssh/buildnode)

Package build using build node image:

docker pull ghcr.io/essentialkaos/rpmbuilder:node-ol8
docker run -e PUB_KEY="$(cat ~/.ssh/buildnode.pub)" -p 2038:2038 -d ghcr.io/essentialkaos/rpmbuilder:node-ol8

cd my-package-dir

# Using local version of rpmbuilder (if you are use RHEL, Alma, Rocky, CentOS…)
rpmbuilder my-package.spec -r builder@localhost:2038 -k ~/.ssh/buildnode

# With docker helper script (any Linux distro or macOS)
rpmbuilder-docker my-package.spec -r builder@localhost:2038 -k $(base64 -w0 ~/.ssh/buildnode)

You can bootstrap your own build farm using Docker and rpmbuilder-farm script:

curl -fL# -o rpmbuilder-farm https://kaos.sh/rpmbuilder/rpmbuilder-farm
chmod +x rpmbuilder-farm
sudo mv rpmbuilder-farm /usr/bin/

# Install farm script
sudo rpmbuilder-farm install

# Create user bob and add public key
sudo farm add-user bob

# Start all containers for user bob
sudo farm start bob

rpmbuilder-farm preview

Tips

  • You could define rpmbuilder options inside your specs (example). It very helpful for determining information about external sources.
  • If you have a big bunch of default options, you can define them in the preferences file. More info.
  • Since version 2.5.0 rpmbuilder provides automatic checksum generation feature. More info.

Usage

rpmbuilder

rpmbuilder-farm

Build Status

Branch Status
master CI
develop CI

Contributing

Before contributing to this project please read our Contributing Guidelines.

License

Apache License, Version 2.0