Skip to main content
This guide walks you through adding a new package to Terra Packages. We’ll cover the complete process from choosing a package to submitting your pull request.

Before Adding a Package

1

Check if the package already exists

Search the repository to avoid duplicates:
# Search for existing packages
find anda/ -name "*package-name*"

# Or search the Terra repository
dnf search package-name --repo=terra
2

Check Fedora repositories

Verify the package isn’t already in Fedora’s official repos:
dnf search package-name
Terra is for packages not available in Fedora repos or for providing newer/modified versions.
3

Verify the package is suitable

Good candidates for Terra:
  • Open source software (preferred)
  • Actively maintained upstream
  • Useful to multiple users
  • Compatible with Fedora’s licensing policies
Do not package proprietary software, malware, or tools that violate laws or ethical guidelines.

Package Structure

Every Terra package requires these files in anda/category/package-name/:

Required Files

1. anda.hcl - Package Configuration

The anda.hcl file defines the package project:
project pkg {
  rpm {
    spec = "package-name.spec"
  }
}
Common labels:
  • mock = 1 - Build using Mock (standard RPM builds)
  • nightly = 1 - Package is a nightly/development version
  • large = 1 - Requires large build runner (for resource-intensive builds)
  • sccache = 0 - Disable sccache for this package
  • no_upload_srpms = 1 - Don’t upload source RPMs

2. *.spec - RPM Spec File

The spec file defines how to build the package. Here are real examples from Terra:
%global crate typos-cli
%define debug_package %{nil}

Name:           typos
Version:        1.44.0
Release:        1%?dist
Summary:        Source Code Spelling Correction

License:        MIT OR Apache-2.0
URL:            https://crates.io/crates/typos-cli
Source0:        %{crates_source}
Source1:        https://raw.githubusercontent.com/crate-ci/%{name}/refs/tags/v%{version}/LICENSE-MIT
Source2:        https://raw.githubusercontent.com/crate-ci/%{name}/refs/tags/v%{version}/LICENSE-APACHE

BuildRequires:  cargo-rpm-macros >= 24
BuildRequires:  mold

%description
Finds and corrects spelling mistakes among source code.

%prep
%autosetup -n %{crate}-%{version}
cp %{S:1} .
cp %{S:2} .
%cargo_prep_online

%build
%cargo_build
%cargo_license_summary_online
%{cargo_license_online} > LICENSE.dependencies

%install
install -Dm 755 target/rpm/%{name} -t %{buildroot}%{_bindir}

%files
%license LICENSE-MIT LICENSE-APACHE LICENSE.dependencies
%doc README.md
%{_bindir}/%{name}

%changelog
* Sun Dec 28 2025 metcya <[email protected]> - 1.40.0-1
- Initial package

Optional Files

update.rhai - Automated Updates

Create an update.rhai script for automatic version updates:
rpm.version(gh("getzola/zola"));
Update scripts run automatically via GitHub Actions to keep packages current.

Patches

Include patch files if needed to fix build issues or apply Fedora-specific changes:
anda/category/package-name/
├── anda.hcl
├── package-name.spec
├── update.rhai
└── fix-build.patch
Reference patches in your spec file:
Patch0:         fix-build.patch

%prep
%autosetup -n %{name}-%{version} -p1

Step-by-Step: Adding a Package

1

Choose the right category

Create your package directory in the appropriate category:
mkdir -p anda/tools/mypackage
cd anda/tools/mypackage
2

Create anda.hcl

cat > anda.hcl << 'EOF'
project pkg {
rpm {
spec = "mypackage.spec"
}
}
EOF
3

Write the spec file

Create mypackage.spec following Fedora packaging guidelines. Use existing packages as templates:
# Look at similar packages for reference
cat ../similar-package/*.spec
Key sections to include:
  • Package metadata (Name, Version, Release, Summary, License, URL)
  • Sources and patches
  • BuildRequires and Requires
  • %description
  • %prep, %build, %install
  • %files with proper file listings
  • %changelog with your entry
4

Add update script (optional)

If the package can be automatically updated:
echo 'rpm.version(gh("upstream/repo"));' > update.rhai
5

Test the build locally

Build and test your package:
# From repository root
anda build anda/tools/mypackage/pkg -c terra-frawhide-x86_64

# Check build output
ls -lh anda-build/rpm/rpms/x86_64/

# Install and test
sudo dnf install anda-build/rpm/rpms/x86_64/mypackage-*.rpm
mypackage --version
6

Commit and push

git add anda/tools/mypackage/
git commit -m "feat: add mypackage version X.Y.Z"
git push origin add-mypackage
7

Submit pull request

Open a PR using the new package template. Fill out:What software is being packaged here? The name of the software and link to website and source code.Describe the motivation Why you want this package and how it provides value to users.Additional context Link to any relevant issues or upstream documentation.

Common Build Requirements

Rust Packages

BuildRequires:  cargo-rpm-macros >= 24
BuildRequires:  mold
BuildRequires:  anda-srpm-macros

Python Packages

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pip

CMake Projects

BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  make

Qt Applications

BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  qt5-linguist

Troubleshooting

Install the build dependencies first:
sudo dnf builddep anda/category/package/*.spec
Add any missing BuildRequires to your spec file.
Ensure you have:
  • cargo-rpm-macros >= 24 in BuildRequires
  • %cargo_prep_online in %prep
  • %cargo_build in %build
  • Proper license handling with %cargo_license_online
Check if files overlap with other packages:
rpm -qf /path/to/conflicting/file
Either remove the file or add a Conflicts: directive.
Verify:
  • All runtime dependencies are listed in Requires:
  • File permissions are correct in %files
  • Binaries are in the right location (%, etc.)
  • Any required data files are installed

Next Steps

Package Guidelines

Learn best practices for packaging

Testing Packages

Test your packages thoroughly

Build docs developers (and LLMs) love