You are not logged in.
I'm making a PKGBUILD that takes stuff directly from git.
I've - I think - managed to set pkgver based on git tag, but when I make a aur package with "mkaurball", it puts the current version in the name. Is that OK?
I don't want to have to make new aurball each time I make a new tag.
Here's my PKGBUILD - looks OK?
# Maintainer: Ondřej Hruška <ondra@ondrovo.com>
pkgname='sdscp'
pkgver=1.3.2
pkgrel=1
pkgdesc="External preprocessor and pre-compiler for SDS-C (by AN-D.cz)"
arch=('any')
url='https://github.com/MightyPork/sdscp'
license=('GPL2')
depends=('python3')
makedepends=('git')
source=('git+https://github.com/MightyPork/sdscp.git')
provides=('sdscp')
md5sums=('SKIP')
pkgver() {
cd "${srcdir}/${pkgname}"
git describe --tags | sed 's|-|.|g'
}
package() {
# install license
install -Dm 644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
# install files in /usr/share
# install -d "${pkgdir}/usr/share/${pkgname}/"
mkdir "${pkgdir}/usr/share/${pkgname}/"
cp -pR ${srcdir}/${pkgname}/* ${pkgdir}/usr/share/${pkgname}/
# chmod +x "${pkgdir}/usr/share/${pkgname}/sdscp.py"
# install link in /usr/bin
mkdir -p "${pkgdir}/usr/bin/"
ln -s "/usr/share/${pkgname}/sdscp" "${pkgdir}/usr/bin/sdscp"
}Last edited by MightyPork (2014-10-03 12:03:55)
If it ain't broke, pacman -Syyu and it will be
Offline
I think the name of the package should show that it is a git packages:
pkgname='sdscp-git'I'm sorry, I don't remember exactly how to make a PKGBUILD file for a git package, but if you follow the git PKGBUILD template in "/usr/share/pacman" then you should be fine. ![]()
EDIT: Apparently we should NOT be using the templates at the moment... ![]()
Last edited by drcouzelis (2014-10-03 12:51:59)
Offline
I think the name of the package should show that it is a git packages:
pkgname='sdscp-git'I'm sorry, I don't remember exactly how to make a PKGBUILD file for a git package, but if you follow the git PKGBUILD template in "/usr/share/pacman" then you should be fine.
Yeah, it will be sdscp-git. So the rest looks OK?
If it ain't broke, pacman -Syyu and it will be
Offline
Don't use the /usr/share/pacman template - it's way out of date, and no longer accurate. The VCS PKGBUILD Guidelines in the wiki are current, you should apply them to your package.
Offline
Yes, it's OK. There are a couple of minor things that could be changed, but it should work fine.
Offline
Personal preference - add the date of the commit to the version string.
e.g.
$ git log -1 --format=%cd.%h --date=short|tr -d -
20140723.77fea8bvs.
$ git describe --tags | sed 's|-|.|g'
fatal: No names found, cannot describe anything.Reasons include:
- tags can be forgotten or don't always sort well
- git commit short hash is meaningless at a quick look, but good to be able to reference if needed
- standard format, iso date will always sort and version properly
just my opinion though
Last edited by stevenhoneyman (2014-10-03 16:50:29)
My: [ GitHub | AUR Packages ]
Offline
I've - I think - managed to set pkgver based on git tag, but when I make a aur package with "mkaurball", it puts the current version in the name. Is that OK?
I don't want to have to make new aurball each time I make a new tag.
If you just want to provide the package in the AUR, then you don't have to create a new aurball for new tags.
If you want to support the update search of AUR helpers like cower, pacaur or yaourt, you'll have to upload a new aurball each time. Since you create new tags you could add a script that modifies the PKGBUILD, packs it and uploads it to the aur. There is e.g. Xyne's aurploader tool to help with that.
Last edited by progandy (2014-10-03 16:56:17)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Indeed. If people are going to use *-git packages, it's their responsibility to track upstream tags/commits and recompile as necessary.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Personal preference - add the date of the commit to the version string.
e.g.$ git log -1 --format=%cd.%h --date=short|tr -d - 20140723.77fea8bvs.
$ git describe --tags | sed 's|-|.|g' fatal: No names found, cannot describe anything.Reasons include:
- tags can be forgotten or don't always sort well
- git commit short hash is meaningless at a quick look, but good to be able to reference if needed
- standard format, iso date will always sort and version properlyjust my opinion though
Bad idea. Date does nothing to give you version information, it's not stable as the last commit can be before the previous commit, multiple commits on the same day will break the pkgver, etc.
Offline
stevenhoneyman wrote:Personal preference - add the date of the commit to the version string.
e.g.$ git log -1 --format=%cd.%h --date=short|tr -d - 20140723.77fea8bvs.
$ git describe --tags | sed 's|-|.|g' fatal: No names found, cannot describe anything.Reasons include:
- tags can be forgotten or don't always sort well
- git commit short hash is meaningless at a quick look, but good to be able to reference if needed
- standard format, iso date will always sort and version properlyjust my opinion though
Bad idea. Date does nothing to give you version information, it's not stable as the last commit can be before the previous commit, multiple commits on the same day will break the pkgver, etc.
I do include the commit hash(short) to avoid multiple commits on the same day breaking anything.
My: [ GitHub | AUR Packages ]
Offline
But since the hash is psudo-random, you end up with a pkgver going up and down constantly within a given day.
Offline
I just use the commit number. No need for tags or other fancywork. Generally I assign a more standard major version number, use the commit number as a minor version, and tack on the hash as a subversion:
echo "4.$(git rev-list --count HEAD).$(git describe --always )""UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
The date is a poor choice for a version number in a git package. The wiki page about VCS PKGBUILDs does the right thing and uses version tags with revision count after the tag. If you get a lot of bad tags or there are none, use revision count since the beginning of the branch. In order to simplify the identification, append the (abbreviated) commit hash.
https://wiki.archlinux.org/index.php/VC … elines#Git
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
I just use the commit number. No need for tags or other fancywork. Generally I assign a more standard major version number, use the commit number as a minor version, and tack on the hash as a subversion:
echo "4.$(git rev-list --count HEAD).$(git describe --always )"
Please do not do this. If you want the short hash, use git rev-parse --short HEAD, git describe --always will change once the author creates a tag and completely screw up your versioning.
Even better if you pull that major version from somewhere.
Last edited by Scimmia (2014-10-03 23:16:24)
Offline
Eh ... I am the author. And I don't use tags. But that command seems to work great too. Whatever used to be on the wiki failed on all my git repos, so I went with what worked.
Last edited by Trilby (2014-10-03 23:27:20)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline