build: make packages aware of their architecture

Here we stuff a directory into the path.  This is especially useful
when we are going to cross-build.  mips and arm, anyone?  ;)
This commit is contained in:
Franco Fichtner 2015-01-03 19:46:33 +01:00
parent 0e608c1586
commit d01671e454
6 changed files with 14 additions and 14 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2015 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2015 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -127,8 +127,8 @@ setup_packages()
shift
PKGLIST=${@}
mkdir -p ${PACKAGESDIR} ${BASEDIR}/${PACKAGESDIR}
cp ${PACKAGESDIR}/* ${BASEDIR}/${PACKAGESDIR} || true
mkdir -p ${PACKAGESDIR}/${ARCH} ${BASEDIR}/${PACKAGESDIR}
cp ${PACKAGESDIR}/${ARCH}/* ${BASEDIR}/${PACKAGESDIR} || true
if [ -z "${PKGLIST}" ]; then
# forcefully add all available packages
@ -143,7 +143,7 @@ setup_packages()
done
fi
rm -rf ${BASEDIR}/${PACKAGESDIR}/*
rm -rf ${BASEDIR}/${PACKAGESDIR}
}
setup_platform()

View File

@ -29,7 +29,7 @@ set -e
. ./common.sh
rm -f ${PACKAGESDIR}/opnsense-*.txz
rm -f ${PACKAGESDIR}/${ARCH}/opnsense-*.txz
git_clear ${COREDIR}
git_describe ${COREDIR}
@ -118,6 +118,6 @@ EOF
echo -n ">>> Creating custom package for ${COREDIR}... "
pkg -c ${STAGEDIR} create -m / -r / -p /plist -o ${PACKAGESDIR}
mv ${STAGEDIR}${PACKAGESDIR}/opnsense-*.txz ${PACKAGESDIR}
mv ${STAGEDIR}${PACKAGESDIR}/opnsense-*.txz ${PACKAGESDIR}/${ARCH}
echo "done"

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2015 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2015 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -39,7 +39,7 @@ mkdir -p ${STAGEDIR}/Latest
mkdir -p ${STAGEDIR}/All
# push packages to home location
cp ${PACKAGESDIR}/* ${STAGEDIR}/All
cp ${PACKAGESDIR}/${ARCH}/* ${STAGEDIR}/All
# needed bootstrap glue when no packages are on the system
cd ${STAGEDIR}/Latest && ln -s ../All/pkg-*.txz pkg.txz

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2015 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -37,7 +37,7 @@ echo "${PORT_LIST}" | { while read PORT_NAME PORT_CAT PORT_OPT; do
continue
fi
PACKAGE=$(ls ${PACKAGESDIR}/${PORT_NAME}-*.txz 2> /dev/null || true)
PACKAGE=$(ls ${PACKAGESDIR}/${ARCH}/${PORT_NAME}-*.txz 2> /dev/null || true)
if [ -f "${PACKAGE}" ]; then
# may fail for missing dependencies and
# that's what we need: rebuild chain :)
@ -138,8 +138,8 @@ echo "${PORT_LIST}" | { while read PORT_NAME PORT_CAT PORT_OPT; do
done }
EOF
rm -rf ${PACKAGESDIR}/*
mv ${STAGEDIR}${PACKAGESDIR}/* ${PACKAGESDIR}
rm -rf ${PACKAGESDIR}/${ARCH}/*
cp ${STAGEDIR}${PACKAGESDIR}/* ${PACKAGESDIR}/${ARCH}/
cd ${TOOLSDIR}/build && ./core.sh
cd ${TOOLSDIR}/build && ./packages.sh