diff --git a/.github/workflows/copr-build.yaml b/.github/workflows/copr-build.yaml index bba4317..945d42a 100644 --- a/.github/workflows/copr-build.yaml +++ b/.github/workflows/copr-build.yaml @@ -1,10 +1,14 @@ name: Trigger COPR Build on: - # Trigger on push to main branch - #push: - # branches: - # - main + # Trigger on push, but only for SPECS and SOURCES changes + push: + paths: + - fedora-*/SPECS/*.spec + - fedora-*/SOURCES/** + - centos-*/SPECS/*.spec + - centos-*/SOURCES/** + # Enables manual triggering of the workflow workflow_dispatch: diff --git a/.gitignore b/.gitignore index f243b5f..70af09c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ SRPMS RPMS BUILD BUILDROOT +*.orig +*.rej diff --git a/README.md b/README.md index b0b3d7c..b1b02a6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,14 @@ The packages are built and hosted on COPR. To use them on your aarch64 system: 1. **Enable the COPR repository:** ```bash + # Enable the COPR repository sudo dnf copr enable nmasse-itix/zfs-aarch64 + + # Optionally, limit the packages to only ZFS-related ones + sudo dnf config-manager setopt 'copr:copr.fedorainfracloud.org:nmasse-itix:zfs-aarch64.includepkgs=zfs zfs-dkms libvirt-daemon-driver-storage-zfs' + + # Verify the repository is enabled and packages are available + sudo dnf --repo=copr:copr.fedorainfracloud.org:nmasse-itix:zfs-aarch64 search zfs ``` 2. **Install ZFS packages:** @@ -28,7 +35,7 @@ The packages are built and hosted on COPR. To use them on your aarch64 system: sudo dnf install zfs zfs-dkms # Install libvirt with ZFS support - sudo dnf install libvirt + sudo dnf install libvirt libvirt-daemon-kvm libvirt-daemon-driver-storage-zfs ``` And then follow the [Getting Started](https://openzfs.github.io/openzfs-docs/Getting%20Started/index.html) documentation. @@ -66,6 +73,36 @@ And then send the build to COPR. ./build.sh ``` +## Local compilation + +```sh +# Install dependencies +dnf install -y git git-lfs mock rpm-build + +# Clone the repository +git clone https://github.com/nmasse-itix/zfs-aarch64.git +cd zfs-aarch64 +git lfs install +git lfs pull + +# Function to compile a spec file +function build_spec() { + mock_chroot="$1" + spec="$2" + spec_name="$(basename $spec .spec)" + rootdir="$(dirname $spec)/../" + rootdir="$(realpath $rootdir)" + outdir="$rootdir/RPMS/$spec_name-$mock_chroot-$(date -Iseconds)/" + mkdir -p "$outdir" + rm -f "$rootdir/$spec_name"-*.src.rpm + rpmbuild --define "_topdir $rootdir" -bs "$spec" + mock -r "$mock_chroot" --resultdir="$outdir" "$rootdir/SRPMS/$spec_name"-*.src.rpm +} + +# For example, to build libvirt for Fedora 42 aarch64 +build_spec "fedora-42-aarch64" "fedora-42/SPECS/libvirt.spec" +``` + ## License The source code of ZFS, Libvirt and the Fedora RPM spec files remain licensed under their original license.