Magellan Linux

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

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

revision 1617 by niro, Mon Jan 9 20:13:34 2012 UTC revision 1635 by niro, Fri Jan 13 13:26:43 2012 UTC
# Line 177  download_sources() Line 177  download_sources()
177   fi   fi
178    
179   echo -e "${COLBLUE}==>${COLGREEN} fetching ${uri}${COLDEFAULT}"   echo -e "${COLBLUE}==>${COLGREEN} fetching ${uri}${COLDEFAULT}"
180     # always use verbose mode for source downloads
181     FVERBOSE=off msetfeature "verbose"
182   # do not die here, mchecksum catches download errors   # do not die here, mchecksum catches download errors
183   mdownload --uri "${uri}" --dir "${outputdir}"   mdownload --uri "${uri}" --dir "${outputdir}"
184    
# Line 240  mconfigure() Line 242  mconfigure()
242   local myopts   local myopts
243   if [[ ! -z ${CTARGET} ]]   if [[ ! -z ${CTARGET} ]]
244   then   then
245   myopts="--target=${CTARGET}"   myopts+=" --target=${CTARGET}"
246   fi   fi
247    
248   if [ -x ./configure ]   if [ -x ./configure ]
249   then   then
250     # if requested disable-static
251     if [[ ! -z $(./configure --help | grep -- '--.*able-static') ]]
252     then
253     if mqueryfeature '!static'
254     then
255     myopts+=" --disable-static"
256     else
257     myopts+=" --enable-static"
258     fi
259     fi
260    
261     # always enable shared by default
262     if [[ ! -z $(./configure --help | grep -- '--.*able-shared') ]]
263     then
264     myopts+=" --enable-shared"
265     fi
266    
267   ./configure \   ./configure \
268   --prefix=/usr \   --prefix=/usr \
269   --host=${CHOST} \   --host=${CHOST} \
# Line 434  minstalldocs() Line 453  minstalldocs()
453   cat ${doc} | gzip -9c > ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "gzipping +installing ${doc}."   cat ${doc} | gzip -9c > ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "gzipping +installing ${doc}."
454   chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "fixing permissions of ${doc}."   chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "fixing permissions of ${doc}."
455   else   else
456   install -m 0644 ${SRCDIR}/${i} ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "installing ${doc}."   install -m 0644 ${doc} ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "installing ${doc}."
457   fi   fi
458   fi   fi
459   done   done
# Line 446  mstriplibs() Line 465  mstriplibs()
465    
466   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
467   [[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug"   [[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug"
468   find ${stripdir} ! -type d | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null   find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null
469  }  }
470    
471  mstripbins()  mstripbins()
# Line 455  mstripbins() Line 474  mstripbins()
474    
475   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
476   [[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug"   [[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug"
477   find ${stripdir} ! -type d | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null   find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null
478  }  }
479    
480  mstripstatic()  mstripstatic()
# Line 464  mstripstatic() Line 483  mstripstatic()
483    
484   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
485   [[ -z ${STRIP_STATIC_LIB} ]] && STRIP_STATIC_LIB="--strip-debug"   [[ -z ${STRIP_STATIC_LIB} ]] && STRIP_STATIC_LIB="--strip-debug"
486   find ${stripdir} ! -type d | xargs file | grep "ar archive" | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_STATIC_LIB} 2> /dev/null   find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "ar archive" | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_STATIC_LIB} 2> /dev/null
487  }  }
488    
489  mstriplibtoolarchive()  mstriplibtoolarchive()
# Line 472  mstriplibtoolarchive() Line 491  mstriplibtoolarchive()
491   local stripdir="$@"   local stripdir="$@"
492    
493   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
494   find ${stripdir} ! -type d -name \*.la | xargs | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null   find ${stripdir} ! -type d -name \*.la | xargs --no-run-if-empty file | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null
495  }  }
496    
497  mpurgetargets()  mpurgetargets()
# Line 1146  step_by_step() Line 1165  step_by_step()
1165  resume_stamp()  resume_stamp()
1166  {  {
1167   local step="$1"   local step="$1"
1168   touch ${BUILDDIR}/.smage-${PKGNAME}-${step}   [[ ! -d ${BUILDDIR}/.stamps ]] && install -d ${BUILDDIR}/.stamps
1169     touch ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step}
1170  }  }
1171    
1172  run_resume()  run_resume()
1173  {  {
1174   local step="$1"   local step="$1"
1175    
1176   if mqueryfeature "resume" && [[ -f ${BUILDDIR}/.smage-${PKGNAME}-${step} ]]   if mqueryfeature "resume" && [[ -f ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step} ]]
1177   then   then
1178   echo -e "${COLMAGENTA}${step} already processed; doing nothing${COLDEFAULT}"   echo -e "${COLMAGENTA}${step} already processed; doing nothing${COLDEFAULT}"
1179   return 0   return 0
# Line 1409  echo -e "${COLGREEN}Compiling ${PKGNAME} Line 1429  echo -e "${COLGREEN}Compiling ${PKGNAME}
1429  # auto regen mage tree if requested  # auto regen mage tree if requested
1430  regen_mage_tree  regen_mage_tree
1431    
1432  if mqueryfeature "srcpkg"  if mqueryfeature "srcpkgbuild"
1433  then  then
1434   if [[ -d ${SOURCEDIR}/${PNAME} ]]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
1435   then   then
# Line 1486  else Line 1506  else
1506   rm -rf ${BUILDDIR}/${PKGNAME}   rm -rf ${BUILDDIR}/${PKGNAME}
1507   fi   fi
1508    
1509     # clean up stamps dir
1510     if [ -d ${BUILDDIR}/.stamps ]
1511     then
1512     rm -rf ${BUILDDIR}/.stamps
1513     fi
1514    
1515   # setup build logging   # setup build logging
1516   [[ ! -d /var/log/smage ]] && install -d /var/log/smage   [[ ! -d /var/log/smage ]] && install -d /var/log/smage
1517   echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log   echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log
# Line 1756  else Line 1782  else
1782   fi   fi
1783    
1784   # build src-pkg-tarball if requested   # build src-pkg-tarball if requested
1785   if mqueryfeature "srcpkg"   if mqueryfeature "srcpkgbuild"
1786   then   then
1787   resume_stamp srcpkgbuild || source_pkg_build ${SMAGENAME}   run_resume srcpkgbuild || source_pkg_build ${SMAGENAME}
1788   resume_stamp srcpkgbuild   resume_stamp srcpkgbuild
1789   fi   fi
1790  fi  fi

Legend:
Removed from v.1617  
changed lines
  Added in v.1635