Magellan Linux

Diff of /tags/mage-0_4_23/usr/lib/mage/pkgbuild_dir.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 315 by niro, Sun Jan 1 23:46:08 2006 UTC revision 440 by niro, Mon Mar 19 19:10:07 2007 UTC
# Line 4  Line 4 
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.11 2006-01-01 23:46:08 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
10    : ${MAGERC="/etc/mage.rc"}
11    
12  PKGSUFFIX="mpk"  PKGSUFFIX="mpk"
13  PKGNAME="$1"  PKGNAME="$1"
# Line 21  export LC_ALL=C Line 24  export LC_ALL=C
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  if [ -f /etc/mage.rc ]  source /etc/mage.rc.global
28    if [ -f ${MAGERC} ]
29  then  then
30   source /etc/mage.rc   source ${MAGERC}
31  else  else
32   echo "Your /etc/mage.rc is missing. Aborting."   echo "Your ${MAGERC} is missing. Aborting."
33   exit 1   exit 1
34  fi  fi
35  source ${MLIBDIR}/mage4.functions.sh  source ${MLIBDIR}/mage4.functions.sh
36    
37  # set PKGDIR and BUILDDIR and BINDIR to MROOT  # set PKGDIR and BUILDDIR and BINDIR to MROOT
38  #if [[ -n ${MROOT} ]]  if [[ -n ${MROOT} ]]
39  #then  then
40  # export PKGDIR=${MROOT}/${PKGDIR}   export PKGDIR=${MROOT}/${PKGDIR}
41  # export BUILDDIR=${MROOT}/${BUILDDIR}   export BUILDDIR=${MROOT}/${BUILDDIR}
42  # export BINDIR=${MROOT}/${BINDIR}   export BINDIR=${MROOT}/${BINDIR}
43  #fi  fi
44    
45  build_preinstall()  build_preinstall()
46  {  {
# Line 55  build_preinstall() Line 59  build_preinstall()
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    
# Line 145  build_postinstall() Line 148  build_postinstall()
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()
# Line 158  build_rmtimestamp() Line 159  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}

Legend:
Removed from v.315  
changed lines
  Added in v.440