Goal
Make dfetch installable via dnf on Fedora (and compatible distros such as RHEL, CentOS Stream, openSUSE) by publishing to a COPR project.
Background
dfetch already builds a self-contained binary via Nuitka and produces an .rpm in CI (build.yml via fpm). COPR is the standard community hosting for RPM packages outside the official Fedora repos. Users would install with:
dnf copr enable dfetch-org/dfetch
dnf install dfetch
Suggested plan
1. Write packaging/dfetch.spec
COPR builds from a source RPM (srpm), which requires a .spec file. Since dfetch is a pre-built binary (Nuitka), the spec wraps the binary rather than compiling from source:
Name: dfetch
Version: 0.14.2
Release: 1%{?dist}
Summary: Vendor tool for fetching external dependencies
License: MIT
URL: https://github.com/dfetch-org/dfetch
Source0: https://github.com/dfetch-org/dfetch/releases/download/%{version}/dfetch-%{version}-nix.tar.gz
ExclusiveArch: x86_64
%description
dfetch fetches external dependencies and copies them directly into
your project as plain files — no submodules, no externals.
%prep
%setup -q -c
%install
install -Dm755 dfetch %{buildroot}%{_bindir}/dfetch
%files
%{_bindir}/dfetch
%changelog
* Fri Jun 27 2025 dfetch-org <bot@dfetch.dev> - 0.14.2-1
- Initial COPR packaging
2. Create a COPR project
- Go to https://copr.fedorainfracloud.org/ and create project
dfetch-org/dfetch.
- Select the chroots to build for:
fedora-rawhide-x86_64, fedora-41-x86_64, fedora-42-x86_64, epel-9-x86_64.
- Enable "follow Fedora branching" so new Fedora versions are auto-enabled.
3. Generate an API token
- COPR → Account → API → generate token.
- Store it as
COPR_API_TOKEN in a GitHub copr environment secret.
4. Add copr-publish.yml workflow
name: Publish to COPR
on:
release:
types: [published]
workflow_dispatch:
inputs:
release-tag:
description: 'Release tag (e.g. 0.14.2)'
required: true
jobs:
publish:
if: >-
github.event_name != 'release' ||
github.event.release.tag_name != 'latest'
runs-on: ubuntu-latest
environment:
name: copr
url: https://copr.fedorainfracloud.org/coprs/dfetch-org/dfetch
steps:
- uses: actions/checkout@...
- name: Install build tools
run: sudo apt-get install -y rpm rpmbuild copr-cli
- name: Build source RPM
env:
TAG: ${{ github.event.release.tag_name || inputs.release-tag }}
run: |
sed -i "s/^Version:.*/Version: ${TAG}/" packaging/dfetch.spec
spectool -g -R packaging/dfetch.spec
rpmbuild -bs packaging/dfetch.spec \
--define "_sourcedir $HOME/rpmbuild/SOURCES" \
--define "_srcrpmdir dist/"
- name: Submit to COPR
env:
COPR_TOKEN: ${{ secrets.COPR_API_TOKEN }}
run: |
copr-cli --config <(echo -e "[copr-cli]\nlogin=...\nusername=dfetch-org\ntoken=${COPR_TOKEN}\ncopr_url=https://copr.fedorainfracloud.org") \
build dfetch-org/dfetch dist/*.src.rpm
Alternatively use the copr-build GitHub Action to avoid shelling out copr-cli directly.
5. Verify the build
Once the first COPR build succeeds, test on a Fedora container:
docker run --rm -it fedora:latest bash
dnf copr enable dfetch-org/dfetch
dnf install -y dfetch
dfetch --version
Acceptance criteria
Goal
Make
dfetchinstallable viadnfon Fedora (and compatible distros such as RHEL, CentOS Stream, openSUSE) by publishing to a COPR project.Background
dfetch already builds a self-contained binary via Nuitka and produces an
.rpmin CI (build.ymlviafpm). COPR is the standard community hosting for RPM packages outside the official Fedora repos. Users would install with:dnf copr enable dfetch-org/dfetch dnf install dfetchSuggested plan
1. Write
packaging/dfetch.specCOPR builds from a source RPM (
srpm), which requires a.specfile. Since dfetch is a pre-built binary (Nuitka), the spec wraps the binary rather than compiling from source:2. Create a COPR project
dfetch-org/dfetch.fedora-rawhide-x86_64,fedora-41-x86_64,fedora-42-x86_64,epel-9-x86_64.3. Generate an API token
COPR_API_TOKENin a GitHubcoprenvironment secret.4. Add
copr-publish.ymlworkflow5. Verify the build
Once the first COPR build succeeds, test on a Fedora container:
docker run --rm -it fedora:latest bash dnf copr enable dfetch-org/dfetch dnf install -y dfetch dfetch --versionAcceptance criteria
dnf copr enable dfetch-org/dfetch && dnf install dfetchworks on Fedora 41+fedora-41-x86_64andfedora-42-x86_64chrootslatesttag