From 39e9904ba4f49196a9e145fb585b13063c768a76 Mon Sep 17 00:00:00 2001
From: Hector Martin <marcan@fedoraproject.org>
Date: Nov 23 2024 13:47:56 +0000
Subject: Add asahi-repos-devel


---

diff --git a/asahi-repos.spec b/asahi-repos.spec
index d83ace9..d648e84 100644
--- a/asahi-repos.spec
+++ b/asahi-repos.spec
@@ -1,6 +1,6 @@
 Name:           asahi-repos
 Version:        1
-Release:        17%{?dist}
+Release:        18%{?dist}
 Summary:        Additional repositories for Apple Silicon hardware enablement
 
 License:        MIT
@@ -29,6 +29,17 @@ Source:         group_asahi-mesa-x86_64.repo
 Source:         group_asahi-steam.repo
 Source:         RPM-GPG-KEY-group_asahi-steam
 
+%global repo_sources %SOURCE2 %SOURCE4 %SOURCE6 %SOURCE8 %SOURCE10 %SOURCE12 %SOURCE14 %SOURCE15 %SOURCE17
+%global key_sources %SOURCE3 %SOURCE5 %SOURCE7 %SOURCE9 %SOURCE11 %SOURCE13 %SOURCE16 %SOURCE18
+%dnl install mesa x86 overlay repos only on aarch64
+%if "%{_arch}" == "aarch64"
+%global repo_sources %{repo_sources} %SOURCE19 %SOURCE20
+%if (0%{?fedora} && 0%{?fedora} >= 40)
+%global repo_sources %{repo_sources} %SOURCE21
+%global key_sources %{key_sources} %SOURCE22
+%endif
+%endif
+
 Requires:       fedora-repos
 Requires:       fedora-gpg-keys
 Obsoletes:      %{name}-common < 1-5
@@ -41,6 +52,13 @@ BuildArch:      noarch
 Additional repositories for enablement packages for Apple Silicon hardware
 maintained by the Fedora Asahi SIG.
 
+%package devel
+Summary:        Additional repositories for Apple Silicon hardware enablement (pre-release)
+Requires:       %{name}-common = %{version}-%{release}
+%description devel
+Additional repositories for enablement packages for Apple Silicon hardware
+maintained by the Fedora Asahi SIG (pre-release).
+
 %package edge
 Summary:        Unstable repositories for Apple Silicon hardware enablement
 Requires:       %{name} = %{version}-%{release}
@@ -63,23 +81,24 @@ enablement packages maintained by the Fedora Asahi SIG.
 cp -p %SOURCE0 %SOURCE1 .
 
 %build
+for source in %{repo_sources}; do
+  f="$(basename $source)"
+  case "$f" in
+    *mesa*|*u-boot.repo|*scripts.repo|*kernel.repo|*flatpak.repo)
+      sed -e 's/\]$/:devel]/' \
+        -e 's,basearch/$,basearch/devel/,' \
+        -e 's/^name.*$/\0 (devel)/' \
+        -e 's/priority=5/priority=2/' \
+        "$source" > ${f%%.repo}-devel.repo
+    ;;
+  esac
+done
 
 %install
 install -Dpm0644 -t %{buildroot}%{_sysconfdir}/yum.repos.d \
-  %SOURCE2 %SOURCE4 %SOURCE6 %SOURCE8 %SOURCE10 %SOURCE12 %SOURCE14 %SOURCE15 %SOURCE17
+  %{repo_sources} *-devel.repo
 install -Dpm0644 -t %{buildroot}%{_sysconfdir}/pki/rpm-gpg \
-  %SOURCE3 %SOURCE5 %SOURCE7 %SOURCE9 %SOURCE11 %SOURCE13 %SOURCE16 %SOURCE18
-%dnl install mesa x86 overlay repos only on aarch64
-%if "%{_arch}" == "aarch64"
-install -Dpm0644 -t %{buildroot}%{_sysconfdir}/yum.repos.d \
-  %SOURCE19 %SOURCE20
-%if (0%{?fedora} && 0%{?fedora} >= 40)
-install -Dpm0644 -t %{buildroot}%{_sysconfdir}/yum.repos.d \
-  %SOURCE21
-install -Dpm0644 -t %{buildroot}%{_sysconfdir}/pki/rpm-gpg \
-  %SOURCE22
-%endif
-%endif
+  %{key_sources}
 
 %files
 %license LICENSE
@@ -106,6 +125,19 @@ install -Dpm0644 -t %{buildroot}%{_sysconfdir}/pki/rpm-gpg \
 %endif
 %endif
 
+%files devel
+%license LICENSE
+%doc README.md
+%config(noreplace) %{_sysconfdir}/yum.repos.d/group_asahi-kernel-devel.repo
+%config(noreplace) %{_sysconfdir}/yum.repos.d/group_asahi-fedora-remix-scripts-devel.repo
+%config(noreplace) %{_sysconfdir}/yum.repos.d/group_asahi-mesa-devel.repo
+%config(noreplace) %{_sysconfdir}/yum.repos.d/group_asahi-u-boot-devel.repo
+%config(noreplace) %{_sysconfdir}/yum.repos.d/group_asahi-flatpak-devel.repo
+%if "%{_arch}" == "aarch64"
+%config(noreplace) %{_sysconfdir}/yum.repos.d/group_asahi-mesa-i386-devel.repo
+%config(noreplace) %{_sysconfdir}/yum.repos.d/group_asahi-mesa-x86_64-devel.repo
+%endif
+
 %files edge
 %license LICENSE
 %doc README.md
@@ -126,6 +158,9 @@ echo 'and then reboot your system.'
 echo
 
 %changelog
+* Sat Nov 23 2024 Hector Martin <marcan@fedoraproject.org> - 1-18
+- Added asahi-repos-devel
+
 * Sun Oct 13 2024 Hector Martin <marcan@fedoraproject.org> - 1-17
 - Gate steam on F40+
 

