1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
# $Id$ |
3 |
|
|
4 |
# |
# |
5 |
# builds packages from given dir |
# builds packages from given dir |
6 |
# |
# |
7 |
|
|
8 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/pkgbuild_dir.sh,v 1.15 2007-03-19 19:24:46 niro Exp $ |
# export default C locale |
9 |
|
export LC_ALL=C |
|
# set default user mage.rc |
|
|
: ${MAGERC="/etc/mage.rc"} |
|
10 |
|
|
|
PKGSUFFIX="mpk" |
|
11 |
PKGNAME="$1" |
PKGNAME="$1" |
12 |
SEARCHDIRS="$2" |
SEARCHDIRS="$2" |
|
MLIBDIR=/usr/lib/mage |
|
13 |
|
|
14 |
## only for tests -> normally in /etc/rc.d/init.d/functions |
[[ -z ${PKGNAME} ]] && echo "No package name given. Aborting." && exit 1 |
15 |
COLRED="\033[1;6m\033[31m" |
[[ -z ${SEARCHDIRS} ]] && echo "No source dir given. Aborting." && exit 1 |
|
COLGREEN="\033[1;6m\033[32m" |
|
|
COLYELLOW="\033[1;6m\033[33m" |
|
|
COLBLUE="\033[1;6m\033[34m" |
|
|
COLMAGENTA="\033[1;6m\033[35m" |
|
|
COLWHITE="\033[1;6m\033[37m" |
|
|
COLGRAY="\033[0;6m\033[37m" |
|
|
COLBOLD="\033[1m" |
|
|
COLDEFAULT="\033[0m" |
|
|
|
|
|
if [[ ${NOCOLORS} = true ]] |
|
|
then |
|
|
COLRED="" |
|
|
COLGREEN="" |
|
|
COLYELLOW="" |
|
|
COLBLUE="" |
|
|
COLMAGENTA="" |
|
|
COLWHITE="" |
|
|
COLGRAY="" |
|
|
COLBOLD="" |
|
|
COLDEFAULT="" |
|
|
fi |
|
|
|
|
|
# export default C locale |
|
|
export LC_ALL=C |
|
|
|
|
|
[[ -z $1 ]] && echo "No package name given. Aborting." && exit 1 |
|
|
[[ -z $2 ]] && echo "No source dir given. Aborting." && exit 1 |
|
16 |
|
|
17 |
source /etc/mage.rc.global |
source /etc/mage.rc.global |
18 |
[[ -f ${MAGERC} ]] && source ${MAGERC} |
[[ -f ${MAGERC} ]] && source ${MAGERC} |
158 |
find ${BUILDDIR}/${PKGNAME}/binfiles -exec touch -m -r ${BUILDDIR}/${PKGNAME}/.mtime '{}' ';' |
find ${BUILDDIR}/${PKGNAME}/binfiles -exec touch -m -r ${BUILDDIR}/${PKGNAME}/.mtime '{}' ';' |
159 |
} |
} |
160 |
|
|
|
build_rmtimestamp() |
|
|
{ |
|
|
rm /var/tmp/timestamp |
|
|
} |
|
|
|
|
161 |
build_package() |
build_package() |
162 |
{ |
{ |
163 |
echo -e "${COLBLUE}===${COLGREEN} building package tarball ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} building package tarball ...${COLDEFAULT}" |