Mail archive

[alpine-devel] RFC: volatile repo/apkbuilds

From: Natanael Copa <>
Date: Fri, 06 Nov 2009 14:21:57 +0100


Been playing with the idea previously mentioned by Mark Constable with
volatile packages from svn/git/cvs.

The idea is that each run it will update the sources from git/svn and if
needed, recompile. That way we could have a "volatile" repository which
tracks some upstream projects, like apk-tools, abuild etc.

This gives us early packages for testing/development.

What would be nice is if:
* packages are only updated/rebuilt when upstream have changes. so
  pkgrel=$(date -u +%Y%m%d%H)
wont do it.

* package version includes the scm id of some sort.

* we dont need to modify the apkbuild when things changes upstream

So far I have been thinking in those lines:

Set pkgver to "volatile":

The must provide a getpkgver() function which will give the pkgrel late.

The apkbuild must override the fetch() and unpack() functions.



getpkgver() {
        if [ ! -d "$srcdir"/$pkgname ]; then
        cd "$srcdir"/$pkgname
        local tagver=$(git describe --exact-match | sed 's/^v//')
        local n=$(git describe --long | cut -d- -f2)

fetch() {
        msg "Fetching source from $_git_source"
        if [ -d "$SRCDEST"/$pkgname/.git ]; then
                cd "$SRCDEST"/$pkgname
                git pull --rebase
                rm -rf "$SRCDEST"/$pkgname
                git clone "$_git_source" "$SRCDEST"/$pkgname
        cd "$SRCDEST"/$pkgname

unpack() {
        if [ ! -d "$SRCDEST"/$pkgname ]; then
        mkdir -p "$srcdir"/$pkgname-$pkgver
        rsync -a --delete "$SRCDEST"/$pkgname/ \

build() {
        cd "$srcdir/$pkgname"
        make || return 1

package() {
        cd "$srcdir/$pkgname"
        make DESTDIR="$pkgdir" install

Does that make sense?

Other ideas?


Received on Fri Nov 06 2009 - 14:21:57 UTC