Magellan Linux

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

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

revision 63 by niro, Wed Feb 16 01:00:39 2005 UTC revision 199 by niro, Sun Aug 21 21:23:48 2005 UTC
# Line 4  Line 4 
4  # needs pkgbuild_dir (mage)  # needs pkgbuild_dir (mage)
5    
6  # SMAGE2  # SMAGE2
7  # version: 0.3.6-r14  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.30 2005-08-21 21:23:48 niro Exp $
8    
9  #01.10.2004  #01.10.2004
10  # added ccache support  # added ccache support
11  # added distcc support  # added distcc support
12    
13  ## setup ##  ## setup ##
 SMAGEVERSION=0.3.6-r14  
14  PKGSUFFIX="mpk"  PKGSUFFIX="mpk"
15  SMAGENAME="$1"  SMAGENAME="$1"
16  SMAGESUFFIX="smage2"  SMAGESUFFIX="smage2"
# Line 19  SMAGESUFFIX="smage2" Line 18  SMAGESUFFIX="smage2"
18  #SMAGESCRIPTSDIR="/bootstrap/smage2-install-scripts"  #SMAGESCRIPTSDIR="/bootstrap/smage2-install-scripts"
19  #SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts"  #SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts"
20  MLIBDIR=/usr/lib/mage  MLIBDIR=/usr/lib/mage
21    SMAGEVERSION="$( < ${MLIBDIR}/version)"
22    
23    # export default C locale
24    export LC_ALL=C
25    
26  source /etc/mage.rc  source /etc/mage.rc
27    
# Line 103  download_sources() { Line 106  download_sources() {
106   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0
107    
108   local EOA=${#SRC_URI[*]}   local EOA=${#SRC_URI[*]}
109   local MY_SRC_URI   local my_SRC_URI
110     local my_SRC_URI_DEST
111     local my_SRC_URI_MIRROR
112     local my_SOURCEDIR
113   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"
114   local FETCHING   local FETCHING
115   local i mirror   local i mirror
# Line 113  download_sources() { Line 119  download_sources() {
119   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}
120    
121   # check if FETCHING is needed   # check if FETCHING is needed
122   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} > /dev/null )   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )
123   if [[ $? == 0 ]]   if [[ $? == 0 ]]
124   then   then
125   # md5's ok, not fetching needed   # md5's ok, not fetching needed
# Line 124  download_sources() { Line 130  download_sources() {
130    
131   for ((i=0; i < EOA; i++))   for ((i=0; i < EOA; i++))
132   do   do
133   # get MD5 sum from database   # url to file
134     my_SRC_URI="$(echo ${SRC_URI[${i}]} | cut -d' ' -f1)"
135    
136     # subdir in sources dir; the my_SRCI_URI file goes to there
137     my_SRC_URI_DEST="$(echo ${SRC_URI[${i}]} | cut -d' ' -f2)"
138    
139     # if my_src_uri_dest is not equal my_src_uri; than an other dir is used
140     if [[ ${my_SRC_URI_DEST} != ${my_SRC_URI} ]]
141     then
142     my_SOURCEDIR="${SOURCEDIR}/${PNAME}/${my_SRC_URI_DEST}"
143     else
144     my_SOURCEDIR="${SOURCEDIR}/${PNAME}"
145     fi
146    
   
