This is a specification file used to build RPMs for Yggdrasil.
There's no need to build the package yourself for many RPM-based distributions — you can find pre-built packages on Fedora COPR.
- Fedora COPR page: https://copr.fedorainfracloud.org/coprs/neilalexander/yggdrasil-go/
- Yggdrasil installation instructions: https://yggdrasil-network.github.io/installation-linux-rpm.html
This assumes you have Go 1.17 or later installed.
Start by installing rpmbuild
:
dnf install rpmbuild
Create the working folders:
mkdir -p /tmp/rpmbuild/BUILD /tmp/rpmbuild/RPMS /tmp/rpmbuild/SOURCES /tmp/rpmbuild/SPECS /tmp/rpmbuild/SRPMS
Place the yggdrasil.spec
file into /tmp/rpmbuild/SPECS
.
Download the sources for the specified version, e.g. v0.4.4
:
curl -o/tmp/rpmbuild/SOURCES/v0.4.4 https://codeload.github.com/yggdrasil-network/yggdrasil-go/tar.gz/v0.4.4
Build the RPM:
cd /tmp/rpmbuild/
rpmbuild -v -bb SPECS/yggdrasil.spec
Make sure you have rpmbuild and mock installed:
sudo dnf install rpmbuild mock
Download all sources defined in SPEC file:
spectool -g -R yggdrasil.spec
Create a SRPM (source RPM) package from the SPEC file:
rpmbuild -bs yggdrasil.spec
Create RPM package in an isolated environment using mock
:
mock -r fedora-30-x86_64 --rebuild ~/rpmbuild/SRPMS/yggdrasil-0.3.5-1.fc30.src.rpm --old-chroot
(--old-chroot is needed because it enables internet connection in the build environment)
You will find your package in /var/lib/mock/fedora-29-x86_64/result
.