You are not logged in.

#1 2010-03-28 21:01:41

tomas.skocdopole
Member
Registered: 2010-03-28
Posts: 11

PKGBUILD and git repository

Hello,

I want to write the PKGBUILD for getstream2 program - http://silicon-verl.de/home/flo/projects/streaming/.
I dont know, how to determine _gitname.

Or i have to download repository manually with this code?

  cd ${srcdir}
  msg "Connecting to GIT server...."

  if [ -d "${srcdir}/${_gitname}" ] ; then
    cd ${_gitname} && git pull --rebase
  else
    git clone ${_gitroot}
    cd ${_gitname}
  fi

I have written other PKGBUILD (from mercurial repository) and there were sufficing specify _hg... variables to download repo.

Best regards
Thomas

root@dvb dvb-apps]# cat PKGBUILD 
# Maintainer: Tomáš Skočdopole <tomas.skocdopole@ippolna.cz>
pkgname='getstream2'
pkgver=1
pkgrel=1
pkgdesc="DVB streaming"
arch=('i686' 'x86_64')
url='http://silicon-verl.de/home/flo/projects/streaming/'
license=('GPL')
depends=()
makedepends=('git')
optdepends=()
provides=()
conflicts=()
source=()
md5sums=()
_gitroot="git://hydra.gt.owl.de/getstream.git "
_gitname=""

build()
{
        ...

    make || return 1
}

Offline

#2 2010-03-28 21:06:55

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: PKGBUILD and git repository

_gitroot="git://hydra.gt.owl.de/getstream.git "
_gitname=""


you can add what _gitname you want but is better to reflect what you actually build. in this case i prefer to have _gitname=getstream


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2010-03-29 10:14:47

tomas.skocdopole
Member
Registered: 2010-03-28
Posts: 11

Re: PKGBUILD and git repository

wonder wrote:

_gitroot="git://hydra.gt.owl.de/getstream.git "
_gitname=""


you can add what _gitname you want but is better to reflect what you actually build. in this case i prefer to have _gitname=getstream

Thank you for reply - I modify _gitname variable and run makepkg. But still repo content was not downloaded. There is output from makepkg:

==> Determining latest git revision...
  -> Version found: 20100329
==> Making package: getstream2 20100329-1 x86_64 (Mon Mar 29 12:10:22 CEST 2010)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
==> Extracting Sources...
==> Removing existing pkg/ directory...
==> Starting build()...

Only variable pkgver in the PKGBUILD was modifed to 20100329.

Regards,
Tomas

Offline

#4 2010-03-29 10:19:19

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: PKGBUILD and git repository

Could you post the entire PKGBUILD ? smile

Offline

#5 2010-03-29 12:20:15

tomas.skocdopole
Member
Registered: 2010-03-28
Posts: 11

Re: PKGBUILD and git repository

flamelab wrote:

Could you post the entire PKGBUILD ? smile

Yes, of course:

# Maintainer: Tomáš Skočdopole <tomas.skocdopole@ippolna.cz>
pkgname='getstream2'
pkgver=20100329
pkgrel=1
pkgdesc="DVB streaming"
arch=('i686' 'x86_64')
url='http://silicon-verl.de/home/flo/projects/streaming/'
license=('GPL')
depends=()
makedepends=('git')
optdepends=()
provides=()
conflicts=()
source=()
md5sums=()
_gitroot="git://hydra.gt.owl.de/getstream.git"
_gitname="getstream"

build()
{
    [I assume, that git repo is now downloaded by makepkg, but dont. I am comparing this behaviour with mercurial repositories.]

    make || return 1
}

Offline

#6 2010-03-29 21:14:15

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: PKGBUILD and git repository

No, you must add git clone commands.

I haven't ran it, but use it as a prototype:

# Maintainer: Tomáš Skočdopole <tomas.skocdopole@ippolna.cz>
pkgname='getstream2'
pkgver=20100329
pkgrel=1
pkgdesc="DVB streaming"
arch=('i686' 'x86_64')
url='http://silicon-verl.de/home/flo/projects/streaming/'
license=('GPL')
depends=()
makedepends=('git')
optdepends=()
provides=()
conflicts=()
source=()
md5sums=()
_gitroot="git://hydra.gt.owl.de/getstream.git"
_gitname="getstream"