147   # if an mirrored file than replace first the mirror uri   # if an mirrored file than replace first the mirror uri
148   if [ -n "$(echo ${SRC_URI[${i}]} | grep 'mirror://')" ]   if [ -n "$(echo ${my_SRC_URI} | grep 'mirror://')" ]
149   then   then
150   for mirror in ${MIRRORS}   for mirror in ${MIRRORS}
151   do   do
152   MY_SRC_URI="$(echo ${SRC_URI[${i}]} | sed "s|mirror:/|${mirror}/sources|g")"   my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|mirror:/|${mirror}/sources|g")"
153    
154   #echo "DEBUG: ${MY_SRC_URI}"   #echo "DEBUG: ${MY_SRC_URI}"
155   if [[ ${FETCHING} == true ]]   if [[ ${FETCHING} == true ]]
156   then   then
157   echo "==> fetching ${MY_SRC_URI}"   echo "==> fetching ${my_SRC_URI_MIRROR}"
158   wget \   wget \
159   --passive-ftp \   --passive-ftp \
160   --tries 3 \   --tries 3 \
161   --continue \   --continue \
162   --progress bar \   --progress bar \
163   --directory-prefix="${SOURCEDIR}/${PNAME}" \   --directory-prefix="${my_SOURCEDIR}" \
164   "${MY_SRC_URI}"   "${my_SRC_URI_MIRROR}"
165   if [ "$?" == "0" ]   if [ "$?" == "0" ]
166   then   then
167   break   break
# Line 157  download_sources() { Line 174  download_sources() {
174   #echo "DEBUG: ${SRC_URI[${i}]}"   #echo "DEBUG: ${SRC_URI[${i}]}"
175   if [[ ${FETCHING} == true ]]   if [[ ${FETCHING} == true ]]
176   then   then
177   echo "==> fetching ${SRC_URI[${i}]}"   echo "==> fetching ${my_SRC_URI}"
178   wget \   wget \
179   --passive-ftp \   --passive-ftp \
180   --tries 3 \   --tries 3 \
181   --continue \   --continue \
182   --progress bar \   --progress bar \
183   --directory-prefix="${SOURCEDIR}/${PNAME}" \   --directory-prefix="${my_SOURCEDIR}" \
184   "${MY_SRC_URI}"   "${my_SRC_URI}"
185   if [ "$?" == "0" ]  # only needed to run through a list of mirrors
186   then  # if [ "$?" == "0" ]
187   break  # then
188   else  # break
189   continue  # else
190   fi  # continue
191    # fi
192   fi   fi
193   fi   fi
194    
195     # unset them to be shure
196     unset my_SRC_URI
197     unset my_SRC_URI_DEST
198     unset my_SRC_URI_MIRROR
199     unset my_SOURCEDIR
200   done   done
201    
202   # recheck md5 sums   # recheck md5 sums
# Line 207  src_install() { Line 230  src_install() {
230   return 0   return 0
231  }  }
232    
   
 build_mage_script() {  
  return 0  
 }  
   
