FROM fedora:40

# Install RPM build tools and dependencies
RUN dnf update -y && dnf install -y \
    rpm-build \
    rpmdevtools \
    meson \
    vala \
    gcc \
    pkgconfig \
    gtk4-devel \
    libadwaita-devel \
    glib2-devel \
    libgee-devel \
    libsecret-devel \
    ImageMagick \
    git \
    && dnf clean all

# Create RPM build environment
RUN rpmdev-setuptree

# Set working directory
WORKDIR /root/rpmbuild

# Copy spec file
COPY dist/rpm/kordophone.spec SPECS/

# Build command
CMD ["rpmbuild", "-ba", "SPECS/kordophone.spec"]
