Skip to content

rpm-devel/tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

258 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rpm-devel tools

Build, package, sign, and distribute RPMs for RHEL 7-10, Fedora 38+, and derivatives (AlmaLinux, Rocky, Oracle Linux, CentOS).

Quick start

bash -c "$(curl -q -LSsf "https://github.com/rpm-devel/tools/raw/main/install.sh")"

This installs the scripts to /usr/local/bin (root) or ~/.local/bin (user) and sets up ~/.rpmmacros.

Tools

create-container.sh

Creates Docker build containers for cross-arch RPM builds.

# Create all containers (EL 8/9/10 + Fedora, both amd64 and arm64)
create-container.sh all

# Create a specific version and arch
create-container.sh 10 amd64
create-container.sh fedora arm64

# Enter an existing container
create-container.sh --enter almalinux 10 amd64

# Remove containers
create-container.sh remove all
create-container.sh remove 9 amd64

Options:

Option Description
all Create containers for all enabled versions and arches
arm Create all versions for arm64 only
amd Create all versions for amd64 only
7/8/9/10 Create a specific EL version
fedora Create Fedora containers
--enter Enter the container after creation
--remove Remove a container
--platform <arch> Override the default platform
--image <name> Override the container image

Configuration: ~/.config/rpm-devel/settings.conf

rpmbuild.sh

Builds all (or specific) spec files, installs dependencies, downloads sources, and signs packages.

# Build all specs in ~/rpmbuild/
rpmbuild.sh

# Build a single package
rpmbuild.sh nginx

# Build without signing
rpmbuild.sh --no-sign

# Update tools first
rpmbuild.sh update

What it does:

  1. Finds all .spec files in ~/rpmbuild/
  2. Downloads sources with spectool -g -R
  3. Installs build dependencies with dnf builddep (or yum-builddep)
  4. Runs rpmbuild -ba for each spec
  5. Signs all built RPMs with your GPG key
  6. Prints a build summary (passed/failed)

Output directories:

  • Built RPMs: ~/Documents/builds/rpmbuild/RHEL/el{VER}/{ARCH}/
  • Build logs: ~/Documents/builds/logs/rpmbuild/

make-repo

Organizes built RPMs into repo structure, runs createrepo, and syncs to SourceForge/FTP mirrors.

# Full run: organize, createrepo, sign, sync
make-repo

# Dry run (show what would be done)
make-repo --dry-run

# Set arch and version explicitly
make-repo --arch x86_64 --version 10

# Skip remote sync
make-repo --skip-ftp --skip-sourceforge

What it does:

  1. Separates debug/debuginfo RPMs from main RPMs
  2. Signs all packages with rpm --addsign
  3. Runs createrepo_c (or createrepo) on each repo directory
  4. Syncs to local FTP server (ftp.casjaysdev.pro)
  5. Syncs to SourceForge web hosting (mirror website)
  6. Syncs to SourceForge FRS (download mirrors)

Repo structure on SourceForge:

/RHEL/{VERSION}/{ARCH}/casjay/    - CasjaysDev packages
/RHEL/{VERSION}/{ARCH}/os/        - upstream base OS
/RHEL/{VERSION}/{ARCH}/langs/     - languages (PHP, Node.js)
/RHEL/{VERSION}/{ARCH}/databases/ - databases (MariaDB, PostgreSQL, MongoDB)
/RHEL/{VERSION}/{ARCH}/infra/     - infrastructure (Docker, Jenkins)
/RHEL/{VERSION}/{ARCH}/extras/    - community extras (EPEL, RPM Fusion)
/RHEL/{VERSION}/{ARCH}/kernel/    - ELRepo kernel
/RHEL/{VERSION}/{ARCH}/debug/     - debuginfo RPMs
/RHEL/{VERSION}/sources/          - source RPMs

Configuration: ~/.config/rpm-devel/make-repo-settings.conf

bootstrap

Bootstraps a fresh container for RPM building. Run inside a Docker container.

# Typically called automatically by create-container.sh
bootstrap

