diff options
-rw-r--r-- | src/ob-buildopk.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh index 74935b0..6f57c50 100644 --- a/src/ob-buildopk.sh +++ b/src/ob-buildopk.sh @@ -34,10 +34,12 @@ main() echo '2.0' >'debian-binary' if [ -n "${OB_DO_SOURCE}" ]; then - build_opk "src-${OPK_SOURCE}" "${OPK_SOURCE_VERSION}" + build_opk "src-${OPK_SOURCE}" "${OPK_SOURCE_VERSION}" 'src' else for pkg in ${OPK_PACKAGES}; do - build_opk "${pkg}" "${OPK_BINARY_VERSION}" + arch="$(ob_get_binary_parameter "${pkg}" 'Architecture')" + [ "${arch}" != 'all' ] && arch="${OPK_HOST_ARCH}" + build_opk "${pkg}" "${OPK_BINARY_VERSION}" "${arch}" done fi rm 'debian-binary' @@ -47,11 +49,12 @@ build_opk() { binary="${1}" version="${2}" + arch="${3}" (cd "${binary}.data" && tar -czf '../data.tar.gz' '.') (cd "${binary}.control" && tar -czf '../control.tar.gz' '.') - tar -czf "../../${binary}_${version}_all.opk" \ + tar -czf "../../${binary}_${version}_${arch}.opk" \ 'debian-binary' 'data.tar.gz' 'control.tar.gz' rm -Rf 'data.tar.gz' 'control.tar.gz' } |