Skip to content

Commit

Permalink
Merge pull request #18 from Ultramarine-Linux/w/dnf5
Browse files Browse the repository at this point in the history
add: dnf5-default-package-manager
  • Loading branch information
korewaChino authored May 12, 2024
2 parents 80c67cd + 7cbd660 commit 30fc330
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions comps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<packagereq type="default">ultramarine-shell-config</packagereq>
<packagereq type="default">ultramarine-release</packagereq>
<packagereq type="default">ultramarine-fun</packagereq>
<packagereq type="optional">dnf5-default-package-manager</packagereq>
<packagereq type="default">git</packagereq>
</packagelist>
</group>
Expand Down
5 changes: 5 additions & 0 deletions ultramarine/dnf5-default-package-manager/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "dnf5-default-package-manager.spec"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
%define debug_package %nil

Name: dnf5-default-package-manager
Version: 0
Release: 1%?dist
Summary: Package that sets dnf5 as the default package manager
License: MIT
URL: https://wiki.ultramarine-linux.org/en/usage/um40-dnf5/
Requires: dnf5

%description
This package contains post-install hooks that symlinks %_bindir/dnf
to the new dnf5 binary.

%prep
cat<<EOF > README
The `%name` package replaces `%_bindir/dnf` and `%_bindir/yum` to
point to `%_bindir/dnf5`. For more information, please visit:
%url
EOF

%build

%install

%posttrans
if [ $1 -gt 1 ]; then
rm %_bindir/{dnf,yum}
ln -s %_bindir/dnf5 /usr/bin/dnf
ln -s %_bindir/dnf5 /usr/bin/yum
fi

%preun
rm %_bindir/{dnf,yum}
ln -s /usr/bin/dnf-3 /usr/bin/dnf
ln -s %_bindir/dnf-3 /usr/bin/yum

%triggerin -- dnf
rm %_bindir/{dnf,yum}
ln -s %_bindir/dnf5 /usr/bin/dnf
ln -s %_bindir/dnf5 /usr/bin/yum

%triggerin -- yum
rm %_bindir/{dnf,yum}
ln -s %_bindir/dnf5 /usr/bin/dnf
ln -s %_bindir/dnf5 /usr/bin/yum

%files
%doc README

%changelog
%autochangelog

0 comments on commit 30fc330

Please sign in to comment.