233  mconfigure() {  mconfigure() {
234   if [ -x ./configure ]   if [ -x ./configure ]
235   then   then
# Line 320  minstalldocs() { Line 338  minstalldocs() {
338   done   done
339  }  }
340    
341    mstriplibs() {
342     local stripdir="$@"
343    
344     [ -z "${stripdir}" ] && stripdir=${BINDIR}
345     find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
346    }
347    
348    mstripbins() {
349     local stripdir="$@"
350    
351     [ -z "${stripdir}" ] && stripdir=${BINDIR}
352     find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
353    }
354    
355    sminclude() {
356     local i
357    
358     if [[ -n "$@" ]]
359     then
360     for i in $@
361     do
362     echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc"
363     source ${SMAGESCRIPTSDIR}/include/${i}.sminc
364     done
365     echo
366     fi
367    }
368    
369  setup_distcc_environment(){  setup_distcc_environment(){
370   if [ -x /usr/bin/distcc ]   if [ -x /usr/bin/distcc ]
371   then   then
# Line 360  setup_ccache_environment(){ Line 406  setup_ccache_environment(){
406   fi   fi
407  }  }
408    
409    
410    # fixes given dependencies to match a MAGE_TARGET
411    # fix_mage_deps -target s/depend # <-- note -target !
412    fix_mage_deps() {
413     local target="$1"
414     local depend="$2"
415     local NDEPEND
416     local sym dep cat pver pname
417    
418     # deps and provides are special
419     # they must be fixed to match the target
420    
421     # run this only if target and depend is not empty
422     if [ -n "${target}" ] && [ -n "${depend}" ]
423     then
424     # fix DEPEND
425     while read sym dep
426     do
427     cat="$(dirname ${dep})"
428     # change if not virtual
429     if [[ ${cat} != virtual ]]
430     then
431     # fix pver to target-pver
432     # to get pname-target-pver
433    
434     # doing it backwards !
435     pver="${dep##*-}"
436     pname=$(basename ${dep/-${pver}/})
437     fi
438    
439     # do not add empty lines
440     if [ -z "${NDEPEND}" ]
441     then
442     NDEPEND="${sym} ${cat}/${pname}${target}-${pver}"
443     else
444     NDEPEND="${NDEPEND}
445     ${sym} ${cat}/${pname}${target}-${pver}"
446     fi
447    
448     unset cat pname pver
449     done << EOF
450    ${depend}
451    EOF
452     # set NDEPEND to DEPEND
453     depend="${NDEPEND}"
454     fi
455    
456     echo "${depend}"
457    }
458    
459    # build_mage_script(): helper functions for regen_mage_tree()
460    # generates an mage file with given information in smage file
461    # needs at least:
462    #   PNAME                 name of pkg
463    #   PVER                  version
464    #   PBUILD                revision
465    #   PCATEGORIE            categorie of the pkg
466    #   STATE                 state of pkg stable|unstable|old
467    #   DESCRIPTION           va short description (opt)
468    #   HOMEPAGE              homepage (opt)
469    #   DEPEND                runtime dependencies (opt)
470    #   SDEPEND               add. needed deps to build the pkg (opt)
471    #   PROVIDE               provides a virtual (opt)
472    #
473    # special tags:
474    #   PKGTYPE               type of pkg
475    #   INHERITS              which functions get included
476    #   SPECIAL_FUNCTIONS     special functions wich should also be added
477    #                         warning: they get killed before the build starts !
478    #
479    #   MAGE_TREE_DEST        target destination of the generated tree
480    #   REGEN_MAGE_TREE       set to 'true' to enable this
481    #
482    # gets called with build_mage_script target
483    build_mage_script()
484    {
485     local magefile
486     local dest
487     local target
488     local sym
489     local depname
490    
491     # if MAGE_TREE_DEST not set use BUILDDIR
492     : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}
493    
494     # determinate which suffix this mage file should get, if any
495     [ -n "$1" ] && target="-$1"
496    
497     # name of magefile
498     magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage"
499    
500     # destination to magefile
501     dest="${MAGE_TREE_DEST}/${PCATEGORIE}/${PNAME}${target}/${magefile}"
502    
503     # show what we are doing
504     echo "Generating Mage file:"
505     echo "  ${dest}"
506    
507     install -d "$(dirname ${dest})"
508     # now build the mage file
509     > ${dest}
510    
511     # header
512     echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.30 2005-08-21 21:23:48 niro Exp $' >> ${dest}
513     echo  >> ${dest}
514    
515     # pgkname and state
516     echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest}
517     echo "STATE=\"${STATE}\"" >> ${dest}
518     echo >> ${dest}
519    
520     # description and homepage
521     echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest}
522     echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}
523     echo >> ${dest}
524    
525     # special tags and vars
526     echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}
527     # add special vars
528     if [ -n "${SPECIAL_VARS}" ]
529     then
530     local i
531     for i in ${SPECIAL_VARS}
532     do
533     # being tricky here :)
534     echo "${i}=\"$(eval echo \$${i})\"" >> ${dest}
535     done
536     echo  >> ${dest}
537     fi
538     # add at least all includes
539     if [ -n "${INHERITS}" ]
540     then
541     echo -n "minclude"  >> ${dest}
542     local i
543     for i in ${INHERITS}
544     do
545     echo -n " ${i}"  >> ${dest}
546     done
547     echo  >> ${dest}
548     fi
549     echo >> ${dest}
550    
551     # deps and provides
552     echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest}
553     echo >> ${dest}
554     echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest}
555     echo >> ${dest}
556     echo "PROVIDE=\"${PROVIDE}\"" >> ${dest}
557     echo >> ${dest}
558    
559     # add special functions
560     if [ -n "${SPECIAL_FUNCTIONS}" ]
561     then
562     local i
563     for i in ${SPECIAL_FUNCTIONS}
564     do
565     # add to mage (quotes needed !)
566     typeset -f "${i}" >> ${dest}
567     # unset to be safe (quotes needed !)
568     #unset "${i}" <-- later to get every target built
569     done
570     echo  >> ${dest}
571     fi
572    
573     # pre|post-install|removes
574     typeset -f preinstall >> ${dest}
575     echo  >> ${dest}
576     typeset -f postinstall >> ${dest}
577     echo  >> ${dest}
578     typeset -f preremove >> ${dest}
579     echo  >> ${dest}
580     typeset -f postremove >> ${dest}
581     echo  >> ${dest}
582    }
583    
584    regen_mage_tree()
585    {
586     local i
587    
588     # build them only if requested
589     if [[ ${REGEN_MAGE_TREE} = true ]]
590     then
591     # run it without targets
592     if [ -z "${MAGE_TARGETS}" ]
593     then
594     echo
595     build_mage_script
596     echo
597     else
598    
599     # build for each target an mage file
600     # run it with several targets
601     for i in ${MAGE_TARGETS}
602     do
603     echo
604     build_mage_script "${i}"
605     echo
606     done
607     fi
608     fi
609    
610     # now unset all uneeded vars to be safe
611     # unset PKGNAME <-- don't do that; smage needs this var
612     # unset to be safe (quotes needed !)
613     for i in ${SPECIAL_FUNCTIONS}
614     do
615     unset "${i}"
616     done
617     unset SPECIAL_FUNCTIONS
618     for i in ${SPECIAL_VARS}
619     do
620     unset "${i}"
621     done
622     unset SPECIAL_VARS
623     unset STATE
624     unset DESCRIPTION
625     unset HOMEPAGE
626     unset PKGTYPE
627     unset INHERITS
628     unset DEPEND
629     unset SDEPEND
630     unset PROVIDE
631     unset preinstall
632     unset postinstall
633     unset preremove
634     unset postremove
635    }
636    
637  # print out our version  # print out our version
638  showversion  showversion
639  echo  echo
# Line 371  then Line 645  then
645   exit 1   exit 1
646  fi  fi
647    
648  #updating smage2-scripts  # updating smage2-scripts
649  if [ "$1" == "update" ]  if [ "$1" == "update" ]
650  then  then
651   if [ ! -d ${SOURCEDIR} ]   if [ ! -d ${SOURCEDIR} ]
# Line 382  then Line 656  then
656   exit 0   exit 0
657  fi  fi
658    
659  #creates md5sums for smages to given dir  # creates md5sums for smages to given dir
660  if [ "$1" == "calcmd5" ]  if [ "$1" == "calcmd5" ]
661  then  then
662   if [ $# -ge 3 ]   if [ $# -ge 3 ]
663   then   then
  # overridable sourcedir  
  CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}"  
   
664   SMAGENAME="$2"   SMAGENAME="$2"
665   MD5DIR="$3"   MD5DIR="$3"
666   source ${SMAGENAME} || die "download source failed"   source ${SMAGENAME} || die "download source failed"
667    
668     # overridable sourcedir; must be declared after source of the smage2
669     CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}"
670    
671   [ -z "${SRC_URI}" ] && die "Nothing declared to calculate."   [ -z "${SRC_URI}" ] && die "Nothing declared to calculate."
672    
673   # end of array   # end of array
# Line 407  then Line 681  then
681    
682   for ((i=0; i < EOA; i++))   for ((i=0; i < EOA; i++))
683   do   do
684   MY_SRC_FILE="$(basename ${SRC_URI[${i}]})"   # url to file
685     my_SRC_URI="$(echo ${SRC_URI[${i}]} | cut -d' ' -f1)"
686    
687     # subdir in sources dir; the my_SRCI_URI file goes to there
688     my_SRC_URI_DEST="$(echo ${SRC_URI[${i}]} | cut -d' ' -f2)"
689    
690     # if my_src_uri_dest is not equal my_src_uri; than an other dir is used
691     if [[ ${my_SRC_URI_DEST} != ${my_SRC_URI} ]]
692     then
693     MY_SRC_FILE="${my_SRC_URI_DEST}/$(basename ${SRC_URI[${i}]})"
694     else
695     MY_SRC_FILE="$(basename ${SRC_URI[${i}]})"
696     fi
697    
698   if [ -e "${CALC_SOURCEDIR}/${MY_SRC_FILE}" ]   if [ -e "${CALC_SOURCEDIR}/${MY_SRC_FILE}" ]
699   then   then
700   echo "calculating $(basename ${MY_SRC_FILE}) ..."   echo "calculating $(basename ${MY_SRC_FILE}) ..."
# Line 415  then Line 702  then
702   else   else
703   echo "WARNING: File '$(basename ${MY_SRC_FILE}) not found in ${CALC_SOURCEDIR}."   echo "WARNING: File '$(basename ${MY_SRC_FILE}) not found in ${CALC_SOURCEDIR}."
704   fi   fi
705    
706     # unset them to be shure
707     unset my_SRC_URI
708     unset my_SRC_URI_DEST
709     unset my_SRC_URI_MIRROR
710     unset my_SOURCEDIR
711   done   done
712    
713   echo   echo
# Line 433  then Line 726  then
726   exit 0   exit 0
727  fi  fi
728    
729  #download sources  # download sources
730  if [ "$1" == "download" -a -n "$2" ]  if [ "$1" == "download" -a -n "$2" ]
731  then  then
  showversion  
732   if [ ! -d ${SMAGESCRIPTSDIR} ]   if [ ! -d ${SMAGESCRIPTSDIR} ]
733   then   then
734   install -d ${SMAGESCRIPTSDIR}   install -d ${SMAGESCRIPTSDIR}
# Line 505  MD5DIR="$(dirname ${SMAGENAME})/md5" Line 797  MD5DIR="$(dirname ${SMAGENAME})/md5"
797  xtitle "Compiling ${PKGNAME}"  xtitle "Compiling ${PKGNAME}"
798  echo "Compiling ${PKGNAME}"  echo "Compiling ${PKGNAME}"
799    
800  #download sources  # auto regen mage tree if requested
801    regen_mage_tree
802    
803    # download sources
804  download_sources  download_sources
805    
806  #fixes some issues with these functions  # fixes some issues with these functions
807  export -f src_prepare || die "src_prepare export failed"  export -f src_prepare || die "src_prepare export failed"
808  export -f src_compile || die "src_compile export failed"  export -f src_compile || die "src_compile export failed"
809  export -f src_install || die "src_install export failed"  export -f src_install || die "src_install export failed"
810    
811  #fixes some compile issues  # fixes some compile issues
812  export CHOST="${CHOST}" || die "CHOST export failed"  export CHOST="${CHOST}" || die "CHOST export failed"
813  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"
814  export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"  export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"
# Line 521  export BINDIR="${BINDIR}" || die "BINDIR Line 816  export BINDIR="${BINDIR}" || die "BINDIR
816  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"
817    
818    
819  #setup distcc  # setup distcc
820  #distcc mus be setup *before* ccache, as ccache need to be before distcc in path  # distcc mus be setup *before* ccache, as ccache need to be before distcc in path
821  if [ "${SMAGE_USE_DISTCC}" == "true" ]  if [ "${SMAGE_USE_DISTCC}" == "true" ]
822  then  then
823   setup_distcc_environment   setup_distcc_environment
824  fi  fi
825    
826  #setup ccache  # setup ccache
827  if [ "${SMAGE_USE_CCACHE}" == "true" ]  if [ "${SMAGE_USE_CCACHE}" == "true" ]
828  then  then
829   setup_ccache_environment   setup_ccache_environment
# Line 549  sleep 1 Line 844  sleep 1
844  #read  #read
845  #debug end  #debug end
846    
847  #cleans up build if a previously one exists  # cleans up build if a previously one exists
848  if [ -d ${BUILDDIR} ]  if [ -d ${BUILDDIR} ]
849  then  then
850   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."
851  fi  fi
852  install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."  install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."
853    
854  #cleans up srcdir if a previously unpacked one exists  # cleans up srcdir if a previously unpacked one exists
855  if [ -d ${SRCDIR} ]  if [ -d ${SRCDIR} ]
856  then  then
857   rm -rf ${SRCDIR}   rm -rf ${SRCDIR}
858  fi  fi
859    
860  #cleans up bindir if a previous build exists or creates a new one  # cleans up bindir if a previous build exists or creates a new one
861  if [ -d ${BINDIR} ]  if [ -d ${BINDIR} ]
862  then  then
863   rm -rf ${BINDIR}   rm -rf ${BINDIR}
864  fi  fi
865  install -d ${BINDIR} || die "couldn't create \$BINDIR."  install -d ${BINDIR} || die "couldn't create \$BINDIR."
866    
867  #cleans up package temp dir if a previous build exists  # cleans up package temp dir if a previous build exists
868  if [ -d ${BUILDDIR}/${PKGNAME} ]  if [ -d ${BUILDDIR}/${PKGNAME} ]
869  then  then
870   rm -rf ${BUILDDIR}/${PKGNAME}   rm -rf ${BUILDDIR}/${PKGNAME}
871  fi  fi
872    
873  #cleans up timestamp if one exists  # cleans up timestamp if one exists
874  if [ -f /var/tmp/timestamp ]  if [ -f /var/tmp/timestamp ]
875  then  then
876   mage rmstamp   mage rmstamp
# Line 586  src_compile || die "src_compile failed" Line 881  src_compile || die "src_compile failed"
881  src_install || die "src_install failed"  src_install || die "src_install failed"
882    
883    
884  #compressing doc, info & man files  # compressing doc, info & man files
885  echo -e "Compressing man-pages ..."  echo -e "Compressing man-pages ..."
886  if [ -d ${BUILDDIR}/builded/usr/share/man ]  if [ -d ${BUILDDIR}/builded/usr/share/man ]
887  then  then
# Line 599  then Line 894  then
894   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info
895  fi  fi
896    
897  #the new buildpkg command  # stripping all bins and libs
898    case ${NOSTRIP} in
899     true|TRUE|yes|y)
900     echo -e "NOSTRIP=true detected; Package will not be stripped ..."
901     ;;
902     *)
903     echo -e "Stripping binaries ..."
904     mstripbins ${BINDIR}
905     echo -e "Stripping libraries ..."
906     mstriplibs ${BINDIR}
907     ;;
908    esac
909    
910    # the new buildpkg command
911  case ${NOPKGBUILD} in  case ${NOPKGBUILD} in
912   true|TRUE|yes|y)   true|TRUE|yes|y)
913   echo -e "NOPGKBUILD=true detected; Package will not be build ..."   echo -e "NOPGKBUILD=true detected; Package will not be build ..."
914   ;;   ;;
915   *)   *)
916   ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"   # build serveral targets
917   echo -e "\nPackage ${PKGNAME} successfully builded.\n"   if [ -n "${MAGE_TARGETS}" ]
918     then
919     for target in ${MAGE_TARGETS}
920     do
921     # check if an special target_pkgbuild exists
922     if typeset -f ${target}_pkgbuild > /dev/null
923     then
924     # run it
925     ${target}_pkgbuild
926     fi
927     # now create the target package
928     ${MLIBDIR}/pkgbuild_dir.sh \
929     "${PNAME}-${target}-${PVER}-${CHOST%%-*}-${PBUILD}" \
930     ${BINDIR} || die "target: ${target} package-build failed"
931     echo -e "\nPackage ${PNAME}-${target}-${PVER}-${CHOST%%-*}-${PBUILD} successfully builded.\n"
932     done
933     else
934     ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"
935     echo -e "\nPackage ${PKGNAME} successfully builded.\n"
936     fi
937   ;;   ;;
938  esac  esac
939    
940  #for sure  # for sure
941  unset NOPKGBUILD  unset NOPKGBUILD
942    unset NOSTRIP
943    
944  xtitleclean  xtitleclean
945  #echo -e "\nPackage ${PKGNAME} successfully builded.\n"  #echo -e "\nPackage ${PKGNAME} successfully builded.\n"

Legend:
Removed from v.63  
changed lines
  Added in v.199