main/abuild-sign-noinclude: new aport (!81)

Builds abuild-sign and abuild-tar.static without any dependencies, so
they can be used outside of an Alpine Linux system. We need this for
build.postmarketos.org.
This commit is contained in:
Oliver Smith 2018-11-27 08:31:24 +01:00
parent 9ec2f13a38
commit 54f977435d
4 changed files with 162 additions and 0 deletions

View file

@ -0,0 +1,33 @@
From d4d3f5bcfcc9a11aadc3de3199dd681b195ec574 Mon Sep 17 00:00:00 2001
From: pmb-test <pmb-test@pmb-test>
Date: Thu, 22 Nov 2018 09:06:45 +0100
Subject: [PATCH 1/3] fix abuild-tar.static target
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index b5997a4..d2445f3 100644
--- a/Makefile
+++ b/Makefile
@@ -47,6 +47,7 @@ OBJS-abuild-tar = abuild-tar.o
CFLAGS-abuild-tar.o = $(SSL_CFLAGS)
LDFLAGS-abuild-tar = $(SSL_LDFLAGS)
LIBS-abuild-tar = $(SSL_LIBS)
+LIBS-abuild-tar.static = $(LIBS-abuild-tar)
OBJS-abuild-gzsplit = abuild-gzsplit.o
LDFLAGS-abuild-gzsplit = $(ZLIB_LIBS)
@@ -86,7 +87,7 @@ abuild-gzsplit: abuild-gzsplit.o
$(LINK)
abuild-tar.static: abuild-tar.o
- $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS-$@) -o $@ -static $(LIBS-$@) $^
+ $(CC) -static $(CPPFLAGS) $(CFLAGS) $(CFLAGS-$@) $^ -o $@ $(LIBS-$@)
help:
@echo "$(P) makefile"
--
2.17.2

View file

@ -0,0 +1,54 @@
From 799ae8a118c7f1f7585217fb4827387ef0a882b0 Mon Sep 17 00:00:00 2001
From: pmb-test <pmb-test@pmb-test>
Date: Thu, 22 Nov 2018 09:26:12 +0100
Subject: [PATCH 2/3] add abuild-sign.noinclude target
---
Makefile | 11 +++++++++++
abuild-sign.in | 8 +-------
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index d2445f3..eeb0d5b 100644
--- a/Makefile
+++ b/Makefile
@@ -64,6 +64,17 @@ OBJS-abuild-fetch = abuild-fetch.o
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
${CHMOD} +x $@
+abuild-sign.noinclude: abuild-sign functions.sh
+ [ -e "$@" ] && rm "$@" || true
+ while IFS="" read -r line; do \
+ if [ "$$line" = "@FUNCTIONS_SH@" ]; then \
+ cat functions.sh >> "$@"; \
+ else \
+ echo "$$line" >> "$@"; \
+ fi; \
+ done < "$<"
+ chmod +x "$@"
+
P=$(PACKAGE)-$(VERSION)
all: $(USR_BIN_FILES) functions.sh
diff --git a/abuild-sign.in b/abuild-sign.in
index 7b5b6db..c74bc12 100644
--- a/abuild-sign.in
+++ b/abuild-sign.in
@@ -7,13 +7,7 @@
#
program_version=@VERSION@
-datadir=@datadir@
-
-if ! [ -f "$datadir/functions.sh" ]; then
- echo "$datadir/functions.sh: not found" >&2
- exit 1
-fi
-. "$datadir/functions.sh"
+@FUNCTIONS_SH@
do_sign() {
local f i keyname repo
--
2.17.2

View file

@ -0,0 +1,35 @@
From ce55a041d522ac43f6590e45e248033dc4650eb6 Mon Sep 17 00:00:00 2001
From: pmb-test <pmb-test@pmb-test>
Date: Thu, 22 Nov 2018 09:32:11 +0100
Subject: [PATCH 3/3] use abuild-tar.static from script directory
---
abuild-sign.in | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/abuild-sign.in b/abuild-sign.in
index c74bc12..c6d820d 100644
--- a/abuild-sign.in
+++ b/abuild-sign.in
@@ -9,6 +9,9 @@
program_version=@VERSION@
@FUNCTIONS_SH@
+# abuild-tar.static: from script dir
+abuildtar="$(cd $(dirname "$0") && pwd)/abuild-tar.static"
+
do_sign() {
local f i keyname repo
@@ -25,7 +28,7 @@ do_sign() {
sig=".SIGN.RSA.$keyname"
openssl dgst -sha1 -sign "$privkey" -out "$sig" "$i"
tmptargz=$(mktemp)
- tar -f - -c "$sig" | abuild-tar --cut | gzip -9 > "$tmptargz"
+ tar -f - -c "$sig" | $abuildtar --cut | gzip -9 > "$tmptargz"
tmpsigned=$(mktemp)
cat "$tmptargz" "$i" > "$tmpsigned"
rm -f "$tmptargz" "$sig"
--
2.17.2

View file

@ -0,0 +1,40 @@
pkgname=abuild-sign-noinclude
pkgver=3.3.0_pre1
pkgrel=0
pkgdesc="self-contained abuild-sign to be used by non-Alpine systems"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="x86_64"
license="GPL-2.0"
makedepends="openssl-dev zlib-dev pkgconf"
options="!check"
# first patch is being upstreamed here:
# https://github.com/alpinelinux/abuild/pull/49
source="https://dev.alpinelinux.org/archive/abuild/abuild-${pkgver}.tar.xz
0001-fix-abuild-tar.static-target.patch
0002-add-abuild-sign.noinclude-target.patch
0003-use-abuild-tar.static-from-script-directory.patch"
builddir="$srcdir/abuild-$pkgver"
prepare() {
default_prepare
cd "$builddir"
sed -i -e "/^CHOST=/s/=.*/=$CHOST/" abuild.conf
}
build() {
cd "$builddir"
make VERSION="$pkgver-r$pkgrel" abuild-tar.static abuild-sign.noinclude
}
package() {
cd "$builddir"
install -Dm755 abuild-tar.static "$pkgdir"/usr/bin/abuild-tar.static
install -Dm755 abuild-sign.noinclude "$pkgdir"/usr/bin/abuild-sign.noinclude
}
sha512sums="5d3c2c04a7d6ede2c08b524423f9594ced42d4d67f10327996a38e0782fc2de1f8086187aa9a9072df5c1aced540bdcf1b8002b832df4cf2c6a56f6f89657aa7 abuild-3.3.0_pre1.tar.xz
29aa05c145ac02fbb6be7378c8ba3cf25ec8f49898a6d755cd9cefa4ff1416914f03ca92320b06b602161e549bcfe376f059477eb9fc0722e9f634abf5d60a24 0001-fix-abuild-tar.static-target.patch
a7a207094a80856e0aa10591611ee6b7c235df165791574acbb010a3c7d593d8a918f157bbff2e885ffa159e5c777ab9bf4475447a846d78cd6ca81112ea271d 0002-add-abuild-sign.noinclude-target.patch
3253540dc0def37c31ace080e2e78a10516c903ed96eba950895e99e5143cd7d58ddbbfcfae2be37be8d31a53578291cac8fca8b6270faea630889646f31b2fd 0003-use-abuild-tar.static-from-script-directory.patch"