4 |
# builds packages from given dir |
# builds packages from given dir |
5 |
# |
# |
6 |
|
|
7 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/pkgbuild_dir.sh,v 1.13 2007-01-22 00:24:14 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/pkgbuild_dir.sh,v 1.14 2007-03-19 19:10:07 niro Exp $ |
8 |
|
|
9 |
# set default user mage.rc |
# set default user mage.rc |
10 |
: ${MAGERC="/etc/mage.rc"} |
: ${MAGERC="/etc/mage.rc"} |
24 |
[[ -z $1 ]] && echo "No package name given. Aborting." && exit 1 |
[[ -z $1 ]] && echo "No package name given. Aborting." && exit 1 |
25 |
[[ -z $2 ]] && echo "No source dir given. Aborting." && exit 1 |
[[ -z $2 ]] && echo "No source dir given. Aborting." && exit 1 |
26 |
|
|
27 |
|
source /etc/mage.rc.global |
28 |
if [ -f ${MAGERC} ] |
if [ -f ${MAGERC} ] |
29 |
then |
then |
30 |
source ${MAGERC} |
source ${MAGERC} |
59 |
|
|
60 |
build_postinstall() |
build_postinstall() |
61 |
{ |
{ |
62 |
echo |
echo -e "${COLBLUE}===${COLGREEN} fetching files for package '${PKGNAME}' ...${COLDEFAULT}" |
|
echo "Fetching files for package '${PKGNAME}' ..." |
|
63 |
|
|
64 |
# md5sums will only be generated for files: $M_MD5SUM |
# md5sums will only be generated for files: $M_MD5SUM |
65 |
|
|
148 |
unset IFS |
unset IFS |
149 |
|
|
150 |
# forcing mtime to same value |
# forcing mtime to same value |
151 |
echo -n "Forcing mtime to the same value ..." |
echo -e "${COLBLUE}===${COLGREEN} forcing mtime to the same value ...${COLDEFAULT}" |
152 |
find ${BUILDDIR}/${PKGNAME}/binfiles \ |
find ${BUILDDIR}/${PKGNAME}/binfiles -exec touch -m -r ${BUILDDIR}/${PKGNAME}/.mtime '{}' ';' |
|
-exec touch -m -r ${BUILDDIR}/${PKGNAME}/.mtime '{}' ';' \ |
|
|
&& echo done || echo false |
|
153 |
} |
} |
154 |
|
|
155 |
build_rmtimestamp() |
build_rmtimestamp() |
159 |
|
|
160 |
build_package() |
build_package() |
161 |
{ |
{ |
162 |
echo "Building Package ..." |
echo -e "${COLBLUE}===${COLGREEN} building package tarball ...${COLDEFAULT}" |
163 |
cd ${BUILDDIR} |
cd ${BUILDDIR} |
164 |
tar cvjf ${PKGNAME}.tar.bz2 ./${PKGNAME} |
tar cvjf ${PKGNAME}.tar.bz2 ./${PKGNAME} |
165 |
install -d ${PKGDIR} |
install -d ${PKGDIR} |