version 1.1, 2012/03/20 10:23:28
|
version 1.2, 2012/10/12 08:22:43
|
Line 0
|
Line 1
|
|
#!/bin/sh |
|
# |
|
# ELWIX build script for pkgsrc |
|
# |
|
# (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org> |
|
# by Michael Pounov <misho@elwix.org> |
|
# |
|
# ./build_package.sh <category/package_name> [options] |
|
# |
|
# $Id$ |
|
# |
|
|
|
[ -r ./config/rc.pkg ] && . ./config/rc.pkg |
|
[ -r ./config/rc.elwix ] && . ./config/rc.elwix |
|
if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then |
|
echo |
|
echo "ELWIX project is not configured !?!" |
|
echo |
|
exit 1 |
|
fi |
|
#V=${VERSION} |
|
[ -r ${CENV} ] && . ${CENV} |
|
#unset INSTALL |
|
VERSION="${TARGET_BUILD}" |
|
|
|
if [ ! -d $BSDSRC ]; then |
|
echo |
|
echo "ELWIX project is not configured - missing BSD sources !?!" |
|
echo |
|
exit 1 |
|
fi |
|
|
|
if [ ! -d $DEST ]; then |
|
echo |
|
echo "ELWIX project is not configured - missing Dest directory !?!" |
|
echo |
|
exit 1 |
|
fi |
|
|
|
if [ "${USER}" != "root" ]; then |
|
echo |
|
echo "Script must build under root" |
|
echo |
|
exit 1 |
|
fi |
|
|
|
### main |
|
|
|
if [ ! -r "${WORLD}/usr/pkgsrc" ]; then |
|
echo |
|
echo "Not configured pkgsrc!" |
|
echo |
|
exit 1 |
|
else |
|
cd ${WORLD}/usr/pkgsrc |
|
fi |
|
|
|
export USE_CROSS_COMPILE="yes" |
|
if [ "$(basename $0)" = "build_pkgsrc_native.sh" ]; then |
|
USE_CROSS_COMPILE="no" |
|
fi |
|
echo "+++ Cross compile of pkgsrc = $USE_CROSS_COMPILE" |
|
|
|
if ! cd ${1:-NO}; then |
|
echo |
|
echo "Packet '$1' not exists ... (example package name: net/bmon)" |
|
echo |
|
exit 1 |
|
else |
|
shift |
|
fi |
|
|
|
bmake $* |