From a6935ca323bc03a23433370cef206069ab07d8b4 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Mon, 21 Jul 2014 16:26:41 +1000 Subject: [PATCH] Update PKGBUILD-git.proto to what' Signed-off-by: Olivier Mehani --- prototypes/PKGBUILD-git.proto | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/prototypes/PKGBUILD-git.proto b/prototypes/PKGBUILD-git.proto index 05b721b..4ff871a 100644 --- a/prototypes/PKGBUILD-git.proto +++ b/prototypes/PKGBUILD-git.proto @@ -18,35 +18,29 @@ groups=() depends=() makedepends=('git') provides=() -conflicts=() +conflicts=(NAME) replaces=() backup=() options=() install= -source=() +source=(${pkgname}::git+SCHEME://GITURL/MODENAME#branch=BRANCH) noextract=() -md5sums=() #generate with 'makepkg -g' - -_gitroot=GITURL -_gitname=MODENAME +md5sums=('SKIP' + ) #generate with 'makepkg -g' + + +pkgver() { + cd "${srcdir}/${pkgname}" + ( set -o pipefail + # Only uses annotated tags to derive a version number, + # add --tags to use un-annotated tags as well + git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) +} build() { - cd "$srcdir" - msg "Connecting to GIT server...." - - if [[ -d "$_gitname" ]]; then - cd "$_gitname" && git pull origin - msg "The local files are updated." - else - git clone "$_gitroot" "$_gitname" - fi - - msg "GIT checkout done or server timeout" - msg "Starting build..." - - rm -rf "$srcdir/$_gitname-build" - git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build" - cd "$srcdir/$_gitname-build" + cd "${srcdir}/${pkgname}" # # BUILD HERE @@ -57,8 +51,8 @@ build() { } package() { - cd "$srcdir/$_gitname-build" - make DESTDIR="$pkgdir/" install + cd "${srcdir}/${pkgname}" + make DESTDIR="${pkgdir}/" install } # vim:set ts=2 sw=2 et: -- 2.0.2