build()
{
    cd ${srcdir}/

    msg "Connecting to the GIT server...."
    if [[ -d ${srcdir}/${_gitname} ]] ; then
        cd ${_gitname}
        git pull origin
        msg "The local files are updated..."
    else
        git clone ${_gitroot}
    fi
    
    msg "GIT checkout done."

    msg "Starting make for: ${pkgname}"
    
    if [[ -d ${srcdir}/${_gitname}-build ]]; then
       msg "Cleaning the previous build directory..." 
       rm -rf ${srcdir}/${_gitname}-build
    fi

    git clone ${srcdir}/${_gitname} ${srcdir}/${_gitname}-build
    
    cd ${srcdir}/${_gitname}-build
        
    msg "Starting configure..."

    ./configure --prefix=/usr

    make || return 1

    make DESTDIR=${pkgdir} install || return 1

}

Offline

#7 2010-03-31 10:16:12

tomas.skocdopole
Member
Registered: 2010-03-28
Posts: 11

Re: PKGBUILD and git repository

flamelab wrote:

No, you must add git clone commands.

OK, thank you for help. I use your code in my PKGBUILD. So what difference is between hg repo and git repo - because HG repo is automatically downloaded. GIT, SVN and CVS automatic downloading is not yet implemented in makepkg?

Thomas

Offline

#8 2010-03-31 10:17:45

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: PKGBUILD and git repository

No idea about that... :-/

Offline

#9 2010-03-31 10:22:04

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: PKGBUILD and git repository

From memory, hg repos are downloaded to get the correct value for the updating of pkgver.  Overall, the system for SCM based package is crap and needs a good rewrite.

Edit: Install "abs" and look in /usr/share/pacman for PKGBUILD prototypes.

Offline

#10 2010-03-31 10:31:00

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: PKGBUILD and git repository

Allan wrote:

From memory, hg repos are downloaded to get the correct value for the updating of pkgver.  Overall, the system for SCM based package is crap and needs a good rewrite.

Edit: Install "abs" and look in /usr/share/pacman for PKGBUILD prototypes.

Do you mean that it should be more automated or that just makepkg needs code cleanup ?

Offline

#11 2010-03-31 13:55:08

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: PKGBUILD and git repository

As in, you should just be able to add git://url.to/repo in $source and it should "just work". It's extremely non-trivial.

Offline

#12 2010-04-01 07:52:34

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: PKGBUILD and git repository

you mean it is extemly trivial?

Offline

#13 2010-04-01 14:18:49

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: PKGBUILD and git repository

The opposite.

Offline

#14 2010-04-01 14:52:09

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: PKGBUILD and git repository

Allan wrote:

Edit: Install "abs" and look in /usr/share/pacman for PKGBUILD prototypes.

I've wondered this for a while but never cared to bring it up, is there any good reason these prototypes not part of the pacman package instead of the abs package?


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#15 2013-04-18 14:39:58

marzoul
Member
Registered: 2012-10-29
Posts: 36

Re: PKGBUILD and git repository

I might be late in the discussion, but this page might be of some help:

https://wiki.archlinux.org/index.php/VC … Guidelines

However, it's not specified what happens when there are submodules in the repo.
Another reference is the linux-git package in the AUR:

https://aur.archlinux.org/packages/linux-git/

In the latest version it uses the transparent GIT handling of the PKGBUILD (the repo address is in the "source"array).
And there are no submodules used in the repo.

Last edited by marzoul (2013-04-18 14:41:00)

Offline

#16 2013-04-18 14:44:39

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,923
Website

Re: PKGBUILD and git repository

3... 2... 1... moderator! smile


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#17 2013-04-18 14:52:38

parazyd
Member
From: Amsterdam
Registered: 2012-10-14
Posts: 259
Website

Re: PKGBUILD and git repository

Holy crap. 3 years.

Offline

#18 2013-04-18 15:30:56

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: PKGBUILD and git repository

marzoul, Please read Forum Etiquette: Old Threads / Necro-bumping. Closing.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB