summaryrefslogtreecommitdiff
path: root/devbuild
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-15 15:48:16 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-15 15:48:16 +0000
commit5baad961c6ad20863eceea3fc923f5a9a9c5ee6b (patch)
tree9e42546e63be46997fe012f8e4a273210aea99c5 /devbuild
parent4a54e80e3bdd8d97987b263667a25fdbcec7ace8 (diff)
downloadabuild-5baad961c6ad20863eceea3fc923f5a9a9c5ee6b.tar.gz
abuild-5baad961c6ad20863eceea3fc923f5a9a9c5ee6b.tar.bz2
abuild-5baad961c6ad20863eceea3fc923f5a9a9c5ee6b.tar.xz
abuild-5baad961c6ad20863eceea3fc923f5a9a9c5ee6b.zip
devbuild: new helper script, fix makefile
This script helps developers who works on the alpine subprojects (i.e apk-tools, alpine-baselayout etc) to build a development alpine iso. a new alpine iso using the un-committed local sub
Diffstat (limited to 'devbuild')
-rwxr-xr-xdevbuild61
1 files changed, 61 insertions, 0 deletions
diff --git a/devbuild b/devbuild
new file mode 100755
index 0000000..4436602
--- /dev/null
+++ b/devbuild
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# This scripts will:
+# 1. create a dist package for current subproject
+# 2. update the APKBUILD and build the package
+# 3. build the alpine iso
+#
+# The following is assumed from the subproject:
+# * that PACKAGE and VERSION is set in Makefile or defined in a local
+# devbuild.conf file
+# * that 'make dist' will generate a valid dist package
+#
+
+program=${0##*/}
+
+# rebuild env. Those values can be overridden in either
+# /etc/devbuild.conf or $HOME/.devbuild.conf
+DISTFILES=/var/cache/distfiles
+APORTS_DIR=$HOME/aports
+ALPINE_DIR=$HOME/abuild
+
+# for the local project. Those values can be overridden by
+# a devbuild.conf in the subprojects subdir
+PACKAGE=$(grep '^PACKAGE' Makefile | sed 's/.*=[[:blank:]]*//')
+VERSION=$(grep '^VERSION' Makefile | sed 's/.*=[[:blank:]]*//')
+SUFFIX=.tar.bz2
+REPO=core
+
+# let user override the above defaults
+for i in /etc/$program.conf $HOME/.$program.conf ./$program.conf; do
+ if [ -f $i ]; then
+ . $i
+ fi
+done
+
+# generate a new dist package
+tarball=${PACKAGE}-${VERSION}${SUFFIX}
+make dist || exit 1
+cp $tarball "$DISTFILES/" || exit 1
+
+# update the APKBUILD, in a subshell
+(
+ cd $APORTS_DIR/$REPO/$PACKAGE || exit 1
+ . ./APKBUILD
+ if [ "$pkgver" = "$VERSION" ]; then
+ pkgrel=$(( $pkgrel + 1 ))
+ else
+ pkgrel="0"
+ fi
+ sed -i -e " s/^pkgver=.*/pkgver=$VERSION/;
+ s/^pkgrel=.*/pkgrel=$pkgrel/;
+ /^md5sums=\"/,/\"\$/d" APKBUILD || exit 1
+ export SRCDEST="$DISTFILES"
+ abuild checksum >>APKBUILD
+ abuild
+ abuild cleanoldpkg
+) || exit 1
+
+# rebuild the iso
+cd "$ALPINE_DIR" && fakeroot ./mkalpine
+