#!/bin/bash # default config # default build arches DEFAULT_CPU_ARCHES=(generic ivybridge skylake broadwell silvermont) build_pkg() { echo 'source+=(batch_opts)' >> PKGBUILD updpkgsums makepkg --cleanbuild } # FIXME maybe check for local changes if ! git diff-index --quiet HEAD -- ; then echo 'local changes found, please commit first' >&2 echo 'exit' exit 1 fi # load local build script if found to apply gpg settings or alike, if existing if [ -e build_pkgs.local ] ; then source build_pkgs.local fi git checkout . for cpu in ${*:-${DEFAULT_CPU_ARCHES[*]}} ; do git checkout PKGBUILD case $cpu in generic) echo : > batch_opts build_pkg ;; *) cat >> PKGBUILD < batch_opts build_pkg ;; esac git checkout . done