Commit 8c12f9f6 authored by Natanael Copa's avatar Natanael Copa

abuild: automatically replace the config.sub with our version

introduce post_unpack that by default will search for config.sub and
config.guess and replace those if found.

we ship our own version of those files
parent d1b6da64
...@@ -16,10 +16,11 @@ SCRIPTS := abuild buildrepo abuild-keygen abuild-sign newapkbuild \ ...@@ -16,10 +16,11 @@ SCRIPTS := abuild buildrepo abuild-keygen abuild-sign newapkbuild \
USR_BIN_FILES := $(SCRIPTS) abuild-tar abuild-sudo USR_BIN_FILES := $(SCRIPTS) abuild-tar abuild-sudo
SAMPLES := sample.APKBUILD sample.initd sample.confd \ SAMPLES := sample.APKBUILD sample.initd sample.confd \
sample.pre-install sample.post-install sample.pre-install sample.post-install
AUTOTOOLS_TOOLCHAIN_FILES := config.sub config.guess
SCRIPT_SOURCES := $(addsuffix .in,$(SCRIPTS)) SCRIPT_SOURCES := $(addsuffix .in,$(SCRIPTS))
DISTFILES=$(SCRIPT_SOURCES) $(SAMPLES) Makefile abuild.conf DISTFILES=$(SCRIPT_SOURCES) $(SAMPLES) Makefile abuild.conf
GIT_REV := $(shell test -d .git && git describe || echo exported) GIT_REV := $(shell test -d .git && git describe || echo exported)
ifneq ($(GIT_REV), exported) ifneq ($(GIT_REV), exported)
...@@ -43,7 +44,7 @@ SED_REPLACE := -e 's:@VERSION@:$(FULL_VERSION):g' \ ...@@ -43,7 +44,7 @@ SED_REPLACE := -e 's:@VERSION@:$(FULL_VERSION):g' \
SSL_CFLAGS = $(shell pkg-config --cflags openssl) SSL_CFLAGS = $(shell pkg-config --cflags openssl)
SSL_LIBS = $(shell pkg-config --libs openssl) SSL_LIBS = $(shell pkg-config --libs openssl)
LDFLAGS ?= LDFLAGS ?=
OBJS-abuild-tar = abuild-tar.o OBJS-abuild-tar = abuild-tar.o
LIBS-abuild-tar = $(SSL_LIBS) LIBS-abuild-tar = $(SSL_LIBS)
...@@ -62,7 +63,7 @@ OBJS-abuild-sudo = abuild-sudo.o ...@@ -62,7 +63,7 @@ OBJS-abuild-sudo = abuild-sudo.o
P=$(PACKAGE)-$(VERSION) P=$(PACKAGE)-$(VERSION)
all: $(USR_BIN_FILES) all: $(USR_BIN_FILES)
clean: clean:
@rm -f $(USR_BIN_FILES) @rm -f $(USR_BIN_FILES)
...@@ -97,7 +98,8 @@ install: $(USR_BIN_FILES) $(SAMPLES) abuild.conf functions.sh aports.lua ...@@ -97,7 +98,8 @@ install: $(USR_BIN_FILES) $(SAMPLES) abuild.conf functions.sh aports.lua
if [ -n "$(DESTDIR)" ] || [ ! -f "/$(sysconfdir)"/abuild.conf ]; then\ if [ -n "$(DESTDIR)" ] || [ ! -f "/$(sysconfdir)"/abuild.conf ]; then\
cp abuild.conf $(DESTDIR)/$(sysconfdir)/; \ cp abuild.conf $(DESTDIR)/$(sysconfdir)/; \
fi fi
cp $(SAMPLES) $(DESTDIR)/$(prefix)/share/abuild cp $(SAMPLES) $(DESTDIR)/$(prefix)/share/abuild/
cp $(AUTOTOOLS_TOOLCHAIN_FILES) $(DESTDIR)/$(prefix)/share/abuild/
cp functions.sh $(DESTDIR)/$(datadir)/ cp functions.sh $(DESTDIR)/$(datadir)/
mkdir -p $(DESTDIR)$(LUA_SHAREDIR) mkdir -p $(DESTDIR)$(LUA_SHAREDIR)
cp aports.lua $(DESTDIR)$(LUA_SHAREDIR)/ cp aports.lua $(DESTDIR)$(LUA_SHAREDIR)/
......
...@@ -494,6 +494,24 @@ unpack() { ...@@ -494,6 +494,24 @@ unpack() {
default_unpack default_unpack
} }
default_post_unpack() {
local i
options_has "!configsub" && return 0
for i in "$srcdir"/*/configure; do
[ -x "$i" ] || continue
find "${i%/configure}" -name config.sub -o -name config.guess \
| while read f; do
msg "Replacing ${f##*/}"
cp "$datadir"/${f##*/} "$f" || return 1
done
break
done
}
post_unpack() {
default_post_unpack
}
# cleanup source and package dir # cleanup source and package dir
clean() { clean() {
msg "Cleaning temporary build dirs..." msg "Cleaning temporary build dirs..."
...@@ -1177,7 +1195,8 @@ build_abuildrepo() { ...@@ -1177,7 +1195,8 @@ build_abuildrepo() {
if ! apk_up2date || [ -n "$force" ]; then if ! apk_up2date || [ -n "$force" ]; then
logcmd "building $pkgname" logcmd "building $pkgname"
sanitycheck && builddeps && clean && fetch && unpack \ sanitycheck && builddeps && clean && fetch && unpack \
&& prepare && mkusers && rootpkg || return 1 && post_unpack && prepare && mkusers && rootpkg \
|| return 1
fi fi
update_abuildrepo_index update_abuildrepo_index
} }
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment