# This breaks the skopeo build
%define _custom_macros \
%%rhel 9 \
%%centos 9

# This is required to build toolbox, but breaks other things
#%define _custom_fedora \
#%%fedora %%{nil}

%define _custom_repo \
[mirror.stream.centos.org_9-stream] \
name=c9 \
baseurl=https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/ \
includepkgs=cargo,rust,rust-toolset,rust-std-static,llvm-libs \
enabled=1 \
gpgcheck=0 \

Name:           custom-macros
Version:        1.0
Release:        8%{?dist}
Summary:        Custom user-defined macros

License:        MIT
URL:            https://github.com/fedora-copr
BuildArch:      noarch

%description
This package installs custom user-defined RPM macros to the buildroot

%prep

%build

%install
mkdir -p %{buildroot}%{rpmmacrodir}
echo "%_custom_macros" > %{buildroot}%{rpmmacrodir}/macros.custom
#echo "%_custom_fedora" > %{buildroot}%{rpmmacrodir}/macros.zcustom
mkdir -p %{buildroot}/etc/yum.repos.d
echo "%_custom_repo" > %{buildroot}/etc/yum.repos.d/c9-stream.repo

%files
%{rpmmacrodir}/macros.custom
#%{rpmmacrodir}/macros.zcustom
/etc/yum.repos.d/c9-stream.repo

%changelog
* Wed Feb 12 2025 Anish Bhatt
- Add centos9 stream repo to only allow rust and dependencies


* Tue Feb 11 2025 Anish Bhatt
- Initial package based on https://docs.pagure.org/copr.copr/user_documentation.html#rpm-macros