Magellan Linux

Diff of /trunk/mage/usr/lib/mage/smage2.sh

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

revision 600 by niro, Mon Nov 5 17:08:33 2007 UTC revision 881 by niro, Mon Jun 29 18:56:32 2009 UTC
# Line 4  Line 4 
4  # needs pkgbuild_dir (mage)  # needs pkgbuild_dir (mage)
5    
6  # SMAGE2  # SMAGE2
7  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.60 2007-11-05 17:08:33 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.62 2007-11-28 10:47:50 niro Exp $
8    
9  #01.10.2004  #01.10.2004
10  # added ccache support  # added ccache support
# Line 20  SMAGENAME="$1" Line 20  SMAGENAME="$1"
20  SMAGESUFFIX="smage2"  SMAGESUFFIX="smage2"
21  MLIBDIR=/usr/lib/mage  MLIBDIR=/usr/lib/mage
22  SMAGEVERSION="$( < ${MLIBDIR}/version)"  SMAGEVERSION="$( < ${MLIBDIR}/version)"
23    SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log"
24    
25    
26  ## only for tests -> normally in /etc/rc.d/init.d/functions  ## only for tests -> normally in /etc/rc.d/init.d/functions
27  COLRED="\033[1;6m\033[31m"  COLRED="\033[1;6m\033[31m"
# Line 187  download_sources() Line 189  download_sources()
189   --continue \   --continue \
190   --progress bar \   --progress bar \
191   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
192     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
193   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
194   if [[ $? = 0 ]]   if [[ $? = 0 ]]
195   then   then
# Line 211  download_sources() Line 214  download_sources()
214   --continue \   --continue \
215   --progress bar \   --progress bar \
216   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
217     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
218   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
219   if [[ $? = 0 ]]   if [[ $? = 0 ]]
220   then   then
# Line 235  download_sources() Line 239  download_sources()
239   --continue \   --continue \
240   --progress bar \   --progress bar \
241   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
242     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
243   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
244   if [[ $? = 0 ]]   if [[ $? = 0 ]]
245   then   then
# Line 259  download_sources() Line 264  download_sources()
264   --continue \   --continue \
265   --progress bar \   --progress bar \
266   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
267     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
268   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
269   if [[ $? = 0 ]]   if [[ $? = 0 ]]
270   then   then
# Line 283  download_sources() Line 289  download_sources()
289   --continue \   --continue \
290   --progress bar \   --progress bar \
291   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
292     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
293   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
294   if [[ $? = 0 ]]   if [[ $? = 0 ]]
295   then   then
# Line 302  download_sources() Line 309  download_sources()
309   --continue \   --continue \
310   --progress bar \   --progress bar \
311   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
312     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
313   "${my_SRC_URI}"   "${my_SRC_URI}"
314   fi   fi
315   fi   fi
# Line 362  mconfigure() Line 370  mconfigure()
370   ./configure \   ./configure \
371   --prefix=/usr \   --prefix=/usr \
372   --host=${CHOST} \   --host=${CHOST} \
373     --build=${CHOST} \
374   --mandir=/usr/share/man \   --mandir=/usr/share/man \
375   --infodir=/usr/share/info \   --infodir=/usr/share/info \
376   --datadir=/usr/share \   --datadir=/usr/share \
# Line 452  munpack() Line 461  munpack()
461   unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed."   unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed."
462   ;;   ;;
463   rpm)   rpm)
464   pushd ${BUILDDIR} > /dev/null   pushd ${DEST} > /dev/null
465   rpm2targz ${SOURCEDIR}/${PNAME}/${SRCFILE} || die "rpm2targz: .rpm unpack failed."   rpm2targz ${SOURCEDIR}/${PNAME}/${SRCFILE} || die "rpm2targz: .rpm unpack failed."
466   tar --no-same-owner -xvzf ${SRCFILE/.rpm/.tar.gz/} || die "tar: .rpm unpack failed."   tar --no-same-owner -xvzf ${SRCFILE/.rpm/.tar.gz} || die "tar: .rpm unpack failed."
467   [[ -f ${BUILDDIR}/${SRCFILE/.rpm/.tar.gz/} ]] && rm ${BUILDDIR}/${SRCFILE/.rpm/.tar.gz/}   if [[ -f ${DEST}/${SRCFILE/.rpm/.tar.gz} ]]
468     then
469     rm ${DEST}/${SRCFILE/.rpm/.tar.gz}
470     fi
471   ;;   ;;
472   *)   *)
473   die "munpack failed"   die "munpack failed"
# Line 647  EOF Line 659  EOF
659  # special tags:  # special tags:
660  #   PKGTYPE               type of pkg  #   PKGTYPE               type of pkg
661  #   INHERITS              which functions get included  #   INHERITS              which functions get included
662  #   SPECIAL_FUNCTIONS     special functions wich should also be added  #   SPECIAL_FUNCTIONS     special functions which should also be added
663  #                         warning: they get killed before the build starts !  #                         warning: they get killed before the build starts !
664  #  #
665  #   MAGE_TREE_DEST        target destination of the generated tree  #   MAGE_TREE_DEST        target destination of the generated tree
# Line 683  build_mage_script() Line 695  build_mage_script()
695   > ${dest}   > ${dest}
696    
697   # header   # header
698   echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.60 2007-11-05 17:08:33 niro Exp $' >> ${dest}   echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.62 2007-11-28 10:47:50 niro Exp $' >> ${dest}
699   echo  >> ${dest}   echo  >> ${dest}
700    
701   # pgkname and state   # pgkname and state
# Line 933  source_pkg_build() Line 945  source_pkg_build()
945   echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}"   echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}"
946  }  }
947    
948    step_by_step()
949    {
950     if [[ ${STEP_BY_STEP} = true ]]
951     then
952     echo "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"
953     echo "Press [enter] to continue"
954     read
955     fi
956    }
957    
958    
959  # print out our version  # print out our version
960  showversion  showversion
# Line 1199  then Line 1221  then
1221   mage rmstamp   mage rmstamp
1222  fi  fi
1223    
1224  src_prepare || die "src_prepare failed"  # setup build loggins
1225  src_compile || die "src_compile failed"  [[ ! -d /var/log/smage ]] && install -d /var/log/smage
1226  src_install || die "src_install failed"  echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log
1227    
1228    src_prepare || die "src_prepare failed" | ${SMAGE_LOG_CMD}
1229    step_by_step $_
1230    src_compile || die "src_compile failed" | ${SMAGE_LOG_CMD}
1231    step_by_step $_
1232    src_install || die "src_install failed" | ${SMAGE_LOG_CMD}
1233    step_by_step $_
1234    
1235    
1236  # compressing doc, info & man files  # compressing doc, info & man files
# Line 1282  case ${NOPKGBUILD} in Line 1311  case ${NOPKGBUILD} in
1311   ;;   ;;
1312  esac  esac
1313    
1314    if [[ ${SMAGE_BUILD_LOGGING} != false ]]
1315    then
1316     bzip2 -9f /var/log/smage/${PKGNAME}.log
1317    else
1318     [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log
1319    fi
1320    
1321  # for sure  # for sure
1322  unset NOPKGBUILD  unset NOPKGBUILD
1323  unset NOSTRIP  unset NOSTRIP

Legend:
Removed from v.600  
changed lines
  Added in v.881