hyperreal.coffee

Create an RPM repository

Install dependencies

1sudo dnf install -y gnupg createrepo dnf-utils rpm-sign wget

Setup GnuPG

1echo "%echo Generating a PGP key
2Key-Type: RSA
3Key-Length: 4096
4Name-Real: Jeffrey Serio
5Name-Email: hyperreal@moonshadow.dev
6Expire-Date: 0
7%no-ask-passphrase
8%no-protection
9%commit" > ~/hyperreal-pgp-key.batch
1gpg --no-tty --batch --gen-key ~/hyperreal-pgp-key.batch

Export the public key.

1gpg --armor --export "Jeffrey Serio" > ~/hyperreal-pgp-key.pub

Export the private key to back it up somewhere safe.

1gpg --armor --export-secret-keys "Jeffrey Serio" > ~/hyperreal-pgp-key.sec

After backing it up, shred it from the working directory.

1shred -xu ~/hyperreal-pgp.key.sec

Setup RPM signing

Replace E1933532750E9EEF with your key’s ID.

1echo "%_signature gpg
2%_gpg_name E1933532750E9EEF" > ~/.rpmmacros

Create a directory to serve the repository.

1mkdir -p ~/rpm-repo/packages

Move RPM packages into the repo directory. Then sign them with the following command:

1rpm --addsign ~/rpm-repo/packages/*.rpm

Create repo index

Once all the packages are signed, create the repository with the following command:

1createrepo ~/rpm-repo/packages/

The above command will create a directory in the repo named repodata containing a file named repomd.xml.

Note that the createrepo must be run against each directory in the repo containing .rpm files.

Now sign the repo metadata with the following command:

1gpg --detach-sign --armor ~/rpm-repo/packages/repodata/repomd.xml

Create a .repo file

1echo "[hyperreal-kernel-bazzite]
2name=hyperreal kernel bazzite $releasever
3baseurl=https://rpm.hyperreal.coffee/kernel-bazzite/fedora-$releasever/$basearch
4enabled=1
5gpgcheck=1
6gpgkey=https://rpm.hyperreal.coffee/hyperreal-pgp-key.pub" > ~/rpm-repo/hyperreal-kernel-bazzite.repo

The RPM repository should now be ready to be served on a web server with ~/rpm-repo as the web root.

Example Caddy configuration

1rpm.hyperreal.coffee {
2        root * /home/jas/rpm-repos/
3        file_server browse
4}

Reply to this post by email ↪