Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/i486-stage1
diff options
context:
space:
mode:
Diffstat (limited to 'i486-stage1')
-rw-r--r--i486-stage1/acl/DESCR6
-rw-r--r--i486-stage1/attr/DESCR8
-rw-r--r--i486-stage1/bash/DESCR2
-rw-r--r--i486-stage1/bc/DESCR11
-rw-r--r--i486-stage1/bzip2/DESCR6
-rw-r--r--i486-stage1/coreutils/DESCR2
-rw-r--r--i486-stage1/coreutils/coreutils-8.28-noman.patch238
-rw-r--r--i486-stage1/cracklib/DESCR11
-rw-r--r--i486-stage1/curl/DESCR26
-rw-r--r--i486-stage1/db/DESCR5
-rw-r--r--i486-stage1/diffutils/DESCR6
-rw-r--r--i486-stage1/e2fsprogs/DESCR2
-rw-r--r--i486-stage1/ed/DESCR5
-rw-r--r--i486-stage1/elfutils/DESCR8
-rw-r--r--i486-stage1/expat/DESCR8
-rw-r--r--i486-stage1/file/DESCR5
-rw-r--r--i486-stage1/findutils/DESCR2
-rw-r--r--i486-stage1/gdbm/DESCR5
-rw-r--r--i486-stage1/gmp/DESCR8
-rw-r--r--i486-stage1/grep/DESCR2
-rw-r--r--i486-stage1/gzip/DESCR5
-rw-r--r--i486-stage1/inetutils/DESCR11
-rw-r--r--i486-stage1/iproute2/DESCR5
-rw-r--r--i486-stage1/iptables/DESCR19
-rw-r--r--i486-stage1/joe/DESCR2
-rw-r--r--i486-stage1/kbd/DESCR5
-rw-r--r--i486-stage1/kmod/DESCR6
-rw-r--r--i486-stage1/less/DESCR3
-rw-r--r--i486-stage1/libarchive/DESCR5
-rw-r--r--i486-stage1/libcap/DESCR22
-rw-r--r--i486-stage1/libcap/libcap-2.25-gperf.patch12
-rw-r--r--i486-stage1/libedit/DESCR5
-rw-r--r--i486-stage1/libmnl/DESCR5
-rw-r--r--i486-stage1/libnfnetlink/DESCR5
-rw-r--r--i486-stage1/libtirpc/DESCR19
-rw-r--r--i486-stage1/libtirpc/libtirpc-1.0.2-stdint.patch11
-rw-r--r--i486-stage1/linux-api-headers/DESCR4
-rw-r--r--i486-stage1/linux/DESCR14
-rw-r--r--i486-stage1/lz4/DESCR12
-rw-r--r--i486-stage1/ncurses/DESCR5
-rw-r--r--i486-stage1/net-tools/DESCR11
-rw-r--r--i486-stage1/net-tools/net-tools-1.60-if_tunnel.patch11
-rw-r--r--i486-stage1/openssh/DESCR12
-rw-r--r--i486-stage1/openssl/DESCR12
-rw-r--r--i486-stage1/pam/DESCR27
-rw-r--r--i486-stage1/pam/pam-1.3.0-unix-passwd-no-yp.patch67
-rw-r--r--i486-stage1/pambase/DESCR2
-rw-r--r--i486-stage1/patch/DESCR2
-rw-r--r--i486-stage1/pcre/DESCR5
-rw-r--r--i486-stage1/perl/DESCR26
-rw-r--r--i486-stage1/procps-ng/DESCR14
-rw-r--r--i486-stage1/readline/DESCR5
-rw-r--r--i486-stage1/sed/DESCR5
-rw-r--r--i486-stage1/shadow/DESCR18
-rw-r--r--i486-stage1/tar/DESCR7
-rw-r--r--i486-stage1/template/DESCR24
-rw-r--r--i486-stage1/texinfo/DESCR5
-rw-r--r--i486-stage1/uinit/DESCR2
-rw-r--r--i486-stage1/util-linux/DESCR21
-rw-r--r--i486-stage1/xz/DESCR8
-rw-r--r--i486-stage1/zlib/DESCR6
61 files changed, 831 insertions, 0 deletions
diff --git a/i486-stage1/acl/DESCR b/i486-stage1/acl/DESCR
new file mode 100644
index 0000000..f34036f
--- /dev/null
+++ b/i486-stage1/acl/DESCR
@@ -0,0 +1,6 @@
+# acl is needed by almost all packages dealing with the filesystem, most
+# prominently 'coreutils'
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/attr/DESCR b/i486-stage1/attr/DESCR
new file mode 100644
index 0000000..dfe2f65
--- /dev/null
+++ b/i486-stage1/attr/DESCR
@@ -0,0 +1,8 @@
+# attr is needed by acl
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# no gettext
+sed -i 's@^makedepends\(.*\)@#makedepends\1@g' PKGBUILD
diff --git a/i486-stage1/bash/DESCR b/i486-stage1/bash/DESCR
new file mode 100644
index 0000000..8ed7de8
--- /dev/null
+++ b/i486-stage1/bash/DESCR
@@ -0,0 +1,2 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/bc/DESCR b/i486-stage1/bc/DESCR
new file mode 100644
index 0000000..b7720fd
--- /dev/null
+++ b/i486-stage1/bc/DESCR
@@ -0,0 +1,11 @@
+# bc is needed by linux
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# fbc is built with target compiler instead of host compiler:
+# /bin/sh: ./fbc: No such file or directory
+# http://lists.busybox.net/pipermail/buildroot/2017-July/196239.html
+# we take the host bc instead of the bootstrapped fbc
+sed -i '1!N; /build() *{\n *cd/ a \ sed -i "s@./fbc -c@bc -c@" bc\/Makefile.in' PKGBUILD
diff --git a/i486-stage1/bzip2/DESCR b/i486-stage1/bzip2/DESCR
new file mode 100644
index 0000000..9329744
--- /dev/null
+++ b/i486-stage1/bzip2/DESCR
@@ -0,0 +1,6 @@
+# bzip2 is needed for libarchive
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@\( \+\)make@\1make CC=$TARGET_ARCH-cc RANLIB=$TARGET_ARCH-ranlib AR=$TARGET_ARCH-ar@g" PKGBUILD
+
diff --git a/i486-stage1/coreutils/DESCR b/i486-stage1/coreutils/DESCR
new file mode 100644
index 0000000..1995b5a
--- /dev/null
+++ b/i486-stage1/coreutils/DESCR
@@ -0,0 +1,2 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
diff --git a/i486-stage1/coreutils/coreutils-8.28-noman.patch b/i486-stage1/coreutils/coreutils-8.28-noman.patch
new file mode 100644
index 0000000..8a40a31
--- /dev/null
+++ b/i486-stage1/coreutils/coreutils-8.28-noman.patch
@@ -0,0 +1,238 @@
+diff -rauN coreutils-8.28/Makefile.in coreutils-8.28-noman-patch/Makefile.in
+--- coreutils-8.28/Makefile.in 2017-09-02 04:25:09.000000000 +0200
++++ coreutils-8.28-noman-patch/Makefile.in 2017-12-08 18:55:52.273333333 +0100
+@@ -2594,7 +2594,6 @@
+ $(top_srcdir)/build-aux/texinfo.tex \
+ $(top_srcdir)/build-aux/ylwrap $(top_srcdir)/doc/local.mk \
+ $(top_srcdir)/lib/alloca.c $(top_srcdir)/lib/config.hin \
+- $(top_srcdir)/lib/local.mk $(top_srcdir)/man/local.mk \
+ $(top_srcdir)/src/local.mk $(top_srcdir)/src/single-binary.mk \
+ $(top_srcdir)/tests/local.mk ABOUT-NLS AUTHORS COPYING \
+ ChangeLog INSTALL NEWS README THANKS TODO build-aux/compile \
+@@ -2695,7 +2694,6 @@
+ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ ERRNO_H = @ERRNO_H@
+ EXEEXT = @EXEEXT@
+-EXTRA_MANS = @EXTRA_MANS@
+ FLOAT_H = @FLOAT_H@
+ FNMATCH_H = @FNMATCH_H@
+ GETADDRINFO_LIB = @GETADDRINFO_LIB@
+@@ -3972,7 +3970,6 @@
+ lispdir = @lispdir@
+ localedir = @localedir@
+ localstatedir = @localstatedir@
+-man1_MANS = @man1_MANS@
+ mandir = @mandir@
+ mkdir_p = @mkdir_p@
+ oldincludedir = @oldincludedir@
+@@ -4165,8 +4162,8 @@
+ lib/xgetcwd.h lib/xnanosleep.h lib/xreadlink.h lib/xstrtod.h \
+ lib/xstrtol.h lib/xstrtod.c lib/xstrtod.h lib/xalloc.h \
+ lib/yesno.h src/dcgen src/dircolors.hin src/primes.h \
+- src/tac-pipe.c src/extract-magic man/help2man man/dummy-man \
+- $(man1_MANS:.1=.x) $(EXTRA_MANS:.1=.x) $(all_tests) init.cfg \
++ src/tac-pipe.c src/extract-magic \
++ $(all_tests) init.cfg \
+ tests/Coreutils.pm tests/CuSkip.pm tests/CuTmpdir.pm \
+ tests/d_type-check tests/envvar-check tests/factor/run.sh \
+ tests/factor/create-test.sh tests/filefrag-extent-compare \
+@@ -4275,7 +4272,7 @@
+ lib/ref-add.sed lib/ref-del.sed $(SCRIPTS) \
+ $(no_install__progs) src/coreutils_symlinks \
+ src/coreutils_shebangs src/fs-def src/fs-magic \
+- src/fs-kernel-magic $(ALL_MANS) $(factor_tests)
++ src/fs-kernel-magic $(factor_tests)
+ MOSTLYCLEANDIRS = lib/arpa lib/netinet lib/selinux lib/sys lib/sys \
+ lib/sys lib/sys lib/sys lib/sys lib/sys lib/sys
+ AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src
+@@ -5139,18 +5136,6 @@
+ } \
+ END {$$m and (warn "$@: do not use upper case in \@var{...}\n"), exit 1}'
+
+-@HAVE_PERL_FALSE@run_help2man = $(SHELL) $(srcdir)/man/dummy-man
+-@HAVE_PERL_TRUE@run_help2man = $(PERL) -- $(srcdir)/man/help2man
+-ALL_MANS = $(man1_MANS) $(EXTRA_MANS)
+-
+-# Dependencies common to all man pages. Updated below.
+-
+-# Depend on this to get version number changes.
+-
+-# This is required so that changes to e.g., emit_bug_reporting_address
+-# provoke regeneration of all the manpages.
+-mandeps = .version $(top_srcdir)/src/system.h $(am__append_5)
+-
+ # Indirections required so that we'll still be able to know the
+ # complete list of our tests even if the user overrides TESTS
+ # from the command line (as permitted by the test harness API).
+@@ -5978,10 +5963,10 @@
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+ .SUFFIXES:
+-.SUFFIXES: .1 .c .dvi .log .o .obj .pl .pl$(EXEEXT) .ps .sed .sh .sh$(EXEEXT) .sin .trs .x .xpl .xpl$(EXEEXT) .y
++.SUFFIXES: .c .dvi .log .o .obj .pl .pl$(EXEEXT) .ps .sed .sh .sh$(EXEEXT) .sin .trs .x .xpl .xpl$(EXEEXT) .y
+ am--refresh: Makefile
+ @:
+-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk $(am__configure_deps)
++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/tests/local.mk $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+@@ -6003,7 +5988,7 @@
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+-$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk $(am__empty):
++$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/tests/local.mk $(am__empty):
+
+ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+@@ -14750,149 +14735,6 @@
+
+ check-local: check-texinfo
+
+-# This is a kludge to remove generated 'man/*.1' from a non-srcdir build.
+-# Without this, "make distcheck" might fail.
+-distclean-local:
+- test x$(srcdir) = x$(builddir) || rm -f $(ALL_MANS)
+-
+-$(ALL_MANS): $(mandeps)
+-# Most prog.1 man pages depend on src/prog. List the exceptions:
+-@SINGLE_BINARY_FALSE@man/install.1: src/ginstall$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/test.1: src/[$(EXEEXT)
+-
+-@SINGLE_BINARY_FALSE@man/arch.1: src/arch$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/b2sum.1: src/b2sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/base32.1: src/base32$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/base64.1: src/base64$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/basename.1: src/basename$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/cat.1: src/cat$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chcon.1: src/chcon$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chgrp.1: src/chgrp$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chmod.1: src/chmod$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chown.1: src/chown$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chroot.1: src/chroot$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/cksum.1: src/cksum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/comm.1: src/comm$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/coreutils.1: src/coreutils$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/cp.1: src/cp$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/csplit.1: src/csplit$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/cut.1: src/cut$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/date.1: src/date$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/dd.1: src/dd$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/df.1: src/df$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/dir.1: src/dir$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/dircolors.1: src/dircolors$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/dirname.1: src/dirname$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/du.1: src/du$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/echo.1: src/echo$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/env.1: src/env$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/expand.1: src/expand$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/expr.1: src/expr$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/factor.1: src/factor$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/false.1: src/false$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/fmt.1: src/fmt$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/fold.1: src/fold$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/groups.1: src/groups$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/head.1: src/head$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/hostid.1: src/hostid$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/hostname.1: src/hostname$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/id.1: src/id$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/join.1: src/join$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/kill.1: src/kill$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/link.1: src/link$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/ln.1: src/ln$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/logname.1: src/logname$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/ls.1: src/ls$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/md5sum.1: src/md5sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mkdir.1: src/mkdir$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mkfifo.1: src/mkfifo$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mknod.1: src/mknod$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mktemp.1: src/mktemp$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mv.1: src/mv$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/nice.1: src/nice$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/nl.1: src/nl$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/nohup.1: src/nohup$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/nproc.1: src/nproc$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/numfmt.1: src/numfmt$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/od.1: src/od$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/paste.1: src/paste$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/pathchk.1: src/pathchk$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/pinky.1: src/pinky$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/pr.1: src/pr$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/printenv.1: src/printenv$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/printf.1: src/printf$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/ptx.1: src/ptx$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/pwd.1: src/pwd$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/readlink.1: src/readlink$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/realpath.1: src/realpath$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/rm.1: src/rm$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/rmdir.1: src/rmdir$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/runcon.1: src/runcon$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/seq.1: src/seq$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha1sum.1: src/sha1sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha224sum.1: src/sha224sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha256sum.1: src/sha256sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha384sum.1: src/sha384sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha512sum.1: src/sha512sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/shred.1: src/shred$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/shuf.1: src/shuf$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sleep.1: src/sleep$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sort.1: src/sort$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/split.1: src/split$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/stat.1: src/stat$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/stdbuf.1: src/stdbuf$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/stty.1: src/stty$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sum.1: src/sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sync.1: src/sync$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tac.1: src/tac$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tail.1: src/tail$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tee.1: src/tee$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/timeout.1: src/timeout$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/touch.1: src/touch$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tr.1: src/tr$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/true.1: src/true$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/truncate.1: src/truncate$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tsort.1: src/tsort$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tty.1: src/tty$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/uname.1: src/uname$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/unexpand.1: src/unexpand$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/uniq.1: src/uniq$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/unlink.1: src/unlink$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/uptime.1: src/uptime$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/users.1: src/users$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/vdir.1: src/vdir$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/wc.1: src/wc$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/who.1: src/who$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/whoami.1: src/whoami$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/yes.1: src/yes$(EXEEXT)
+-
+-.x.1:
+- $(AM_V_GEN)name=`echo $@ | sed 's|.*/||; s|\.1$$||'` || exit 1; \
+- case $$name in \
+- install) prog='ginstall'; argv=$$name;; \
+- test) prog='['; argv='[';; \
+- *) prog=$$name; argv=$$prog;; \
+- esac; \
+- rm -f $@ $@-t \
+- && t=$*.td \
+- && rm -rf $$t \
+- && $(MKDIR_P) $$t \
+- && (cd $$t && $(LN_S) '$(abs_top_builddir)/src/'$$prog$(EXEEXT) \
+- $$argv$(EXEEXT)) \
+- && : $${SOURCE_DATE_EPOCH=`cat $(srcdir)/.timestamp 2>/dev/null || :`} \
+- && export SOURCE_DATE_EPOCH && $(run_help2man) \
+- --source='$(PACKAGE_STRING)' \
+- --include=$(srcdir)/man/$$name.x \
+- --output=$$t/$$name.1 \
+- --info-page='\(aq(coreutils) '$$name' invocation\(aq' \
+- $$t/$$argv$(EXEEXT) \
+- && sed \
+- -e 's|$*\.td/||g' \
+- -e '/For complete documentation/d' \
+- $$t/$$name.1 > $@-t \
+- && rm -rf $$t \
+- && chmod a-w $@-t \
+- && mv $@-t $@
+ .PHONY: check-root
+ check-root:
+ $(MAKE) check TESTS='$(root_tests)' SUBDIRS=.
diff --git a/i486-stage1/cracklib/DESCR b/i486-stage1/cracklib/DESCR
new file mode 100644
index 0000000..318e22a
--- /dev/null
+++ b/i486-stage1/cracklib/DESCR
@@ -0,0 +1,11 @@
+# cracklib is needed by pam
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# the dictionary cannot be created while packaging by calling the cross-compiled tool!
+# we are not interested in an actually running cracklib doing some security checks, just in the library
+#./util/cracklib-packer: line 117: /home/cross/build/cracklib/src/cracklib-2.9.6/util/.libs/lt-cracklib-packer: No such file or directory
+sed -i 's/\( \+sh\)/#\1/g' PKGBUILD
+sed -i 's/\( \+ | sh\)/#\1/g' PKGBUILD
diff --git a/i486-stage1/curl/DESCR b/i486-stage1/curl/DESCR
new file mode 100644
index 0000000..88b092f
--- /dev/null
+++ b/i486-stage1/curl/DESCR
@@ -0,0 +1,26 @@
+# curl is needed for pacman
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# build with minimal features, we don't need support for those protocols
+# in stage1, basic http(s), ftp is enough (other protocols draw in quite
+# some dependencies otherwise)
+sed -i "/depends=/s/'krb5'//" PKGBUILD
+sed -i "/depends=/s/'libssh2'//" PKGBUILD
+sed -i '/--prefix=\/usr/ a \ --without-libssh2 \\' PKGBUILD
+sed -i "/depends=/s/'libpsl'//" PKGBUILD
+sed -i '/--prefix=\/usr/ a \ --without-libpsl \\' PKGBUILD
+sed -i "/depends=/s/'libnghttp2'//" PKGBUILD
+sed -i '/--prefix=\/usr/ a \ --without-nghttp2 \\' PKGBUILD
+sed -i '/--prefix=\/usr/ a \ --without-gssapi \\' PKGBUILD
+
+# no ca-certificates, needs tons of tools to build (like p11-kit), so we
+# create a fake one with certificates from the host (the ca crts from
+# ca-certificates-utils should be enough actually)
+# TODO: is this LE/BE-safe?
+sed -i "/depends=/s/'ca-certificates'//" PKGBUILD
+
+# zsh, perl is used to create a completion file for curl and zsh
+sed -i '/--prefix=\/usr/ a \ --without-zsh-functions-dir \\' PKGBUILD
diff --git a/i486-stage1/db/DESCR b/i486-stage1/db/DESCR
new file mode 100644
index 0000000..fe5a83a
--- /dev/null
+++ b/i486-stage1/db/DESCR
@@ -0,0 +1,5 @@
+# db is needed by perl
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@\.\./dist/configure@../dist/configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/diffutils/DESCR b/i486-stage1/diffutils/DESCR
new file mode 100644
index 0000000..57fb376
--- /dev/null
+++ b/i486-stage1/diffutils/DESCR
@@ -0,0 +1,6 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# http://lists.busybox.net/pipermail/buildroot/2017-September/203435.html
+sed -i '/.\/configure/ i \ echo "gl_cv_func_getopt_gnu=yes" > config.cache' PKGBUILD
+sed -i 's@./configure@./configure --cache-file=config.cache@g' PKGBUILD
diff --git a/i486-stage1/e2fsprogs/DESCR b/i486-stage1/e2fsprogs/DESCR
new file mode 100644
index 0000000..1995b5a
--- /dev/null
+++ b/i486-stage1/e2fsprogs/DESCR
@@ -0,0 +1,2 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
diff --git a/i486-stage1/ed/DESCR b/i486-stage1/ed/DESCR
new file mode 100644
index 0000000..9fff229
--- /dev/null
+++ b/i486-stage1/ed/DESCR
@@ -0,0 +1,5 @@
+# ed is needed for patch and bc
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure CC=$TARGET_ARCH-gcc@" PKGBUILD
diff --git a/i486-stage1/elfutils/DESCR b/i486-stage1/elfutils/DESCR
new file mode 100644
index 0000000..e747c06
--- /dev/null
+++ b/i486-stage1/elfutils/DESCR
@@ -0,0 +1,8 @@
+# libelf is needed by iproute2
+SYSROOT_INSTALL=1
+
+# we actually need the libelf subpackage to link to
+ADDITIONAL_INSTALL_PACKAGE=libelf
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/expat/DESCR b/i486-stage1/expat/DESCR
new file mode 100644
index 0000000..e8c1341
--- /dev/null
+++ b/i486-stage1/expat/DESCR
@@ -0,0 +1,8 @@
+# expat is needed for libarchive
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# TODO: ./configure: line 17309: program: command not found
+# most likely a harmless error when probing for some documentation build tool
diff --git a/i486-stage1/file/DESCR b/i486-stage1/file/DESCR
new file mode 100644
index 0000000..31c2965
--- /dev/null
+++ b/i486-stage1/file/DESCR
@@ -0,0 +1,5 @@
+# libmagic is needed for ? (TODO)
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
diff --git a/i486-stage1/findutils/DESCR b/i486-stage1/findutils/DESCR
new file mode 100644
index 0000000..8ed7de8
--- /dev/null
+++ b/i486-stage1/findutils/DESCR
@@ -0,0 +1,2 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/gdbm/DESCR b/i486-stage1/gdbm/DESCR
new file mode 100644
index 0000000..73ce19a
--- /dev/null
+++ b/i486-stage1/gdbm/DESCR
@@ -0,0 +1,5 @@
+# gdbm is needed by perl
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/gmp/DESCR b/i486-stage1/gmp/DESCR
new file mode 100644
index 0000000..73a6530
--- /dev/null
+++ b/i486-stage1/gmp/DESCR
@@ -0,0 +1,8 @@
+# gmp is needed by coreutils (later for gawk, gcc)
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# remove explicit CHOST for build host
+sed -i 's@--build=${CHOST}@@g' PKGBUILD
diff --git a/i486-stage1/grep/DESCR b/i486-stage1/grep/DESCR
new file mode 100644
index 0000000..8ed7de8
--- /dev/null
+++ b/i486-stage1/grep/DESCR
@@ -0,0 +1,2 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/gzip/DESCR b/i486-stage1/gzip/DESCR
new file mode 100644
index 0000000..2a024e0
--- /dev/null
+++ b/i486-stage1/gzip/DESCR
@@ -0,0 +1,5 @@
+# gzip is needed for libarchive, (z)less
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/inetutils/DESCR b/i486-stage1/inetutils/DESCR
new file mode 100644
index 0000000..669cd5f
--- /dev/null
+++ b/i486-stage1/inetutils/DESCR
@@ -0,0 +1,11 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# no libedit, introduces a cycle with linux-headers, libedit
+sed -i "s@./configure@./configure --disable-readline@" PKGBUILD
+
+# no man page generation
+sed -i "/depends=/s/help2man//" PKGBUILD
+
+# see https://bugs.archlinux.org/task/57352
+sed -i 's@"\(https://ftp.gnu.org/gnu/inetutils.*\)"@\1@g' PKGBUILD
diff --git a/i486-stage1/iproute2/DESCR b/i486-stage1/iproute2/DESCR
new file mode 100644
index 0000000..a380e81
--- /dev/null
+++ b/i486-stage1/iproute2/DESCR
@@ -0,0 +1,5 @@
+# cross-compilation and verbosity flags
+sed -i "s@make\$@make V=1 HOSTCC=gcc CC=$TARGET_ARCH-cc AR=$TARGET_ARCH-ar@g" PKGBUILD
+
+# disable linux-atm (unlikely we still have some ATM based networks)
+sed -i "/makedepends=/s/'linux-atm'//" PKGBUILD
diff --git a/i486-stage1/iptables/DESCR b/i486-stage1/iptables/DESCR
new file mode 100644
index 0000000..8e9c1c9
--- /dev/null
+++ b/i486-stage1/iptables/DESCR
@@ -0,0 +1,19 @@
+# iptables is needed by iproute2
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# disable Berkley Packet Filtering
+sed -i 's@--enable-bpf-compiler@--disable-bpf-compiler@g' PKGBUILD
+
+# disable nftable support, draws in more libraries, we need the xtables
+# depevelopment mainly now for iproute2
+sed -i "/depends=/s/libnftnl//" PKGBUILD
+sed -i 's@./configure@./configure --disable-nftables@' PKGBUILD
+
+# disable libpcap (tcpdump, draws in too many dependencies)
+sed -i "/depends=/s/libpcap//" PKGBUILD
+
+# disable connection tracking
+sed -i 's@./configure@./configure --disable-connlabel@' PKGBUILD
diff --git a/i486-stage1/joe/DESCR b/i486-stage1/joe/DESCR
new file mode 100644
index 0000000..8ed7de8
--- /dev/null
+++ b/i486-stage1/joe/DESCR
@@ -0,0 +1,2 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/kbd/DESCR b/i486-stage1/kbd/DESCR
new file mode 100644
index 0000000..2e3bcfb
--- /dev/null
+++ b/i486-stage1/kbd/DESCR
@@ -0,0 +1,5 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# no unit testing (using C 'check')
+sed -i 's@makedepends\(.*\)@#makedepends\1@g' PKGBUILD
diff --git a/i486-stage1/kmod/DESCR b/i486-stage1/kmod/DESCR
new file mode 100644
index 0000000..6039431
--- /dev/null
+++ b/i486-stage1/kmod/DESCR
@@ -0,0 +1,6 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# don't build documentation
+sed -i "/depends=/s/gtk-doc//" PKGBUILD
+sed -i "s/--enable-gtk-doc/--disable-gtk-doc/" PKGBUILD
diff --git a/i486-stage1/less/DESCR b/i486-stage1/less/DESCR
new file mode 100644
index 0000000..a4c1acd
--- /dev/null
+++ b/i486-stage1/less/DESCR
@@ -0,0 +1,3 @@
+# prepare configure for cross-compilation
+sed -i "s@sh configure@sh configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
diff --git a/i486-stage1/libarchive/DESCR b/i486-stage1/libarchive/DESCR
new file mode 100644
index 0000000..0a42942
--- /dev/null
+++ b/i486-stage1/libarchive/DESCR
@@ -0,0 +1,5 @@
+# libarchive is needed for pacman
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/libcap/DESCR b/i486-stage1/libcap/DESCR
new file mode 100644
index 0000000..c58fb49
--- /dev/null
+++ b/i486-stage1/libcap/DESCR
@@ -0,0 +1,22 @@
+# libcap is needed for coreutils
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@KERNEL_HEADERS=/usr/include@BUILD_CC=gcc CC=$TARGET_ARCH-gcc AR=$TARGET_ARCH-ar RANLIB=$TARGET_ARCH-ranlib KERNEL_HEADERS=/usr/include@" PKGBUILD
+
+# https://bugs.gentoo.org/604802
+# gperf_case_strncmp (register const char *s1, register const char *s2, register size_t n)
+# gperf output is somehow broken for cross-compilation
+# https://bugs.gentoo.org/attachment.cgi?id=462080
+# TODO: https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/log/
+# wget -O libcap-2.25-gperf.patch 'https://604802.bugs.gentoo.org/attachment.cgi?id=462080'
+# copy libcap-2.25-gperf.patch from i486 folder
+sed -i 's@source=(@source=(libcap-2.25-gperf.patch @' PKGBUILD
+sed -i "s@md5sums=(@md5sums=('SKIP' @" PKGBUILD
+sed -i '2!N; /prepare() *{ *\n *cd/ a \ patch -Np1 < ${srcdir}/libcap-2.25-gperf.patch' PKGBUILD
+
+# TODO: mail this to https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/log/
+# libcap needs pam just when building a test (which we cannot execute anyway)
+# test.c:3:10: fatal error: security/pam_modules.h: No such file or directory
+# #include <security/pam_modules.h>
+# => add pam as dependency and build it as we need it anyway sooner or later
diff --git a/i486-stage1/libcap/libcap-2.25-gperf.patch b/i486-stage1/libcap/libcap-2.25-gperf.patch
new file mode 100644
index 0000000..ddce2c4
--- /dev/null
+++ b/i486-stage1/libcap/libcap-2.25-gperf.patch
@@ -0,0 +1,12 @@
+diff -rauN libcap-2.25/libcap/Makefile libcap-2.25-crossfix/libcap/Makefile
+--- libcap-2.25/libcap/Makefile 2016-01-31 01:01:41.000000000 +0100
++++ libcap-2.25-crossfix/libcap/Makefile 2017-12-07 21:44:49.040000002 +0100
+@@ -41,7 +41,7 @@
+ ./_makenames > cap_names.h
+
+ $(GPERF_OUTPUT): cap_names.list.h
+- perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
++ perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --includes --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
+
+ cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
+ @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"
diff --git a/i486-stage1/libedit/DESCR b/i486-stage1/libedit/DESCR
new file mode 100644
index 0000000..6ee9176
--- /dev/null
+++ b/i486-stage1/libedit/DESCR
@@ -0,0 +1,5 @@
+# libedit is needed by openssh
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/libmnl/DESCR b/i486-stage1/libmnl/DESCR
new file mode 100644
index 0000000..e613146
--- /dev/null
+++ b/i486-stage1/libmnl/DESCR
@@ -0,0 +1,5 @@
+# libmnl is needed by iproute2
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/libnfnetlink/DESCR b/i486-stage1/libnfnetlink/DESCR
new file mode 100644
index 0000000..8aa6d2d
--- /dev/null
+++ b/i486-stage1/libnfnetlink/DESCR
@@ -0,0 +1,5 @@
+# libnfnetlink is needed by iproute2
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/libtirpc/DESCR b/i486-stage1/libtirpc/DESCR
new file mode 100644
index 0000000..58b2b4f
--- /dev/null
+++ b/i486-stage1/libtirpc/DESCR
@@ -0,0 +1,19 @@
+# libtirpc is needed by pam
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# disable Kerberos
+sed -i "/depends=/s/'krb5'//" PKGBUILD
+
+# gssapi seems also to be a dependency, not in PKBUILD, disable it
+sed -i 's@./configure@./configure --disable-gssapi@g' PKGBUILD
+
+# doens't really like to be cross-compiled..
+# xdr_sizeof.c:93:13: error: 'uintptr_t' undeclared (first use in this function); did you mean '__intptr_t'?
+# => https://bugzilla.redhat.com/show_bug.cgi?id=1482063
+# => libtirpc-1.0.2-stdint.patch
+sed -i 's@source=(@source=(libtirpc-1.0.2-stdint.patch @' PKGBUILD
+sed -i "s@sha1sums=(@sha1sums=('0322752c231884c5434b4e56a3c376d7bfedf9d9' @" PKGBUILD
+sed -i '/build()/ i \ prepare() { \n\ cd ${pkgname}-${pkgver}\n\ patch -Np1 < ${srcdir}/libtirpc-1.0.2-stdint.patch \n }' PKGBUILD
diff --git a/i486-stage1/libtirpc/libtirpc-1.0.2-stdint.patch b/i486-stage1/libtirpc/libtirpc-1.0.2-stdint.patch
new file mode 100644
index 0000000..5d65359
--- /dev/null
+++ b/i486-stage1/libtirpc/libtirpc-1.0.2-stdint.patch
@@ -0,0 +1,11 @@
+diff -rauN libtirpc-1.0.2/src/xdr_sizeof.c libtirpc-1.0.2-stdint-patch/src/xdr_sizeof.c
+--- libtirpc-1.0.2/src/xdr_sizeof.c 2017-07-05 17:02:23.000000000 +0200
++++ libtirpc-1.0.2-stdint-patch/src/xdr_sizeof.c 2017-12-18 21:54:34.938360673 +0100
+@@ -39,6 +39,7 @@
+ #include <rpc/xdr.h>
+ #include <sys/types.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include "un-namespace.h"
+
+ /* ARGSUSED */
diff --git a/i486-stage1/linux-api-headers/DESCR b/i486-stage1/linux-api-headers/DESCR
new file mode 100644
index 0000000..b2ad3b4
--- /dev/null
+++ b/i486-stage1/linux-api-headers/DESCR
@@ -0,0 +1,4 @@
+# the Linux kernel has it's own way for cross compilation, we need
+# only the header files for glibc later, but it's better to make sure
+# to pick the correct target archicture right away
+sed -i "s@make@make ARCH=$KERNEL_ARCH CROSS_COMPILE=$XTOOLS_ARCH_PREFIX@g" PKGBUILD
diff --git a/i486-stage1/linux/DESCR b/i486-stage1/linux/DESCR
new file mode 100644
index 0000000..09714f2
--- /dev/null
+++ b/i486-stage1/linux/DESCR
@@ -0,0 +1,14 @@
+# we currently build a monolitic kernel for the basic stuff which was
+# available since 25 years. :-)
+
+# the Linux kernel has it's own way for cross compilation
+sed -i "s@make prepare@make prepare ARCH=$KERNEL_ARCH CROSS_COMPILE=$XTOOLS_ARCH_PREFIX@g" PKGBUILD
+sed -i "s@make config@make config ARCH=$KERNEL_ARCH CROSS_COMPILE=$XTOOLS_ARCH_PREFIX@g" PKGBUILD
+
+# remove make dependencies, currently we build without module support
+# (TODO: though we can easily build kmod, but we are missing a simple ramdisk for stage1)
+sed -i "s@make bzImage modules@make bzImage ARCH=$KERNEL_ARCH CROSS_COMPILE=$XTOOLS_ARCH_PREFIX@g" PKGBUILD
+sed -i "s@make modules_install@#make modules_install@g" PKGBUILD
+
+# disable documentation
+sed -i "/depends=/s/xmlto//" PKGBUILD
diff --git a/i486-stage1/lz4/DESCR b/i486-stage1/lz4/DESCR
new file mode 100644
index 0000000..2dae4e8
--- /dev/null
+++ b/i486-stage1/lz4/DESCR
@@ -0,0 +1,12 @@
+# lz4 is needed for libarchive
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@\( \+\)make@\1make CC=$TARGET_ARCH-cc RANLIB=$TARGET_ARCH-ranlib AR=$TARGET_ARCH-ar@g" PKGBUILD
+
+# lz4 has a git makedepends, diffutils for unit tests
+sed -i 's@makedepends\(.*\)@#makedepends\1@g' PKGBUILD
+sed -i 's@checkdepends\(.*\)@#checkdepends\1@g' PKGBUILD
+
+
+
diff --git a/i486-stage1/ncurses/DESCR b/i486-stage1/ncurses/DESCR
new file mode 100644
index 0000000..f74cd4e
--- /dev/null
+++ b/i486-stage1/ncurses/DESCR
@@ -0,0 +1,5 @@
+# ncurses is needed by bash
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/net-tools/DESCR b/i486-stage1/net-tools/DESCR
new file mode 100644
index 0000000..e0227f8
--- /dev/null
+++ b/i486-stage1/net-tools/DESCR
@@ -0,0 +1,11 @@
+# prepare configure for cross-compilation
+sed -i "s@make @make CC=$TARGET_ARCH-cc LD=$TARGET_ARCH-ld @g" PKGBUILD
+sed -i "s@make\$@make CC=$TARGET_ARCH-cc LD=$TARGET_ARCH-ld @g" PKGBUILD
+
+# git for release checkouts, using the one from host
+sed -i "/makedepends/s/git//g" PKGBUILD
+
+# apply patch for double definitons in ip.h
+sed -i 's@source=(@source=(net-tools-1.60-if_tunnel.patch @' PKGBUILD
+sed -i "s@sha1sums=(@sha1sums=('SKIP' @" PKGBUILD
+sed -i '2!N; /prepare() {/ a \ pushd ${srcdir}/${pkgname}; patch -Np1 < ${srcdir}/net-tools-1.60-if_tunnel.patch; popd' PKGBUILD
diff --git a/i486-stage1/net-tools/net-tools-1.60-if_tunnel.patch b/i486-stage1/net-tools/net-tools-1.60-if_tunnel.patch
new file mode 100644
index 0000000..82aa34b
--- /dev/null
+++ b/i486-stage1/net-tools/net-tools-1.60-if_tunnel.patch
@@ -0,0 +1,11 @@
+diff -rauN net-tools-1.60-115f1af2/iptunnel.c net-tools-1.60-115f1af2-no-ip-header-patch/iptunnel.c
+--- net-tools-1.60-115f1af2/iptunnel.c 2017-12-26 21:14:18.650935837 +0100
++++ net-tools-1.60-115f1af2-no-ip-header-patch/iptunnel.c 2017-12-26 21:15:45.088534518 +0100
+@@ -26,7 +26,6 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <netinet/in.h>
+-#include <netinet/ip.h>
+ #include <arpa/inet.h>
+ #include <net/if.h>
+ #include <net/if_arp.h>
diff --git a/i486-stage1/openssh/DESCR b/i486-stage1/openssh/DESCR
new file mode 100644
index 0000000..453eaff
--- /dev/null
+++ b/i486-stage1/openssh/DESCR
@@ -0,0 +1,12 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# remove ldns and kerberos5 support, keep libedit (as it's easy to build)
+# ssh => not good, openssl <> unbound <> openssl cycle
+sed -i "/depends=/s/krb5//" PKGBUILD
+sed -i "/depends=/s/ldns//" PKGBUILD
+sed -i 's@--with-ldns@--without-ldns@g' PKGBUILD
+sed -i 's@--with-kerberos5=/usr@--without-kerberos5@g' PKGBUILD
+
+#ln: failed to create symbolic link '/build/openssh/pkg/openssh/usr/share/man/man1/slogin.1.gz': No such file or directory
+sed -i 's@\(ln -sf ssh.1.gz.*\)@#\1@g' PKGBUILD
diff --git a/i486-stage1/openssl/DESCR b/i486-stage1/openssl/DESCR
new file mode 100644
index 0000000..6e67468
--- /dev/null
+++ b/i486-stage1/openssl/DESCR
@@ -0,0 +1,12 @@
+# openssl is needed for a lot of packages, most prominently for 'coreutils'
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+# see https://how-to-build-for-arm.wikispaces.com/openssl
+sed -i "s@'i686'@'$TARGET_CPU'@g" PKGBUILD
+sed -i "s@'linux-elf'@'linux-generic32'@g" PKGBUILD
+sed -i 's@shared no-ssl3-method ${optflags}@shared ${optflags}@' PKGBUILD
+sed -i "s@make@make TARGETMACH=$TARGET_ARCH BUILDMACH=$BUILD_ARCH CROSS=$TARGET_ARCH CC=$TARGET_ARCH-cc LD=$TARGET_ARCH-ld AS=$TARGET_ARCH-as@g" PKGBUILD
+
+# TODO: bc is needed in the chroot to rebuild bc later, either build bc
+# inside chroot or cross-compile here
diff --git a/i486-stage1/pam/DESCR b/i486-stage1/pam/DESCR
new file mode 100644
index 0000000..24f403e
--- /dev/null
+++ b/i486-stage1/pam/DESCR
@@ -0,0 +1,27 @@
+# pam is needed for libcap
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# no flex, w3m, docboox-xml/xsl (no docu and take flex from the host)
+sed -i "s@makedepends=@#makedepends=@" PKGBUILD
+
+# disable NIS/YP
+sed -i 's@./configure@./configure --disable-nis@g' PKGBUILD
+
+# unix_passwd.c:56:10: fatal error: rpcsvc/yp_prot.h: No such file or directory
+# #include <rpcsvc/yp_prot.h>
+# => pam-1.3.0-unix-passwd-no-yp.patch
+sed -i 's@source=(@source=(pam-1.3.0-unix-passwd-no-yp.patch @' PKGBUILD
+sed -i "s@md5sums=(@md5sums=('3f5edd685cdd2c0a2ca44bc6e75320d8' @" PKGBUILD
+sed -i '/patch -Np/ a \ patch -Np1 -i "${srcdir}/pam-1.3.0-unix-passwd-no-yp.patch"' PKGBUILD
+
+# disable docu rebuilding
+sed -i 's@./configure@./configure --disable-regenerate-docu@' PKGBUILD
+
+# no documentation built, so nothing to remove
+sed -i '2!N; /# FS #40749\n \+rm/ s/rm/#rm/g' PKGBUILD
+
+# tons of tools needed to build documentation, we ommit the documentation right now
+sed -i "s@makedepends@#makedepends@" PKGBUILD
diff --git a/i486-stage1/pam/pam-1.3.0-unix-passwd-no-yp.patch b/i486-stage1/pam/pam-1.3.0-unix-passwd-no-yp.patch
new file mode 100644
index 0000000..1ac4a11
--- /dev/null
+++ b/i486-stage1/pam/pam-1.3.0-unix-passwd-no-yp.patch
@@ -0,0 +1,67 @@
+diff -rauN pam_unix2-2.9.1/config.h.in pam_unix2-2.9.1-unix-passwd-no-yp-patch/config.h.in
+--- pam_unix2-2.9.1/config.h.in 2012-04-03 15:31:24.000000000 +0200
++++ pam_unix2-2.9.1-unix-passwd-no-yp-patch/config.h.in 2017-12-08 16:15:09.870000003 +0100
+@@ -194,3 +194,6 @@
+
+ /* Define to 1 if you need to in order for `stat' and other things to work. */
+ #undef _POSIX_SOURCE
++
++/* Define to 1 if you have the <rpcsvc/yp_prot.h> header file. */
++#undef HAVE_RPCSVC_YP_PROT_H
+diff -rauN pam_unix2-2.9.1/configure.in pam_unix2-2.9.1-unix-passwd-no-yp-patch/configure.in
+--- pam_unix2-2.9.1/configure.in 2012-04-03 15:31:17.000000000 +0200
++++ pam_unix2-2.9.1-unix-passwd-no-yp-patch/configure.in 2017-12-08 16:15:22.160000000 +0100
+@@ -60,6 +60,7 @@
+ AC_CHECK_HEADERS(crypt.h)
+ AC_CHECK_HEADERS(stdlib.h pwd.h sys/types.h syslog.h sys/syslog.h string.h strings.h, , AC_MSG_ERROR(some basic headers are missing))
+ AC_CHECK_HEADERS(security/pam_appl.h security/pam_modules.h, , AC_MSG_ERROR(broken libpam installation))
++AC_CHECK_HEADERS(rpcsvc/yp_prot.h)
+
+ dnl Check for Linux-PAM 0.99.x
+ AC_CHECK_HEADERS(security/pam_ext.h)
+diff -rauN pam_unix2-2.9.1/src/unix_passwd.c pam_unix2-2.9.1-unix-passwd-no-yp-patch/src/unix_passwd.c
+--- pam_unix2-2.9.1/src/unix_passwd.c 2012-04-03 15:24:51.000000000 +0200
++++ pam_unix2-2.9.1-unix-passwd-no-yp-patch/src/unix_passwd.c 2017-12-08 16:15:33.389999993 +0100
+@@ -53,8 +53,10 @@
+ #include <rpc/types.h>
+ #include <nss.h>
+ #include <syslog.h>
++#if defined(HAVE_YP_PROT_H)
+ #include <rpcsvc/yp_prot.h>
+ #include <rpcsvc/ypclnt.h>
++#endif
+
+ #define PAM_SM_PASSWORD
+ #include <security/pam_modules.h>
+@@ -413,6 +415,7 @@
+ }
+ }
+
++#if defined(HAVE_YP_PROT_H)
+ static char *
+ getnismaster (pam_handle_t *pamh, int flags)
+ {
+@@ -445,6 +448,7 @@
+
+ return master;
+ }
++#endif
+
+ static int
+ read_loop (int fd, char *buffer, int count)
+@@ -1095,6 +1099,7 @@
+
+ ulckpwdf ();
+ }
++#if defined(HAVE_YP_PROT_H)
+ else if (data->service == S_YP)
+ {
+ struct yppasswd yppwd;
+@@ -1137,6 +1142,7 @@
+ retval = PAM_AUTHTOK_ERR;
+ }
+ }
++#endif
+
+ return retval;
+ }
diff --git a/i486-stage1/pambase/DESCR b/i486-stage1/pambase/DESCR
new file mode 100644
index 0000000..5cdb578
--- /dev/null
+++ b/i486-stage1/pambase/DESCR
@@ -0,0 +1,2 @@
+# pambase is needed by pam
+SYSROOT_INSTALL=1
diff --git a/i486-stage1/patch/DESCR b/i486-stage1/patch/DESCR
new file mode 100644
index 0000000..1995b5a
--- /dev/null
+++ b/i486-stage1/patch/DESCR
@@ -0,0 +1,2 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
diff --git a/i486-stage1/pcre/DESCR b/i486-stage1/pcre/DESCR
new file mode 100644
index 0000000..8445c25
--- /dev/null
+++ b/i486-stage1/pcre/DESCR
@@ -0,0 +1,5 @@
+# pcre is needed for grep
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/perl/DESCR b/i486-stage1/perl/DESCR
new file mode 100644
index 0000000..80032bf
--- /dev/null
+++ b/i486-stage1/perl/DESCR
@@ -0,0 +1,26 @@
+# the official cross-compilation support in Perl is weird and needs a
+# running remote SSH access to the real machine:
+# https://stackoverflow.com/questions/5464538/cross-compile-perl-for-arm
+#
+# we go with https://arsv.github.io/perl-cross/
+sed -i '/source=/ a\ https://github.com/arsv/perl-cross/releases/download/1.1.8/perl-cross-1.1.8.tar.gz' PKGBUILD
+sed -i "/md5sums=/ a\ 'SKIP'" PKGBUILD
+sed -i '1!N; /prepare() *{\n *cd/ a \ tar --strip-components=1 -zxf ${srcdir}/perl-cross-1.1.8.tar.gz' PKGBUILD
+sed -i "s@./Configure -des@./configure --target=$TARGET_ARCH@" PKGBUILD
+
+# ./miniperl_top: no ./miniperl found; build it before using miniperl_top
+# we can build in parallel with this small trick: there is a dependency
+# missing from miniperl_top to miniperl it seems
+sed -i 's/^ \+make$/make miniperl; make/' PKGBUILD
+
+# rm: cannot remove '/home/cross/build/perl/pkg/perl/usr/bin/perl5.26.1': No such file or directory
+sed -i 's@\(rm "$pkgdir/usr/bin/perl$pkgver\)@#\1@g' PKGBUILD
+
+# the hook fails as we lack some findtools and sed
+# pacman does not have a --no-execute-hooks mode
+#Can't open /dev/null: No such file or directory
+#/usr/share/libalpm/scripts/detect-old-perl-modules.sh: line 8: find: command not found
+#/usr/share/libalpm/scripts/detect-old-perl-modules.sh: line 19: pacman: command not found
+#/usr/share/libalpm/scripts/detect-old-perl-modules.sh: line 19: wc: command not found
+#/usr/share/libalpm/scripts/detect-old-perl-modules.sh: line 25: wc: command not found
+#/usr/share/libalpm/scripts/detect-old-perl-modules.sh: line 13: sed: command not found
diff --git a/i486-stage1/procps-ng/DESCR b/i486-stage1/procps-ng/DESCR
new file mode 100644
index 0000000..26d5bff
--- /dev/null
+++ b/i486-stage1/procps-ng/DESCR
@@ -0,0 +1,14 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# no systemd for now
+sed -i "/makedepends=/s/'systemd'//" PKGBUILD
+sed -i "/depends=/s/'libsystemd'//" PKGBUILD
+sed -i 's@--with-systemd@--without-systemd@' PKGBUILD
+
+# do not use the stub rpl_malloc/rpl_realloc functions (they don't cross-compile
+# and we know that glibc fixed those problems long time ago)
+sed -i '2!N; /prepare()/ a \ sed -i "s/AC_FUNC_MALLOC/dnl AC_FUNC_MALLOC/" configure.ac \
+ sed -i "s/AC_FUNC_REALLOC/dnl AC_FUNC_RELLOC/" configure.ac \
+ autoconf
+' PKGBUILD
diff --git a/i486-stage1/readline/DESCR b/i486-stage1/readline/DESCR
new file mode 100644
index 0000000..205f8d5
--- /dev/null
+++ b/i486-stage1/readline/DESCR
@@ -0,0 +1,5 @@
+# libreadline is needed by bash
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/sed/DESCR b/i486-stage1/sed/DESCR
new file mode 100644
index 0000000..e0c5138
--- /dev/null
+++ b/i486-stage1/sed/DESCR
@@ -0,0 +1,5 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# gettext: take the one from the host
+sed -i 's@makedepends\(.*\)@#makedepends\1@g' PKGBUILD
diff --git a/i486-stage1/shadow/DESCR b/i486-stage1/shadow/DESCR
new file mode 100644
index 0000000..ff12a87
--- /dev/null
+++ b/i486-stage1/shadow/DESCR
@@ -0,0 +1,18 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# remove docu and git dependencies
+sed -i 's@makedepends\(.*\)@#makedepends\1@g' PKGBUILD
+
+# building man pages needs xml2po, disable it
+sed -i 's@--enable-man@--disable-man@g' PKGBUILD
+sed -i '/find/,/-delete/{s/\(.*\)/#\1/g}' PKGBUILD
+sed -i '/rmdir/,/man8/{s/\(.*\)/#\1/g}' PKGBUILD
+# counterspells, yes I know, I'm bad with sed
+sed -i 's/^#}/}/' PKGBUILD
+# shadow: /usr/sbin exists in filesystem
+# revert last rmdir commenting of /usr/sbin removal
+sed -i 's@^# \+rmdir \+"$pkgdir/usr/sbin"@ rmdir "$pkgdir/usr/sbin"@' PKGBUILD
+
+sed -i '2!N; /prepare()/ a \ sed -i "/SUBDIRS/s/man//g" Makefile.am' PKGBUILD
+
diff --git a/i486-stage1/tar/DESCR b/i486-stage1/tar/DESCR
new file mode 100644
index 0000000..420e179
--- /dev/null
+++ b/i486-stage1/tar/DESCR
@@ -0,0 +1,7 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# checking whether mknod can create fifo without root privileges... configure: error: in `/build/tar/src/tar-1.29':
+# configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
+# See `config.log' for more details
+sed -i 's@./configure@FORCE_UNSAFE_CONFIGURE=1 ./configure@g' PKGBUILD
diff --git a/i486-stage1/template/DESCR b/i486-stage1/template/DESCR
new file mode 100644
index 0000000..faa5d7f
--- /dev/null
+++ b/i486-stage1/template/DESCR
@@ -0,0 +1,24 @@
+# NEEDS_YAOURT = 0 | 1
+# asp is the default tool to fetch packages, if the
+# package is only available in AUR, the set NEEDS_YAOURT=1
+NEEDS_YAOURT=0
+
+# NOPARALLEL_BUILD = 0 | 1
+# the -j<N> parameter to makepkg will be set to -j if
+# NOPARALLEL_PACKAGE=1. The default is to use all avaiable cores
+# and set -j<CPUS>
+NOPARALLEL_BUILD=0
+
+# SYSROOT_INSTALL = 0 | 1
+# packages are per default only installed in $STAGE1_CHROOT.
+# if packages depened on the package being installed you can
+# force the installation of the files in the package also into
+# the sysroot of the cross-compiler
+SYSROOT_INSTALL=0
+
+# ADDITIONAL_INSTALL_PACKAGE = <package name>
+# per default the package has the same name as the package file,
+# some packages generate additional package files to install
+# (for example util-linux also has a libutil-linux)
+# Note: SYSROOT_INSTALL respects this too
+ADDITIONAL_INSTALL_PACKAGE=
diff --git a/i486-stage1/texinfo/DESCR b/i486-stage1/texinfo/DESCR
new file mode 100644
index 0000000..8d6ff65
--- /dev/null
+++ b/i486-stage1/texinfo/DESCR
@@ -0,0 +1,5 @@
+# texinfo is needed to build grep and other tools
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
diff --git a/i486-stage1/uinit/DESCR b/i486-stage1/uinit/DESCR
new file mode 100644
index 0000000..34a987d
--- /dev/null
+++ b/i486-stage1/uinit/DESCR
@@ -0,0 +1,2 @@
+# uinit as temporary systemd replacement for PID 1, lives in the AUR
+NEEDS_YAOURT=1
diff --git a/i486-stage1/util-linux/DESCR b/i486-stage1/util-linux/DESCR
new file mode 100644
index 0000000..38e4b24
--- /dev/null
+++ b/i486-stage1/util-linux/DESCR
@@ -0,0 +1,21 @@
+# libutil-linux is needed for e2fsprogs
+SYSROOT_INSTALL=1
+
+# install two packages: libutil-linux and util-linux
+ADDITIONAL_INSTALL_PACKAGE=libutil-linux
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# disable some dependencies on systemd, python, libcap-ng
+sed -i 's@makedepends\(.*\)@#makedepends\1@g' PKGBUILD
+sed -i 's@ \+depends\(.*\)@#depends\1@g' PKGBUILD
+
+# no python
+sed -i 's@--with-python=3@--without-python \\@g' PKGBUILD
+
+# no systemd
+sed -i '/--without-python/ a \ --without-systemd --without-systemdsystemunitdir' PKGBUILD
+sed -i "s@\(sed.*\)@#\1@" PKGBUILD
+# TODO: needed?
+# sed -i '/ListenStream/ aRuntimeDirectory=uuidd' "$pkgdir/usr/lib/systemd/system/uuidd.socket"
diff --git a/i486-stage1/xz/DESCR b/i486-stage1/xz/DESCR
new file mode 100644
index 0000000..6b043fe
--- /dev/null
+++ b/i486-stage1/xz/DESCR
@@ -0,0 +1,8 @@
+# xz is needed for libarchive
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@g" PKGBUILD
+
+# with gcc 7.2 we get new errors, disable termination on warnings
+sed -i 's@--enable-werror@--disable-werror@g' PKGBUILD
diff --git a/i486-stage1/zlib/DESCR b/i486-stage1/zlib/DESCR
new file mode 100644
index 0000000..32df420
--- /dev/null
+++ b/i486-stage1/zlib/DESCR
@@ -0,0 +1,6 @@
+# zlib is needed by cracklib, binutils, curl, file, libarchive, ...
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "1!N; /autoreconf.*\n/ s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+sed -i "s@make@make TARGETMACH=$TARGET_ARCH BUILDMACH=$BUILD_ARCH CROSS=$TARGET_ARCH CC=$TARGET_ARCH-cc LD=$TARGET_ARCH-ld AS=$TARGET_ARCH-as@g" PKGBUILD