Installs build tools, sets up rpmbuild directories, and configures the environment.

bogusDate

Fixes incorrect weekday names in spec file changelogs.

# Fix bogus dates in a spec file
bogusDate mypackage.spec

# Fix multiple specs
bogusDate *.spec

RPM warns about "bogus date" when the weekday doesn't match the actual date (e.g., "Thu" for a day that was actually a Friday). This script automatically corrects them.

Workflow

1. Install tools          ->  install.sh
2. Create build containers ->  create-container.sh all
3. Enter a container      ->  create-container.sh --enter almalinux 10 amd64
4. Build packages         ->  rpmbuild.sh
5. Create repos & sync    ->  make-repo

Configuration

All configuration lives in ~/.config/rpm-devel/:

File Purpose
settings.conf Container settings (images, versions, paths)
make-repo-settings.conf Repo build/sync settings (SourceForge user, FTP)
lists/{7,8,9,10}.txt Package lists per EL version
containers/ Container state tracking
scripts/ Generated container run scripts

Environment variables

Variable Default Description
SOURCEFORGE_USER (required) Your SourceForge username
FTP_USER root FTP server username
ENABLE_VERSION_7 no Build for EL7
ENABLE_VERSION_8 yes Build for EL8
ENABLE_VERSION_9 yes Build for EL9
ENABLE_VERSION_10 yes Build for EL10
ENABLE_FEDORA yes Build for Fedora
FEDORA_VERSION 42 Fedora version to build

Supported platforms

  • Build host: x86_64 Linux with Docker
  • Target arches: x86_64, aarch64 (via QEMU user-static)
  • Target distros: RHEL/AlmaLinux/Rocky/Oracle 7-10, Fedora 38+, CentOS 7+
  • Build system: COPR compatible

Repository layout

All repos follow this directory structure on SourceForge FRS, local FTP, and local mirror:

RHEL/{VER}/{ARCH}/
  casjay/         Our custom-built packages (rpm-devel specs)
  testing/        Packages being tested before promotion to casjay/
  os/             Upstream base OS (AlmaLinux baseos, appstream, crb, extras)
  langs/          Programming languages (PHP via Remi, Node.js, Yarn)
  databases/      Database servers (MariaDB, PostgreSQL, MongoDB)
  infra/          Infrastructure tools (Docker, Jenkins, Webmin, Pritunl, Incus)
  extras/         Community repos (EPEL, RPM Fusion, Ghettoforge)
  kernel/         Kernel packages (ELRepo kernel, drivers)
  debug/          All debuginfo and debugsource RPMs
  empty/          Placeholder for arches/versions with no packages

RHEL/{VER}/
  sources/        All source RPMs (arch-independent)

Repo section -> directory mapping

Category Repo Sections Mirror Dir
CasjaysDev casjay-packages casjay/
Testing casjay-testing testing/
Base OS casjay-os-base, casjay-os-appstream, casjay-os-crb, casjay-os-extras, casjay-os-plus, casjay-os-* os/
Languages casjay-remi-*, casjay-nodejs, casjay-yarn langs/
Databases casjay-mariadb, casjay-postgresql, casjay-mongodb databases/
Infrastructure casjay-docker, casjay-jenkins, casjay-webmin, casjay-pritunl, casjay-copr-*, casjay-i2pd infra/
Extras casjay-epel, casjay-rpmfusion-*, casjay-gf extras/
Kernel casjay-elrepo, casjay-elrepo-kernel, casjay-elrepo-extras kernel/
Debug All *-debuginfo-*, *-debugsource-* debug/
Sources All *-srpm repos sources/

Tool -> directory mapping

Tool Writes To Reads From
rpmbuild.sh ~/Documents/builds/rpmbuild/ (build output) Spec files in ~/rpmbuild/
make-repo casjay/, debug/, sources/ + all createrepo Build output from rpmbuild.sh
create-mirror os/, langs/, databases/, infra/, extras/, kernel/ Upstream repos

See LAYOUT.md for the complete mapping reference.

Related repos

About

tools for my rpm development

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages