Magellan Linux

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

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

revision 1583 by niro, Wed Dec 28 12:04:33 2011 UTC revision 1584 by niro, Wed Dec 28 12:23:50 2011 UTC
# Line 421  minstalldocs() Line 421  minstalldocs()
421   do   do
422   if [ -f ${doc} ]   if [ -f ${doc} ]
423   then   then
424   if [[ ${SMAGE_COMPRESSDOC} = true ]]   if mqueryfeature "compressdoc"
425   then   then
426   cat ${doc} | gzip -9c > ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/${doc}.gz || die "gzipping +installing ${doc}."   cat ${doc} | gzip -9c > ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/${doc}.gz || die "gzipping +installing ${doc}."
427   chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/${doc}.gz || die "fixing permissions of ${doc}."   chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/${doc}.gz || die "fixing permissions of ${doc}."
# Line 544  setup_ccache_environment() Line 544  setup_ccache_environment()
544   fi   fi
545  }  }
546    
   
547  # fixes given dependencies to match a MAGE_TARGET  # fixes given dependencies to match a MAGE_TARGET
548  # fix_mage_deps -target s/depend # <-- note -target !  # fix_mage_deps -target s/depend # <-- note -target !
549  fix_mage_deps()  fix_mage_deps()
# Line 731  regen_mage_tree() Line 730  regen_mage_tree()
730   local subpackage   local subpackage
731    
732   # build them only if requested   # build them only if requested
733   if [[ ${REGEN_MAGE_TREE} = true ]]   if mqueryfeature regentree
734   then   then
735   # run it without targets   # run it without targets
736   if [[ -n ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
# Line 820  split_save_variables() Line 819  split_save_variables()
819   export SAVED_DEPEND="${DEPEND}"   export SAVED_DEPEND="${DEPEND}"
820   export SAVED_SDEPEND="${SDEPEND}"   export SAVED_SDEPEND="${SDEPEND}"
821   export SAVED_PROVIDE="${PROVIDE}"   export SAVED_PROVIDE="${PROVIDE}"
  export SAVED_NOPKGBUILD="${NOPKGBUILD}"  
822   export SAVED_PKGTYPE="${PKGTYPE}"   export SAVED_PKGTYPE="${PKGTYPE}"
823    
824     # special handling needed for mage features
825     # pkgbuild
826     mqueryfeature "pkgbuild" && export SAVED_FEATURE_PKGBUILD="pkgbuild"
827     mqueryfeature "!pkgbuild" && export SAVED_FEATURE_PKGBUILD="!pkgbuild"
828     # strip
829     mqueryfeature "strip" && export SAVED_FEATURE_STRIP="strip"
830     mqueryfeature "!strip" && export SAVED_FEATURE_STRIP="!strip"
831     # libtool
832     mqueryfeature "libtool" && export SAVED_FEATURE_LIBTOOL="libtool"
833     mqueryfeature "!libtool" && export SAVED_FEATURE_LIBTOOL="!libtool"
834     # compressdoc
835     mqueryfeature "compressdoc" && export SAVED_FEATURE_COMPRESSDOC="compressdoc"
836     mqueryfeature "!compressdoc" && export SAVED_FEATURE_COMPRESSDOC="!compressdoc"
837    
838   # bindir too   # bindir too
839   export SAVED_BINDIR="${BINDIR}"   export SAVED_BINDIR="${BINDIR}"
840    
# Line 882  split_restore_variables() Line 894  split_restore_variables()
894   export DEPEND="${SAVED_DEPEND}"   export DEPEND="${SAVED_DEPEND}"
895   export SDEPEND="${SAVED_SDEPEND}"   export SDEPEND="${SAVED_SDEPEND}"
896   export PROVIDE="${SAVED_PROVIDE}"   export PROVIDE="${SAVED_PROVIDE}"
  export NOPKGBUILD="${SAVED_NOPKGBUILD}"  
897   export PKGTYPE="${SAVED_PKGTYPE}"   export PKGTYPE="${SAVED_PKGTYPE}"
898    
899     # special handling needed for mage features
900     # pkgbuild
901     msetfeature "${SAVED_FEATURE_PKGBUILD}"
902     # strip
903     msetfeature "${SAVED_FEATURE_STRIP}"
904     # libtool
905     msetfeature "${SAVED_FEATURE_LIBTOOL}"
906     # compressdoc
907     msetfeature "${SAVED_FEATURE_COMPRESSDOC}"
908    
909   # bindir too   # bindir too
910   export BINDIR="${SAVED_BINDIR}"   export BINDIR="${SAVED_BINDIR}"
911    
# Line 943  split_unset_variables() Line 964  split_unset_variables()
964   unset SAVED_SDEPEND   unset SAVED_SDEPEND
965   unset SAVED_PROVIDE   unset SAVED_PROVIDE
966   unset SAVED_BINDIR   unset SAVED_BINDIR
  unset SAVED_NOPKGBUILD  
967   unset SAVED_PKGTYPE   unset SAVED_PKGTYPE
968     unset SAVED_FEATURE_PKGBUILD
969     unset SAVED_FEATURE_STRIP
970     unset SAVED_FEATURE_LIBTOOL
971     unset SAVED_FEATURE_COMPRESSDOC
972   unset SPLIT_PACKAGE_BASE   unset SPLIT_PACKAGE_BASE
973   unset -f SAVED_preinstall   unset -f SAVED_preinstall
974   unset -f SAVED_postinstall   unset -f SAVED_postinstall
# Line 1044  generate_package_md5sum() Line 1068  generate_package_md5sum()
1068   # fix target as it may be empty !   # fix target as it may be empty !
1069   [ -n "${target}" ] && target="-${target}"   [ -n "${target}" ] && target="-${target}"
1070    
   
1071   # build pkgname   # build pkgname
1072   pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"   pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"
1073    
1074   # build pkg-md5-sum only if requested   # build pkg-md5-sum only if requested
1075   if [[ ${REGEN_MAGE_TREE} = true ]]   if mqueryfeature regentree
1076   then   then
1077   echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}"   echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}"
1078    
# Line 1104  source_pkg_build() Line 1127  source_pkg_build()
1127    
1128  step_by_step()  step_by_step()
1129  {  {
1130   if [[ ${STEP_BY_STEP} = true ]]   if mqueryfeature stepbystep
1131   then   then
1132   echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"   echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"
1133   echo "Press [enter] to continue"   echo "Press [enter] to continue"
# Line 1124  then Line 1147  then
1147   exit 1   exit 1
1148  fi  fi
1149    
1150    # load supported mage features
1151    load_mage_features
1152    
1153  # updating smage2-scripts  # updating smage2-scripts
1154  if [[ $1 = update ]]  if [[ $1 = update ]]
1155  then  then
# Line 1308  fi Line 1334  fi
1334  if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ]  if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ]
1335  then  then
1336   SRCPKGTARBALL="${2}"   SRCPKGTARBALL="${2}"
1337   USE_SRC_PKG_TARBALL=true   msetfeature "srcpkgtarball"
1338    
1339   # abort if given file is not a source pkg   # abort if given file is not a source pkg
1340   [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file."   [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file."
# Line 1352  echo -e "${COLGREEN}Compiling ${PKGNAME} Line 1378  echo -e "${COLGREEN}Compiling ${PKGNAME}
1378  # auto regen mage tree if requested  # auto regen mage tree if requested
1379  regen_mage_tree  regen_mage_tree
1380    
1381  if [[ ${CREATE_SRC_PKG_TARBALL} = true ]]  if mqueryfeature "srcpkg"
1382  then  then
1383   if [[ -d ${SOURCEDIR}/${PNAME} ]]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
1384   then   then
# Line 1362  then Line 1388  then
1388  fi  fi
1389    
1390  # download sources  # download sources
1391  [[ ${USE_SRC_PKG_TARBALL} != true ]] && download_sources  mqueryfeature "srcpkgtarball" || download_sources
1392    
1393  # fixes some issues with these functions  # fixes some issues with these functions
1394  export -f src_prepare || die "src_prepare export failed"  export -f src_prepare || die "src_prepare export failed"
# Line 1377  export CXXFLAGS="${CFLAGS}" || die "CXXF Line 1403  export CXXFLAGS="${CFLAGS}" || die "CXXF
1403  export BINDIR="${BINDIR}" || die "BINDIR export failed"  export BINDIR="${BINDIR}" || die "BINDIR export failed"
1404  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"
1405    
   
1406  # setup distcc  # setup distcc
1407  # setup for distcc goes *before* ccache, so ccache comes before distcc in path  # setup for distcc goes *before* ccache, so ccache comes before distcc in path
1408  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment  mqueryfeature "distcc" && setup_distcc_environment
1409    
1410  # setup ccache  # setup ccache
1411  [[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment  mqueryfeature "ccache" && setup_ccache_environment
1412    
1413  # clean up builddir if a previously one exist  # clean up builddir if a previously one exist
1414  if [ -d ${BUILDDIR} ]  if [ -d ${BUILDDIR} ]
# Line 1424  die_pipestatus 0 "src_compile failed" Line 1449  die_pipestatus 0 "src_compile failed"
1449  step_by_step $_  step_by_step $_
1450    
1451  # only run checks if requested  # only run checks if requested
1452  if [[ ${MAGE_CHECK} != true ]]  if mqueryfeature "!check"
1453  then  then
1454   echo "MAGE_CHECK not requested; src_check() will not be run!" | ${SMAGE_LOG_CMD}   echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD}
1455   step_by_step src_check   step_by_step src_check
1456  else  else
1457   src_check | ${SMAGE_LOG_CMD}   src_check | ${SMAGE_LOG_CMD}
# Line 1471  else Line 1496  else
1496   step_by_step $_   step_by_step $_
1497  fi  fi
1498    
1499  # compressing doc, info & man files  if mqueryfeature "!compressdoc"
 if [[ -n ${SPLIT_PACKAGES} ]]  
1500  then  then
1501   for subpackage in ${SPLIT_PACKAGES}   echo -e "!compressdoc detected; documentation will not be compressed ..."
  do  
  mcompressdocs ${BINDIR}_${subpackage}  
  done  
1502  else  else
1503   mcompressdocs ${BINDIR}   # compressing doc, info & man files
1504     if [[ -n ${SPLIT_PACKAGES} ]]
1505     then
1506     for subpackage in ${SPLIT_PACKAGES}
1507     do
1508     mcompressdocs ${BINDIR}_${subpackage}
1509     done
1510     else
1511     mcompressdocs ${BINDIR}
1512     fi
1513  fi  fi
1514    
1515  if [[ ${SMAGE_STRIP_LIBTOOL} = true ]]  if mqueryfeature "!libtool"
1516  then  then
1517   if [[ -n ${SPLIT_PACKAGES} ]]   if [[ -n ${SPLIT_PACKAGES} ]]
1518   then   then
# Line 1497  then Line 1527  then
1527   fi   fi
1528  fi  fi
1529    
1530  if [[ ${SMAGE_PURGE} = true ]]  if mqueryfeature "purge"
1531  then  then
1532   if [[ -n ${SPLIT_PACKAGES} ]]   if [[ -n ${SPLIT_PACKAGES} ]]
1533   then   then
# Line 1513  then Line 1543  then
1543  fi  fi
1544    
1545  # stripping all bins and libs  # stripping all bins and libs
1546  case ${NOSTRIP} in  if mqueryfeature "!strip"
1547   true|TRUE|yes|y)  then
1548   echo -e "NOSTRIP=true detected; Package will not be stripped ..."   echo -e "!strip detected; Package will not be stripped ..."
1549   ;;  else
  *)  
1550   if [[ -n ${SPLIT_PACKAGES} ]]   if [[ -n ${SPLIT_PACKAGES} ]]
1551   then   then
1552   for subpackage in ${SPLIT_PACKAGES}   for subpackage in ${SPLIT_PACKAGES}
# Line 1537  case ${NOSTRIP} in Line 1566  case ${NOSTRIP} in
1566   echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}"
1567   mstripstatic ${BINDIR}   mstripstatic ${BINDIR}
1568   fi   fi
1569   ;;  fi
 esac  
1570    
1571  # the new buildpkg command  if mqueryfeature "!buildpkg"
1572  case ${NOPKGBUILD} in  then
1573   true|TRUE|yes|y)   echo -e "!buildpkg detected; Package will not be build ..."
1574   echo -e "NOPGKBUILD=true detected; Package will not be build ..."  else
  ;;  
  *)  
1575   # build several targets   # build several targets
1576   if [[ -n ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
1577   then   then
# Line 1584  case ${NOPKGBUILD} in Line 1610  case ${NOPKGBUILD} in
1610   export PNAME="${subpackage}"   export PNAME="${subpackage}"
1611   split_info_${PNAME}   split_info_${PNAME}
1612    
1613   # jump to next one if NOPKGBUILD is set in split_info   # jump to next one if !buildpkg is set in split_info
1614   case ${NOPKGBUILD} in   mqueryfeature "!buildpkg" && continue
  true|TRUE|yes|y) continue ;;  
  esac  
1615    
1616   # check if an special subpackage_pkgbuild exists   # check if an special subpackage_pkgbuild exists
1617   if typeset -f ${PNAME}_pkgbuild > /dev/null   if typeset -f ${PNAME}_pkgbuild > /dev/null
# Line 1631  case ${NOPKGBUILD} in Line 1655  case ${NOPKGBUILD} in
1655   fi   fi
1656    
1657   # build src-pkg-tarball if requested   # build src-pkg-tarball if requested
1658   [[ ${CREATE_SRC_PKG_TARBALL} = true ]] && source_pkg_build ${SMAGENAME}   mqueryfeature "srcpkg" && source_pkg_build ${SMAGENAME}
1659   ;;  fi
 esac  
1660    
1661  if [[ ${SMAGE_BUILD_LOGGING} != false ]]  if mqueryfeature "buildlog"
1662  then  then
1663   bzip2 -9f /var/log/smage/${PKGNAME}.log   bzip2 -9f /var/log/smage/${PKGNAME}.log
1664  else  else
1665   [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log   [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log
1666  fi  fi
1667    
 # for sure  
 unset NOPKGBUILD  
 unset NOSTRIP  
   
1668  xtitleclean  xtitleclean

Legend:
Removed from v.1583  
changed lines
  Added in v.1584