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
本质上,这就是 distgit 的用途:保持包规范的协调和可用。所以,让我们使用它。
我们需要设置我们的系统以便能够构建包:
首先,在https://src.fedoraproject.org/browse/projects/上找到你的包。我用
guile22
一个例子:太好了,此时我们拥有构建软件包所需的一切!让我们转到我们通过搜索找到的
guile22
distgit 站点,然后单击“克隆”按钮;我们会看到 URLhttps://src.fedoraproject.org/rpms/guile22.git
。就是这样!