You are not logged in.
Hello, I've been making my own PKGBUILD for zfs, and I'm trying to implement it as a split package since zfs-dkms and zfs-utils share the same source repository. However, I've run into a few caveats:
I use pkgver() to determine the tag of the latest release, so I can't specify the fragment in the sources URL. This causes makepkg to create a non-tracking branch that I can't use.
Since each package has a separate build configuration, I end up creating a worktree in srcdir. This results in an error that prevents me from rebuilding without passing the -C option to makepkg.
Ideally, I would like to be able to include git+https://github.com/openzfs/zfs.git in the noextract list and perform my the branch/checkout operation myself in prepare().
Here is my current prepare() implementation:
prepare() {
cd "${srcdir}/zfs"
# Verify signature and create separate worktree for dkms
git tag --verify "zfs-${pkgver}"
git checkout "zfs-${pkgver}"
git worktree add -d ../zfs-dkms "zfs-${pkgver}"
# Generate makefiles for zfs-utils
./autogen.sh
# Apply build config changes for zfs-dkms
cd "${srcdir}/zfs-dkms"
patch -p1 -i ../dkms-configure.ac.patch
patch -p1 -i ../dkms.mkconf.patch
./autogen.sh
}
Offline
VCS sources aren't extracted because there's nothing to extract since the source is not an archive. However, makepkg is going to do a git pull no matter what. You can control it in the source() array, don't do it in prepare().
source=("git+https://github.com/openzfs/zfs.git#tag=$pkgver?signed"
validpgpkeys=('4F3BA9AB6D1F8D683DC2DFB56AD860EED4598027' # Tony Hutter (GPG key for signing ZFS releases) <hutter2@llnl.gov>
'C33DF142657ED1F7C328A2960AB9E991C6AF658B') # Brian Behlendorf <behlendorf1@llnl.gov>
pkgver() {
cd "$pkgname"
git describe --tags | sed 's/-/+/g'
}
Offline
VCS sources aren't extracted because there's nothing to extract since the source is not an archive. However, makepkg is going to do a git pull no matter what. You can control it in the source() array, don't do it in prepare().
The issue is that pkgver() is called later, which results in the wrong version being checked out.
Offline
The pkgver() function does not do anything except generate the pkgver. Again, the source() array is where git tags are checked out. The prepare() function runs before pkgver(), by the way.
Offline
So, does that mean I can't/shouldn't be checking out my own tags in prepare()?
Offline
Right.
Offline
In that case, how should I be handling this? I'm wanting to track the latest official release automatically. Since both packages are built from the same source tree (and the build order matters), I would like it to be a split package.
Offline
First off, you either use a VCS package, building from git HEAD, or you use a release package, building from a specific commit/tag. You can't make a PKGBUILD that updates automatically to the latest release.
Second, a single git repo doesn't make it a split package, a single build does. If it's separate builds, make separate PKGBUILDs. Set SRCDEST so it doesn't have to clone from upstream again.
Offline
Is it important for you that both packages are build from the same commit ?
If yes, https://bbs.archlinux.org/viewtopic.php?id=285786
If not, SRCDEST is the way to go.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Online