You are not logged in.
Pages: 1
Hey there, this is my PKGBUILD for the lap library. Should I change anything before submitting it to AUR?
# Maintainer: gilzoide <gilzoide@gmail.com>
pkgname=lap-git
pkgver=20160312
pkgrel=1
pkgdesc="A functional style C++11 library for parsing command line arguments"
arch=('i686' 'x86_64')
url="https://github.com/gilzoide/lap"
license=("GPL3")
depends=()
makedepends=('git' 'scons')
source=("$pkgname"::'git://github.com/gilzoide/lap.git')
md5sums=('SKIP')
# Make pkg version as last commit date
pkgver () {
cd "$pkgname"
git log -n 1 --date=short | awk '/Date/ {gsub ("-",""); print $2}'
}
# Build with scons
# Change to "scons debug=1" if you want a build with debug symbols
build () {
cd "$pkgname"
scons
}
# Install with scons
# Change to "scons debug=1 install --prefix "${pkgdir}"" if you want a build
# with debug symbols
package () {
cd "$pkgname"
scons install --prefix "${pkgdir}"
}
Offline
Please don't use the date for the pkgver. Git isn't linear, so there's nothing to stop the date of the last commit from being older than the one before it. It also doesn't work when there's more than one commit on a given day, and can change based on the local system's time zone.
Is there really no runtime deps?
Last edited by Scimmia (2016-03-13 20:26:32)
Offline
Please don't use the date for the pkgver.
Uh, I get it, thanks. But what should I use instead?
Is there really no runtime deps?
Well, there's libc/libstdc++, as it's pure C++11. Should I include it?
Offline
Perhaps this (WIP) document I prepared on the subject of versioning for VCS packages (at least git and hg) may be useful to you: https://ptpb.pw/r/h-9U.md
You can find some examples of good (mostly git based) PKGBUILDs here, avoid the AUR if possible.
Additionally, use namcap to help you find issues with either the PKGBUILD or the resulting package tarball.
Last edited by Earnestly (2016-03-14 12:55:30)
Offline
Please don't use the date for the pkgver.
Uh, I get it, thanks. But what should I use instead?
Please follow recommendations in the wiki:
https://wiki.archlinux.org/index.php/VC … 9_function
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Additionally, use namcap to help you find issues with either the PKGBUILD or the resulting package tarball.
Namcap only tells me there's no Contributor tag
Thank you all, I'm using git + revision pkgver now
pkgver() {
cd "$pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
I'll post it in AUR, thanks again
Offline
Pages: 1