You are not logged in.

#1 2006-07-08 14:08:32

DaNiMoTh
Member
Registered: 2006-06-10
Posts: 260

Git guideline

Are there a guideline for making PKGBUILD of devel-programs that uses git ?

Offline

#2 2006-07-08 17:09:21

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Git guideline

Not that I'm aware of, but maybe you could adapt the CVS/SVN guidelines. kernel26-beyond-git in the AUR might give you some ideas as well.

Offline

#3 2006-07-08 17:49:02

DaNiMoTh
Member
Registered: 2006-06-10
Posts: 260

Re: Git guideline

Uhm, I would try to write it, here. Any idea are welcome big_smile

This is an example PKGBUILD:

pkgname=compiz-git
pkgver=20060707
pkgrel=1
pkgdesc="Composite and window manager for Xgl"
url="http://en.opensuse.org/Compiz"
license=""
depends=('xgl-cvs' 'mesa-xgl-cvs' 'cairo-devel' 'libxevie' 
         'startup-notification' 'libpng'  'libxdamage' 
         'libxrandr' 'libwnck-compiz' 'gnome-desktop' 'control-center' 
         'libsvg-cairo' 'libxcomposite')
makedepends=('git')
conflicts=()
replaces=()
backup=()
install=compiz.install
source=(compiz-intel-copy-pixel-issue-workaround-1.diff)
md5sums=('10a157b86d528bca2be6731c5eaff7b3')

_gitroot="git://anongit.freedesktop.org/git/xorg/app/compiz"
_gitname="compiz"
build() {
export CFLAGS="$CFLAGS -I/opt/mesa-xgl-cvs/include"
  cd $startdir/src
  msg "Connecting to git.freedesktop.org GIT server...."

  if [ -d $startdir/src/$_gitname ] ; then
  cd $_gitname && git-pull origin
  msg "The local files are updated."
  else
  git clone $_gitroot
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting make..."

  cp -r $startdir/src/$_gitname $startdir/src/$_gitname-build
  cd $startdir/src/$_gitname-build
  patch -Np0 -i ${startdir}/src/compiz-intel-copy-pixel-issue-workaround-1.diff

  ACLOCAL="aclocal -I /opt/gnome/share/aclocal" ./autogen.sh --host=${CHOST} 
    --prefix=/usr 
    --infodir=/usr/share/info 
    --mandir=/usr/man 
    --sysconfdir=/opt/gnome/etc 
    --enable-gnome 
    --enable-libsvg-cairo 
    --enable-gconf-dump 
    --disable-kde || return 1
  make || return 1
  make DESTDIR=$startdir/pkg install
  rm -rf $startdir/src/$_gitname-build

  find $startdir/pkg -type f -name '*.la' -exec rm {} ;
}

As you see, I use "-git" suffix in the pkgname, and two variables, _gitroot and _gitname for identify the repositories and the name of the package.
As you see, I need to introduce an if condition:

if [ -d $startdir/src/$_gitname ] ; then
  cd $_gitname && git-pull origin
  msg "The local files are updated."
  else
  git clone $_gitroot
  fi

because we have two commands, one for updating source and one for getting it.
I copy the source code in a "-build" directory ( the same thing that we do with -cvs and -svn program ) and, after install, I delete it.

What you think about that? Is a good way to build package?
Thanks you big_smile

Offline

Board footer

Powered by FluxBB