10
submitted 2 months ago by thingsiplay@lemmy.ml to c/archlinux@lemmy.ml

I want to create and upload an AUR package. For context, I did that years ago for specific releases, but now I want to create a new package that focuses on upstream Git without specific releases.

What do I write to the pkgver= value? Do I just take the latest version there? Because it is downloading with git clone the version number will not change and the PKGBUILD script will compare pkgver() instead. So what is the purpose of pkgver= for when downloading and building from Git directly? Looking at examples from other existing packages, they all have a number there. But its mostly outdated, so I don't get it.

pkgname=thename-git
_pkgname="$(pkgname%-git}"
pkgver=???

pkgver() {
    cd "${_pkgname}"
    git describe --long | sed 's/\([^-]*-g\)/r\1/'
}

I am reading and researching, but need some assistance for this question. Currently reading the Archwiki:

you are viewing a single comment's thread
view the rest of the comments
[-] thingsiplay@lemmy.ml 1 points 2 months ago

By all respect, I'm not asking how to get current version or tag from downloaded source. The git describe is already in the script under pkgver(), which is used to compare the current version with installed version. My question is about the variable pkgver=. What do I type in there? Why does everyone have a version number there, if the current version is read and compared with git describe in pkgver()?

[-] exu@feditown.com 2 points 2 months ago

Use the same version there. Pacman just needs a version value and by using the git version you're not actively breaking anything.

this post was submitted on 26 Sep 2026
10 points (91.7% liked)

Arch Linux

10065 readers
1 users here now

The beloved lightweight distro

founded 6 years ago
MODERATORS