Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions base/comps/azurelinux-repos/azurelinux-repos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ BuildRequires: gnupg sed rpm

Source1: archmap
Source2: azurelinux.repo.in
Source3: microsoft.repo

Source10: RPM-GPG-KEY-azurelinux-4.0-primary

Expand Down Expand Up @@ -121,6 +122,16 @@ render_repo \
'https://stcontroltowerdevjwisitg.blob.core.windows.net/azl4-dev' \
0 0 '6h'

# Install the Microsoft subrepo in both subpackages. The URL is fixed to
# packages.microsoft.com (the Microsoft-curated content lives there
# regardless of which Azure Linux base repo a system is pointed at), so the
# same file is shipped to both variants. The .main / .dev suffixes are
# stripped by RemovePathPostfixes.
install -m 644 %{SOURCE3} \
"$RPM_BUILD_ROOT/etc/yum.repos.d/microsoft.repo.main"
install -m 644 %{SOURCE3} \
"$RPM_BUILD_ROOT/etc/yum.repos.d/microsoft.repo.dev"

%check
# Make sure all repo variables were substituted
for repo in $RPM_BUILD_ROOT/etc/yum.repos.d/*.repo.*; do
Expand Down Expand Up @@ -172,6 +183,26 @@ for repo in "$main_file" "$dev_file"; do
fi
done

# Microsoft subrepo: shipped in both subpackages. Must exist, be enabled by
# default, GPG-signed, and point at packages.microsoft.com.
for microsoft_file in \
$RPM_BUILD_ROOT/etc/yum.repos.d/microsoft.repo.main \
$RPM_BUILD_ROOT/etc/yum.repos.d/microsoft.repo.dev; do
if [ ! -f "$microsoft_file" ]; then
echo "ERROR: missing $microsoft_file"
exit 1
fi
if ! grep -q '^baseurl=https://packages.microsoft.com/azurelinux/\$releasever/beta/microsoft/\$basearch$' "$microsoft_file"; then
echo "ERROR: $microsoft_file must point at packages.microsoft.com microsoft subrepo"
exit 1
fi
if [ "$(grep -c '^enabled=1' "$microsoft_file")" -ne 1 ] || \
[ "$(grep -c '^gpgcheck=1' "$microsoft_file")" -ne 1 ]; then
echo "ERROR: $microsoft_file must be enabled=1 and gpgcheck=1"
exit 1
fi
done

# Check arch keys exists on supported architectures, and RPM considers
# them valid
TMPRING=$(mktemp)
Expand All @@ -190,10 +221,12 @@ rm -f "$TMPRING"
%files
%dir /etc/yum.repos.d
%config(noreplace) /etc/yum.repos.d/azurelinux.repo.main
%config(noreplace) /etc/yum.repos.d/microsoft.repo.main

%files dev
%dir /etc/yum.repos.d
%config(noreplace) /etc/yum.repos.d/azurelinux.repo.dev
%config(noreplace) /etc/yum.repos.d/microsoft.repo.dev

%files -n azurelinux-gpg-keys
%dir /etc/pki/rpm-gpg
Expand Down
11 changes: 11 additions & 0 deletions base/comps/azurelinux-repos/microsoft.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[azurelinux-microsoft]
name=Azure Linux $releasever - $basearch - Microsoft
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: comparing this with azurelinux.repo, it's easy to notice that this subrepo has no pattern for publishing debuginfo packages or SRPMs.

That's something we should evaluate advocating for in the future, at least for packages that are in this subrepo but are fully OSS (e.g. dotnet).

baseurl=https://packages.microsoft.com/azurelinux/$releasever/beta/microsoft/$basearch
enabled=1
countme=1
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-azurelinux-$releasever-$basearch
skip_if_unavailable=False
2 changes: 1 addition & 1 deletion locks/azurelinux-repos.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Managed by azldev component update. Do not edit manually.
version = 1
input-fingerprint = 'sha256:dc8e54faeb318ce06ea7bebf1e96fea93aeb959508c382709a9aec54792d7314'
input-fingerprint = 'sha256:33f4990ff0a7a4c7b2879135f7f59db129908d95ca217505676404b21504313b'
38 changes: 37 additions & 1 deletion specs/a/azurelinux-repos/azurelinux-repos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 8;
release_number = 9;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
Expand All @@ -25,6 +25,7 @@ BuildRequires: gnupg sed rpm

Source1: archmap
Source2: azurelinux.repo.in
Source3: microsoft.repo

Source10: RPM-GPG-KEY-azurelinux-4.0-primary

Expand Down Expand Up @@ -134,6 +135,16 @@ render_repo \
'https://stcontroltowerdevjwisitg.blob.core.windows.net/azl4-dev' \
0 0 '6h'

# Install the Microsoft subrepo in both subpackages. The URL is fixed to
# packages.microsoft.com (the Microsoft-curated content lives there
# regardless of which Azure Linux base repo a system is pointed at), so the
# same file is shipped to both variants. The .main / .dev suffixes are
# stripped by RemovePathPostfixes.
install -m 644 %{SOURCE3} \
"$RPM_BUILD_ROOT/etc/yum.repos.d/microsoft.repo.main"
install -m 644 %{SOURCE3} \
"$RPM_BUILD_ROOT/etc/yum.repos.d/microsoft.repo.dev"

%check
# Make sure all repo variables were substituted
for repo in $RPM_BUILD_ROOT/etc/yum.repos.d/*.repo.*; do
Expand Down Expand Up @@ -185,6 +196,26 @@ for repo in "$main_file" "$dev_file"; do
fi
done

# Microsoft subrepo: shipped in both subpackages. Must exist, be enabled by
# default, GPG-signed, and point at packages.microsoft.com.
for microsoft_file in \
$RPM_BUILD_ROOT/etc/yum.repos.d/microsoft.repo.main \
$RPM_BUILD_ROOT/etc/yum.repos.d/microsoft.repo.dev; do
if [ ! -f "$microsoft_file" ]; then
echo "ERROR: missing $microsoft_file"
exit 1
fi
if ! grep -q '^baseurl=https://packages.microsoft.com/azurelinux/\$releasever/beta/microsoft/\$basearch$' "$microsoft_file"; then
echo "ERROR: $microsoft_file must point at packages.microsoft.com microsoft subrepo"
exit 1
fi
if [ "$(grep -c '^enabled=1' "$microsoft_file")" -ne 1 ] || \
[ "$(grep -c '^gpgcheck=1' "$microsoft_file")" -ne 1 ]; then
echo "ERROR: $microsoft_file must be enabled=1 and gpgcheck=1"
exit 1
fi
done

# Check arch keys exists on supported architectures, and RPM considers
# them valid
TMPRING=$(mktemp)
Expand All @@ -203,10 +234,12 @@ rm -f "$TMPRING"
%files
%dir /etc/yum.repos.d
%config(noreplace) /etc/yum.repos.d/azurelinux.repo.main
%config(noreplace) /etc/yum.repos.d/microsoft.repo.main

%files dev
%dir /etc/yum.repos.d
%config(noreplace) /etc/yum.repos.d/azurelinux.repo.dev
%config(noreplace) /etc/yum.repos.d/microsoft.repo.dev

%files -n azurelinux-gpg-keys
%dir /etc/pki/rpm-gpg
Expand All @@ -215,6 +248,9 @@ rm -f "$TMPRING"

%changelog
## START: Generated by rpmautospec
* Fri May 22 2026 Chris Co <chrco@microsoft.com> - 4.0-18
- feat(azurelinux-repos): add Microsoft subrepo

* Wed May 13 2026 reuben olinsky <reubeno@users.noreply.github.com> - 4.0-17
- fix(repos): disable repo_gpgcheck

Expand Down
11 changes: 11 additions & 0 deletions specs/a/azurelinux-repos/microsoft.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[azurelinux-microsoft]
name=Azure Linux $releasever - $basearch - Microsoft
baseurl=https://packages.microsoft.com/azurelinux/$releasever/beta/microsoft/$basearch
enabled=1
countme=1
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-azurelinux-$releasever-$basearch
skip_if_unavailable=False
Loading