Skip to content

carch-org/pkgs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is mainly dedicated to Carch for building and installing the Carch package on Arch, Fedora, and openSUSE.

Arch Linux

For Arch, we provide a PKGBUILD that directly grabs the precompiled binary from the latest release.

You can install Carch using this PKGBUILD:

git clone https://github.com/carch-org/pkgs ~/pkgs
cd ~/pkgs/carch-bin
makepkg -si

Fedora & openSUSE

For Fedora and openSUSE, this repo includes a working spec file to build an RPM package. openSUSE supports RPMs, so the same process works for both.

Below is a simple guide to build it yourself.

Install RPM Build Dependencies

Install all the core tools:

sudo dnf install rpm-build rpmdevtools redhat-rpm-config make gcc \
fedora-packager gnupg2 rpm-sign createrepo_c git patch tar

Also install the core build tools for Carch:

sudo dnf install cargo git

Set Up the Build Tree

rpmdev-setuptree

This will create the build directories in ~/rpmbuild.

Get the Spec File

Download the carch.spec file into ~/rpmbuild/SPECS/

wget https://github.com/carch-org/pkgs/raw/refs/heads/main/carch.spec ~/rpmbuild/SPECS/

Change to the SPECS directory:

cd ~/rpmbuild/SPECS

Download the Source Files

Note: Make sure you are in ~/rpmbuild/SPECS/ before running this.

spectool -g -R carch.spec

Build the RPM

rpmbuild -ba carch.spec

Wait for the build to finish, then go to:

cd ~/rpmbuild/RPMS/x86_64/

You will see the .rpm file if the build was successful.

Add GPG Signature (Recommended)

To avoid installation warnings (especially on openSUSE), it’s recommended to sign your RPMs.

Create a GPG Key

gpg --full-generate-key

Use a 4096 key size. Enter your real name and email; the comment is optional.

List your generated keys:

gpg --list-keys

Or with long IDs:

gpg --list-keys --keyid-format LONG

Add Your GPG Name to RPM Macros

Edit (or create) ~/.rpmmacros:

echo '%_gpg_name Your Name <[email protected]>' >> ~/.rpmmacros

Export & Import the Public Key

Note: Use your own key like this, don’t copy paste my key that will not work either.

Export your public key:

gpg --export --armor 36F67F5CD54828D7574F6FF39DE08866EE317104 > publickey.asc

Import it into the RPM keyring:

sudo rpm --import publickey.asc

Sign the RPM

Replace the filename with your actual RPM:

rpmsign --addsign ~/rpmbuild/RPMS/x86_64/carch-5.3.1-1.fc42.x86_64.rpm

You’ll be asked for the passphrase you set when creating your GPG key.

Verify the Signature

rpm --checksig ~/rpmbuild/RPMS/x86_64/carch-5.3.1-1.fc42.x86_64.rpm

A successful result looks like:

carch-5.3.1-1.fc42.x86_64.rpm: digests signatures OK

Install the RPM

sudo dnf install carch-5.3.1-1.fc42.x86_64.rpm

Or on openSUSE:

sudo zypper install carch-5.3.1-1.fc42.x86_64.rpm

Important

openSUSE may warn that the package is unsigned if it was signed on Fedora. To avoid this, sign the RPM on openSUSE too. If you sign on openSUSE, the same RPM works fine on Fedora too. If you only care about Fedora, signing on Fedora is enough.

Also, if you don’t want to sign, you can use --allow-unsigned-rpm:

sudo zypper install -y --allow-unsigned-rpm *.rpm

I will also release pre-signed RPM packages built on openSUSE in the Carch releases, so you can just grab those directly if you prefer.

That’s it from my side! If you notice anything missing or incorrect, feel free to contribute a fix. Thank you!

About

Carch Package Builds 📦

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5

Languages