You are not logged in.
I just created a PKGBUILD for ugtrain. This is my first PKGBUILD so I would like it to be reviewed before submitting it to the AUR. Could someone review it please?
PKGBUILD
# Maintainer: Greizgh <greizgh@ephax.org>
pkgname=ugtrain-git
pkgver=688.d9519a1
pkgrel=1
pkgdesc="The Universal Elite Game Trainer for CLI"
arch=('i686' 'x86_64')
url="https://github.com/ugtrain/ugtrain"
license=('GPL3')
depends=()
makedepends=('git')
provides=(ugtrain)
source=(git://github.com/ugtrain/ugtrain.git)
md5sums=('SKIP')
pkgver() {
cd "$srcdir/ugtrain"
printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "$srcdir/ugtrain"
./autogen.sh
}
build() {
cd "$srcdir/ugtrain"
./configure --prefix=/usr
make
}
check() {
cd "$srcdir/ugtrain"
make -k check
}
package() {
cd "$srcdir/ugtrain"
make DESTDIR="$pkgdir/" install
}
Thank you!
Offline
Run namcap on your package and remove undefined vars like depends. Seems ok otherwise at first glance.
% namcap ugtrain-git-688.d9519a1-1-x86_64.pkg.tar.xz
ugtrain-git E: Dependency gcc-libs detected and not included (libraries ['usr/lib/libgcc_s.so.1', 'usr/lib/libstdc++.so.6'] needed in files ['usr/bin/ugtrain'])
Last edited by graysky (2017-02-18 10:49:44)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Why would you use that pkgver function when the repo has tags? Check the VCS Package Guidelines page in the wiki.
Offline
Thank you both for your feedback!
I fixed the missing dependency and updated the pkgver to use the available tags.
This is what I will submit:
# Maintainer: Greizgh <greizgh@ephax.org>
pkgname=ugtrain-git
pkgver=v0.3.r45.d9519a1
pkgrel=1
pkgdesc="The Universal Elite Game Trainer for CLI"
arch=('i686' 'x86_64')
url="https://github.com/ugtrain/ugtrain"
license=('GPL3')
depends=('gcc-libs')
makedepends=('git')
provides=(ugtrain)
source=(git://github.com/ugtrain/ugtrain.git)
md5sums=('SKIP')
pkgver() {
cd "$srcdir/ugtrain"
printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}
prepare() {
cd "$srcdir/ugtrain"
./autogen.sh
}
build() {
cd "$srcdir/ugtrain"
./configure --prefix=/usr
make
}
check() {
cd "$srcdir/ugtrain"
make -k check
}
package() {
cd "$srcdir/ugtrain"
make DESTDIR="$pkgdir/" install
}
Offline
This is what I will submit:
pkgver=v0.3.r45.d9519a1
It's common and recommended to cut off the leading v
git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
Last edited by mis (2017-02-18 14:30:26)
Offline
Remove the pkgver function entirely and use the tagged versions as regular source. No git required.
https://github.com/ugtrain/ugtrain/archive/v0.3.tar.gz
cd "$srcdir/$pkgver"
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Remove the pkgver function entirely and use the tagged versions as regular source. No git required.
https://github.com/ugtrain/ugtrain/archive/v0.3.tar.gz
cd "$srcdir/$pkgver"
Which makes no sense at all in a -git package.
Offline
Note too that the printf in the pkgver function currently serves no pupose. The git command piped through sed will print the result, no need to capture that in a subshell to send it to printf just to print it again.
In other words, the following two lines have the same result. Use the second one:
printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g'
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
@scrim - Your suggestions was to use tags, no? Why use git at all when upstream tags the releases was my thought.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
@scrim - Your suggestions was to use tags, no? Why use git at all when upstream tags the releases was my thought.
No, my suggestion was to use git describe in the pkgver fuction since there are tags present.
Offline