aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/abuild/0002-add-fetch-from-source-mirror.patch103
-rw-r--r--main/abuild/0003-add-color-control-command-line-option.patch50
-rw-r--r--main/abuild/APKBUILD21
-rwxr-xr-xrebuild-alpine.sh2
4 files changed, 172 insertions, 4 deletions
diff --git a/main/abuild/0002-add-fetch-from-source-mirror.patch b/main/abuild/0002-add-fetch-from-source-mirror.patch
new file mode 100644
index 0000000000..926dbcc9a1
--- /dev/null
+++ b/main/abuild/0002-add-fetch-from-source-mirror.patch
@@ -0,0 +1,103 @@
+diff -rupN orig/abuild-2.1/abuild.in src/abuild-2.1/abuild.in
+--- orig/abuild-2.1/abuild.in 2009-12-30 04:05:49.000000000 -0500
++++ src/abuild-2.1/abuild.in 2010-04-29 09:21:43.000000000 -0400
+@@ -149,12 +149,11 @@ md5check() {
+
+ uri_fetch() {
+ local uri="$1"
+- local d="${s##*/}" # $(basename $s)
++ local d="${uri##*/}" # $(basename $uri)
+ local opts
+ [ -n "$quiet" ] && opts="-q"
+ [ -f "$SRCDEST/$d" ] && return 0
+
+-
+ # we need GNU wget for this
+ case "$uri" in
+ https://*) opts="--no-check-certificate";;
+@@ -178,12 +177,22 @@ is_remote() {
+ return 1
+ }
+
++# try download from file from mirror first
++uri_fetch_mirror() {
++ local uri="$1"
++ local d="${uri##*/}" # $(basename $uri)
++ if [ -n "$DISTFILES_MIRROR" ]; then
++ uri_fetch "$DISTFILES_MIRROR"/$d && return 0
++ fi
++ uri_fetch "$uri"
++}
++
+ default_fetch() {
+ local s
+ mkdir -p "$srcdir"
+ for s in $source; do
+ if is_remote "$s"; then
+- uri_fetch "$s" || return 1
++ uri_fetch_mirror "$s" || return 1
+ ln -sf "$SRCDEST/${s##*/}" "$srcdir"/
+ else
+ ln -sf "$startdir/$s" "$srcdir/"
+@@ -308,6 +317,12 @@ build() {
+ :
+ }
+
++# generate a simple tar.gz package of pkgdir
++targz() {
++ cd "$pkgdir" || return 1
++ tar -czf "$PKGDEST"/$pkgname-$pkgver-r$pkgrel.tar.gz *
++}
++
+ get_split_func() {
+ # get the 'func' from "sub-pkg:func"
+ local func=${1##*:}
+@@ -712,8 +727,8 @@ up2date() {
+ depparse_aports() {
+ # lets run this in a subshell since we source all APKBUILD here
+ (
+- aportsdir=$(realpath ${APKBUILD%/APKBUILD}/../..)
+- for i in $aportsdir/*/*/APKBUILD; do
++ aportsdir=$(realpath ${APKBUILD%/APKBUILD}/..)
++ for i in $aportsdir/*/APKBUILD; do
+ pkgname=
+ subpackages=
+ depends=
+@@ -811,7 +826,13 @@ builddeps() {
+
+ uninstall_after=".makedepends-$pkgname $uninstall_after"
+ if [ -n "$install_deps" ] && [ -z "$recursive" ]; then
++ # make a --simluate run first to detect missing deps
++ # apk-tools --virtual is no goot at reporting those.
++ $SUDO apk add --repository "$apkcache" \
++ --wait 30 \
++ --simulate --quiet $deps || return 1
+ $SUDO apk add --repository "$apkcache" \
++ --wait 30 \
+ --virtual .makedepends-$pkgname $deps \
+ && return 0
+ fi
+@@ -834,6 +855,7 @@ builddeps() {
+ cd "$dir" && $0 -k -r apkcache || return 1
+ done
+ $SUDO apk add -u --repository "$apkcache" \
++ --wait 30 \
+ --virtual .makedepends-$pkgname $deps
+ }
+
+@@ -945,12 +967,13 @@ post_add() {
+ post_add $i || return 1
+ fi
+ done
+- $SUDO apk add -u "$pkgf" || die "Failed to install $1"
++ $SUDO apk add --wait 30 -u "$pkgf" || die "Failed to install $1"
+ }
+
+ installdeps() {
+ local deps i
+- sudo apk add --repository "$apkcache" --virtual .makedepends-$pkgname \
++ sudo apk add --wait 30 --repository "$apkcache" \
++ --virtual .makedepends-$pkgname \
+ $makedepends
+ }
+
diff --git a/main/abuild/0003-add-color-control-command-line-option.patch b/main/abuild/0003-add-color-control-command-line-option.patch
new file mode 100644
index 0000000000..434f634b9d
--- /dev/null
+++ b/main/abuild/0003-add-color-control-command-line-option.patch
@@ -0,0 +1,50 @@
+diff -rupN orig/abuild-2.1/abuild.in src/abuild-2.1/abuild.in
+--- orig/abuild-2.1/abuild.in 2010-04-29 12:34:59.000000000 -0400
++++ src/abuild-2.1/abuild.in 2010-04-29 12:35:56.000000000 -0400
+@@ -25,15 +25,27 @@ FAKEROOT=${FAKEROOT:-"fakeroot"}
+ ABUILD_CONF=${ABUILD_CONF:-"$sysconfdir/abuild.conf"}
+ [ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
+
+-
+-#colors
+-if [ -n "$USE_COLORS" ]; then
++default_colors() {
+ NORMAL="\033[1;0m"
+ STRONG="\033[1;1m"
+ RED="\033[1;31m"
+ GREEN="\033[1;32m"
+ YELLOW="\033[1;33m"
+ BLUE="\033[1;34m"
++}
++
++monochrome() {
++ NORMAL=""
++ STRONG=""
++ RED=""
++ GREEN=""
++ YELLOW=""
++ BLUE=""
++}
++
++#colors
++if [ -n "$USE_COLORS" ]; then
++ default_colors
+ fi
+
+
+@@ -1036,12 +1048,14 @@ unset force
+ unset recursive
+-while getopts "dfFhi:kinp:P:qrRs:u" opt; do
++while getopts "cdfFhi:kimnp:P:qrRs:u" opt; do
+ case $opt in
++ 'c') default_colors;;
+ 'd') nodeps=1;;
+ 'f') force=1;;
+ 'F') forceroot=1;;
+ 'h') usage;;
+ 'i') install_after="$install_after $OPTARG";;
+ 'k') keep=1;;
++ 'm') monochrome;;
+ 'n') die "Use newapkbuild to create new aports";;
+ 'p') PKGDEST=$OPTARG;;
+ 'P') REPODEST=$OPTARG;;
diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD
index ed4d017cf4..4f3bc4f613 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -2,14 +2,27 @@
pkgdesc="Script to build Alpine Packages"
pkgname=abuild
pkgver=2.1
-pkgrel=0
+pkgrel=1
url=http://git.alpinelinux.org/cgit/abuild/
source="http://git.alpinelinux.org/cgit/abuild/snapshot/abuild-$pkgver.tar.bz2
- "
+ 0002-add-fetch-from-source-mirror.patch
+ 0003-add-color-control-command-line-option.patch"
depends="fakeroot file sudo pax-utils openssl apk-tools"
makedepends="openssl-dev pkgconfig"
license=GPL-2
+prepare() {
+ cd "$srcdir"/$pkgname-$_realver
+ # patches
+ for i in ../0002-add-fetch-from-source-mirror.patch ../0003-add-color-control-command-line-option.patch; do
+ msg "Applying $i"
+ if ! patch --verbose -p1 -i $i; then
+ error "$i failed"
+ return 1
+ fi
+ done
+}
+
build() {
cd "$srcdir/$pkgname-$pkgver"
@@ -18,4 +31,6 @@ build() {
install -m 644 abuild.conf "$pkgdir"/etc/abuild.conf
}
-md5sums="2268fa6147c8088139ef136184cd2ae0 abuild-2.1.tar.bz2"
+md5sums="2268fa6147c8088139ef136184cd2ae0 abuild-2.1.tar.bz2
+29b83cfe5c4b8e8491c6f2f073da4314 0002-add-fetch-from-source-mirror.patch
+d710ffb3c7f3eae52cac62bc2bf4f454 0003-add-color-control-command-line-option.patch"
diff --git a/rebuild-alpine.sh b/rebuild-alpine.sh
index c546a018d9..7535a44817 100755
--- a/rebuild-alpine.sh
+++ b/rebuild-alpine.sh
@@ -18,7 +18,7 @@ build () {
for p in $pkgs ; do
echo "Building $p"
cd $rootdir/$1/$p
- abuild -r > $rootdir/$1_$p.txt 2>&1
+ abuild -rm > $rootdir/$1_$p.txt 2>&1
if [ "$?" = "0" ] ; then
rm $rootdir/$1_$p.txt
else