私のバージョンのRHEL / EPEL / CentOS / Fedoraで動作するパッケージが必要ですが、他のバージョンのRedhatoidsでのみ動作します。

私のバージョンのRHEL / EPEL / CentOS / Fedoraで動作するパッケージが必要ですが、他のバージョンのRedhatoidsでのみ動作します。

いくつかのFedoraパッケージソフトウェアをCentOSにバックポートしたり、以前のバージョンのEPELからFedoraに、またはその逆に何かを転送したりする状況によく遭遇します。

最小限の労力でどのようにこれを行うことができますか?

ベストアンサー1

本質的に distgit の目的は、パッケージ仕様を調整して使用可能に保つことです。それでは、試してみましょう。

パッケージをビルドするにはシステムを設定する必要があります。

# only on CentOS and other RHEL derivatives:
sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --set-enabled powertools
sudo dnf install --refresh epel-release 
# all:
sudo dnf install --refresh fedpkg 'dnf-command(builddep)' git

まずパッケージを見つけてください。https://src.fedoraproject.org/browse/projects/。私はguile22例えば使用しています:

いいですね。これでパッケージを構築するために必要なすべてが準備されました!行こうguile22分散サイトCloneボタンを検索してクリックすると、見つかったかのようにURLが表示されますhttps://src.fedoraproject.org/rpms/guile22.git

pkgname=guile22
# clone the distgit
git clone "https://src.fedoraproject.org/rpms/${pkgname}.git"
cd "${pkgname}"

## Ask dnf to install build dependencies
### if this fails, read diligently – packages might have changed names and you might
### need to slightly edit the .spec file, or you might need to build the missing 
### dependencies yourself, just like you're building this package, before you can
### continue.
sudo dnf builddep "${pkgname}.spec"

## build
### `fedpkg local` executes the build "unisolatedly" on this very distro.
### Instead of that, you could also omit the `dnf builddep` step above and do a
### `fedpkg mockbuild`. This will take a bit longer, as it needs to set up a clean
### build chroot. Often it's worth it.
fedpkg local
## install
### `fedpkg local` put the RPMs into $arch subdirs, so on my machine those are `x86_64`
### and `noarch`, but if you build for e.g. ppc64, that might be different.
sudo rpm -i x86_64/${pkgname}-*.rpm

それだけです!

おすすめ記事