Magellan Linux

Diff of /branches/mage-next/src/smage2.sh

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

revision 40 by niro, Thu Jan 6 23:28:28 2005 UTC revision 198 by niro, Sun Aug 21 20:35:47 2005 UTC
# Line 4  Line 4 
4  # needs pkgbuild_dir (mage)  # needs pkgbuild_dir (mage)
5    
6  # SMAGE2  # SMAGE2
7  # version: 0.3.6-r10  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.29 2005-08-21 20:35:47 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-r10  
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 84  syncsmage2() { Line 87  syncsmage2() {
87   xtitleclean   xtitleclean
88  }  }
89    
90    # $1 filename
91    get_db_md5_sum() {
92     local DB_FILE
93     local MD5_FILE
94     local i
95    
96     DB_ENTRY="$(basename $1)"
97     MD5_FILE="${MD5DIR}/$(basename ${SMAGENAME} ${SMAGESUFFIX})"
98    
99     i="$(cat ${MD5_FILE}| grep ${DB_ENTRY} | cut -d' ' -f1)"
100    
101     echo "${i}"
102    }
103    
104    download_sources() {
105    
106     [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0
107    
108     local EOA=${#SRC_URI[*]}
109     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"
114     local FETCHING
115     local i mirror
116    
117    
118     #install SRCDIR/PNAME if not exist
119     [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}
120    
121     # check if FETCHING is needed
122     ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )
123     if [[ $? == 0 ]]
124     then
125     # md5's ok, not fetching needed
126     FETCHING=false
127     else
128     FETCHING=true
129     fi
130    
131     for ((i=0; i < EOA; i++))
132     do
133     # 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
148     if [ -n "$(echo ${my_SRC_URI} | grep 'mirror://')" ]
149     then
150     for mirror in ${MIRRORS}
151     do
152     my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|mirror:/|${mirror}/sources|g")"
153    
154     #echo "DEBUG: ${MY_SRC_URI}"
155     if [[ ${FETCHING} == true ]]
156     then
157     echo "==> fetching ${my_SRC_URI_MIRROR}"
158     wget \
159     --passive-ftp \
160     --tries 3 \
161     --continue \
162     --progress bar \
163     --directory-prefix="${my_SOURCEDIR}" \
164     "${my_SRC_URI_MIRROR}"
165     if [ "$?" == "0" ]
166     then
167     break
168     else
169     continue
170     fi
171     fi
172     done
173     else
174     #echo "DEBUG: ${SRC_URI[${i}]}"
175     if [[ ${FETCHING} == true ]]
176     then
177     echo "==> fetching ${my_SRC_URI}"
178     wget \
179     --passive-ftp \
180     --tries 3 \
181     --continue \
182     --progress bar \
183     --directory-prefix="${my_SOURCEDIR}" \
184     "${my_SRC_URI}"
185    # only needed to run through a list of mirrors
186    # if [ "$?" == "0" ]
187    # then
188    # break
189    # else
190    # continue
191    # fi
192     fi
193     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
201    
202     # recheck md5 sums
203     echo
204     echo ">== Checking MD5 sums:"
205     ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} ) || die "md5 failed"
206     echo
207    
208     # not needed anymore
209     unset SRC_URI
210    }
211    
212  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
213  src_prepare() {  src_prepare() {
214   echo "no src_prepare defined"   echo "no src_prepare defined"
# Line 105  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 218  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 258  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     # abort on virtual
429     [[ ${cat} = virtual ]] && continue
430    
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    
438     # do not add empty lines
439     if [ -z "${NDEPEND}" ]
440     then
441     NDEPEND="${sym} ${cat}/${pname}${target}-${pver}"
442     else
443     NDEPEND="${NDEPEND}
444     ${sym} ${cat}/${pname}${target}-${pver}"
445     fi
446    
447     unset cat pname pver
448     done << EOF
449    ${depend}
450    EOF
451     # set NDEPEND to DEPEND
452     depend="${NDEPEND}"
453     fi
454    
455     echo "${depend}"
456    }
457    
458    # build_mage_script(): helper functions for regen_mage_tree()
459    # generates an mage file with given information in smage file
460    # needs at least:
461    #   PNAME                 name of pkg
462    #   PVER                  version
463    #   PBUILD                revision
464    #   PCATEGORIE            categorie of the pkg
465    #   STATE                 state of pkg stable|unstable|old
466    #   DESCRIPTION           va short description (opt)
467    #   HOMEPAGE              homepage (opt)
468    #   DEPEND                runtime dependencies (opt)
469    #   SDEPEND               add. needed deps to build the pkg (opt)
470    #   PROVIDE               provides a virtual (opt)
471    #
472    # special tags:
473    #   PKGTYPE               type of pkg
474    #   INHERITS              which functions get included
475    #   SPECIAL_FUNCTIONS     special functions wich should also be added
476    #                         warning: they get killed before the build starts !
477    #
478    #   MAGE_TREE_DEST        target destination of the generated tree
479    #   REGEN_MAGE_TREE       set to 'true' to enable this
480    #
481    # gets called with build_mage_script target
482    build_mage_script()
483    {
484     local magefile
485     local dest
486     local target
487     local sym
488     local depname
489    
490     # if MAGE_TREE_DEST not set use BUILDDIR
491     : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}
492    
493     # determinate which suffix this mage file should get, if any
494     [ -n "$1" ] && target="-$1"
495    
496     # name of magefile
497     magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage"
498    
499     # destination to magefile
500     dest="${MAGE_TREE_DEST}/${PCATEGORIE}/${PNAME}${target}/${magefile}"
501    
502     # show what we are doing
503     echo "Generating Mage file:"
504     echo "  ${dest}"
505    
506     install -d "$(dirname ${dest})"
507     # now build the mage file
508     > ${dest}
509    
510     # header
511     echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.29 2005-08-21 20:35:47 niro Exp $' >> ${dest}
512     echo  >> ${dest}
513    
514     # pgkname and state
515     echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest}
516     echo "STATE=\"${STATE}\"" >> ${dest}
517     echo >> ${dest}
518    
519     # description and homepage
520     echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest}
521     echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}
522     echo >> ${dest}
523    
524     # special tags and vars
525     echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}
526     # add special vars
527     if [ -n "${SPECIAL_VARS}" ]
528     then
529     local i
530     for i in ${SPECIAL_VARS}
531     do
532     # being tricky here :)
533     echo "${i}=\"$(eval echo \$${i})\"" >> ${dest}
534     done
535     echo  >> ${dest}
536     fi
537     # add at least all includes
538     if [ -n "${INHERITS}" ]
539     then
540     echo -n "minclude"  >> ${dest}
541     local i
542     for i in ${INHERITS}
543     do
544     echo -n " ${i}"  >> ${dest}
545     done
546     echo  >> ${dest}
547     fi
548     echo >> ${dest}
549    
550     # deps and provides
551     echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest}
552     echo >> ${dest}
553     echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest}
554     echo >> ${dest}
555     echo "PROVIDE=\"${PROVIDE}\"" >> ${dest}
556     echo >> ${dest}
557    
558     # add special functions
559     if [ -n "${SPECIAL_FUNCTIONS}" ]
560     then
561     local i
562     for i in ${SPECIAL_FUNCTIONS}
563     do
564     # add to mage (quotes needed !)
565     typeset -f "${i}" >> ${dest}
566     # unset to be safe (quotes needed !)
567     #unset "${i}" <-- later to get every target built
568     done
569     echo  >> ${dest}
570     fi
571    
572     # pre|post-install|removes
573     typeset -f preinstall >> ${dest}
574     echo  >> ${dest}
575     typeset -f postinstall >> ${dest}
576     echo  >> ${dest}
577     typeset -f preremove >> ${dest}
578     echo  >> ${dest}
579     typeset -f postremove >> ${dest}
580     echo  >> ${dest}
581    }
582    
583    regen_mage_tree()
584    {
585     local i
586    
587     # build them only if requested
588     if [[ ${REGEN_MAGE_TREE} = true ]]
589     then
590     # run it without targets
591     if [ -z "${MAGE_TARGETS}" ]
592     then
593     echo
594     build_mage_script
595     echo
596     else
597    
598     # build for each target an mage file
599     # run it with several targets
600     for i in ${MAGE_TARGETS}
601     do
602     echo
603     build_mage_script "${i}"
604     echo
605     done
606     fi
607     fi
608    
609     # now unset all uneeded vars to be safe
610     # unset PKGNAME <-- don't do that; smage needs this var
611     # unset to be safe (quotes needed !)
612     for i in ${SPECIAL_FUNCTIONS}
613     do
614     unset "${i}"
615     done
616     unset SPECIAL_FUNCTIONS
617     for i in ${SPECIAL_VARS}
618     do
619     unset "${i}"
620     done
621     unset SPECIAL_VARS
622     unset STATE
623     unset DESCRIPTION
624     unset HOMEPAGE
625     unset PKGTYPE
626     unset INHERITS
627     unset DEPEND
628     unset SDEPEND
629     unset PROVIDE
630     unset preinstall
631     unset postinstall
632     unset preremove
633     unset postremove
634    }
635    
636    # print out our version
637    showversion
638    echo
639    
640  if [ -z "$1" ]  if [ -z "$1" ]
641  then  then
  showversion  
  echo  
642   echo "No .smage2 file given. Exiting."   echo "No .smage2 file given. Exiting."
643   echo   echo
644   exit 1   exit 1
645  fi  fi
646    
647  #updating smage2-scripts  # updating smage2-scripts
648  if [ "$1" == "update" ]  if [ "$1" == "update" ]
649  then  then
650   showversion   if [ ! -d ${SOURCEDIR} ]
  if [ ! -d ${SMAGESCRIPTSDIR} ]  
651   then   then
652   install -d ${SMAGESCRIPTSDIR}   install -d ${SOURCEDIR}
653   fi   fi
654   syncsmage2   syncsmage2
655   exit 0   exit 0
656  fi  fi
657    
658    # creates md5sums for smages to given dir
659    if [ "$1" == "calcmd5" ]
660    then
661     if [ $# -ge 3 ]
662     then
663     SMAGENAME="$2"
664     MD5DIR="$3"
665     source ${SMAGENAME} || die "download source failed"
666    
667     # overridable sourcedir; must be declared after source of the smage2
668     CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}"
669    
670     [ -z "${SRC_URI}" ] && die "Nothing declared to calculate."
671    
672     # end of array
673     EOA=${#SRC_URI[*]}
674    
675     [ ! -d ${MD5DIR} ] && install -d ${MD5DIR}
676    
677     # clear md5sum file
678     MY_MD5_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"
679     echo -n > ${MY_MD5_FILE}
680    
681     for ((i=0; i < EOA; i++))
682     do
683     # url to file
684     my_SRC_URI="$(echo ${SRC_URI[${i}]} | cut -d' ' -f1)"
685    
686     # subdir in sources dir; the my_SRCI_URI file goes to there
687     my_SRC_URI_DEST="$(echo ${SRC_URI[${i}]} | cut -d' ' -f2)"
688    
689     # if my_src_uri_dest is not equal my_src_uri; than an other dir is used
690     if [[ ${my_SRC_URI_DEST} != ${my_SRC_URI} ]]
691     then
692     MY_SRC_FILE="${my_SRC_URI_DEST}/$(basename ${SRC_URI[${i}]})"
693     else
694     MY_SRC_FILE="$(basename ${SRC_URI[${i}]})"
695     fi
696    
697     if [ -e "${CALC_SOURCEDIR}/${MY_SRC_FILE}" ]
698     then
699     echo "calculating $(basename ${MY_SRC_FILE}) ..."
700     ( cd ${CALC_SOURCEDIR}; md5sum "${MY_SRC_FILE}" ) >> ${MY_MD5_FILE}
701     else
702     echo "WARNING: File '$(basename ${MY_SRC_FILE}) not found in ${CALC_SOURCEDIR}."
703     fi
704    
705     # unset them to be shure
706     unset my_SRC_URI
707     unset my_SRC_URI_DEST
708     unset my_SRC_URI_MIRROR
709     unset my_SOURCEDIR
710     done
711    
712     echo
713     echo "Calculating of md5 sums for '$(basename ${SMAGENAME} .${SMAGESUFFIX})' done."
714     echo
715     else
716     echo "Usage: Calculating MD5 Sums:"
717     echo "    $(basename $0) calcmd5 /path/to/SMAGENAME /path/to/MD5DIR"
718     echo
719     echo
720     echo "Export the CALC_SOURCEDIR variable to override current SOURCEDIRs."
721     echo
722     exit 1
723     fi
724    
725     exit 0
726    fi
727    
728    # download sources
729    if [ "$1" == "download" -a -n "$2" ]
730    then
731     if [ ! -d ${SMAGESCRIPTSDIR} ]
732     then
733     install -d ${SMAGESCRIPTSDIR}
734     fi
735    
736     # get smage
737     SMAGENAME="$2"
738     MD5DIR="$(dirname ${SMAGENAME})/md5"
739     source ${SMAGENAME} || die "download source failed"
740    
741     download_sources
742     exit 0
743    fi
744    
745  if [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ]  if [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ]
746  then  then
# Line 329  fi Line 791  fi
791    
792  source ${SMAGENAME} || die "source failed"  source ${SMAGENAME} || die "source failed"
793  PKGNAME="${PNAME}-${PVER}-${CHOST%%-*}-${PBUILD}"  PKGNAME="${PNAME}-${PVER}-${CHOST%%-*}-${PBUILD}"
794    MD5DIR="$(dirname ${SMAGENAME})/md5"
795    
796  xtitle "Compiling ${PKGNAME}"  xtitle "Compiling ${PKGNAME}"
797  #fixes some issues with these functions  echo "Compiling ${PKGNAME}"
798    
799    # auto regen mage tree if requested
800    regen_mage_tree
801    
802    # download sources
803    download_sources
804    
805    # fixes some issues with these functions
806  export -f src_prepare || die "src_prepare export failed"  export -f src_prepare || die "src_prepare export failed"
807  export -f src_compile || die "src_compile export failed"  export -f src_compile || die "src_compile export failed"
808  export -f src_install || die "src_install export failed"  export -f src_install || die "src_install export failed"
809    
810  #fixes some compile issues  # fixes some compile issues
811  export CHOST="${CHOST}" || die "CHOST export failed"  export CHOST="${CHOST}" || die "CHOST export failed"
812  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"
813  export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"  export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"
# Line 344  export BINDIR="${BINDIR}" || die "BINDIR Line 815  export BINDIR="${BINDIR}" || die "BINDIR
815  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"
816    
817    
818  #setup distcc  # setup distcc
819  #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
820  if [ "${SMAGE_USE_DISTCC}" == "true" ]  if [ "${SMAGE_USE_DISTCC}" == "true" ]
821  then  then
822   setup_distcc_environment   setup_distcc_environment
823  fi  fi
824    
825  #setup ccache  # setup ccache
826  if [ "${SMAGE_USE_CCACHE}" == "true" ]  if [ "${SMAGE_USE_CCACHE}" == "true" ]
827  then  then
828   setup_ccache_environment   setup_ccache_environment
# Line 372  sleep 1 Line 843  sleep 1
843  #read  #read
844  #debug end  #debug end
845    
846  #cleans up build if a previously one exists  # cleans up build if a previously one exists
847  if [ -d ${BUILDDIR} ]  if [ -d ${BUILDDIR} ]
848  then  then
849   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."
850  fi  fi
851  install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."  install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."
852    
853  #cleans up srcdir if a previously unpacked one exists  # cleans up srcdir if a previously unpacked one exists
854  if [ -d ${SRCDIR} ]  if [ -d ${SRCDIR} ]
855  then  then
856   rm -rf ${SRCDIR}   rm -rf ${SRCDIR}
857  fi  fi
858    
859  #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
860  if [ -d ${BINDIR} ]  if [ -d ${BINDIR} ]
861  then  then
862   rm -rf ${BINDIR}   rm -rf ${BINDIR}
863  fi  fi
864  install -d ${BINDIR} || die "couldn't create \$BINDIR."  install -d ${BINDIR} || die "couldn't create \$BINDIR."
865    
866  #cleans up package temp dir if a previous build exists  # cleans up package temp dir if a previous build exists
867  if [ -d ${BUILDDIR}/${PKGNAME} ]  if [ -d ${BUILDDIR}/${PKGNAME} ]
868  then  then
869   rm -rf ${BUILDDIR}/${PKGNAME}   rm -rf ${BUILDDIR}/${PKGNAME}
870  fi  fi
871    
872  #cleans up timestamp if one exists  # cleans up timestamp if one exists
873  if [ -f /var/tmp/timestamp ]  if [ -f /var/tmp/timestamp ]
874  then  then
875   mage rmstamp   mage rmstamp
# Line 409  src_compile || die "src_compile failed" Line 880  src_compile || die "src_compile failed"
880  src_install || die "src_install failed"  src_install || die "src_install failed"
881    
882    
883  #compressing doc, info & man files  # compressing doc, info & man files
884  echo -e "Compressing man-pages ..."  echo -e "Compressing man-pages ..."
885  if [ -d ${BUILDDIR}/builded/usr/share/man ]  if [ -d ${BUILDDIR}/builded/usr/share/man ]
886  then  then
# Line 422  then Line 893  then
893   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info
894  fi  fi
895    
896  #the new buildpkg command  # stripping all bins and libs
897    case ${NOSTRIP} in
898     true|TRUE|yes|y)
899     echo -e "NOSTRIP=true detected; Package will not be stripped ..."
900     ;;
901     *)
902     echo -e "Stripping binaries ..."
903     mstripbins ${BINDIR}
904     echo -e "Stripping libraries ..."
905     mstriplibs ${BINDIR}
906     ;;
907    esac
908    
909    # the new buildpkg command
910  case ${NOPKGBUILD} in  case ${NOPKGBUILD} in
911   true|TRUE|yes|y)   true|TRUE|yes|y)
912   echo -e "NOPGKBUILD=true detected; Package will not be build ..."   echo -e "NOPGKBUILD=true detected; Package will not be build ..."
913   ;;   ;;
914   *)   *)
915   ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"   # build serveral targets
916   echo -e "\nPackage ${PKGNAME} successfully builded.\n"   if [ -n "${MAGE_TARGETS}" ]
917     then
918     for target in ${MAGE_TARGETS}
919     do
920     # check if an special target_pkgbuild exists
921     if typeset -f ${target}_pkgbuild > /dev/null
922     then
923     # run it
924     ${target}_pkgbuild
925     fi
926     # now create the target package
927     ${MLIBDIR}/pkgbuild_dir.sh \
928     "${PNAME}-${target}-${PVER}-${CHOST%%-*}-${PBUILD}" \
929     ${BINDIR} || die "target: ${target} package-build failed"
930     echo -e "\nPackage ${PNAME}-${target}-${PVER}-${CHOST%%-*}-${PBUILD} successfully builded.\n"
931     done
932     else
933     ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"
934     echo -e "\nPackage ${PKGNAME} successfully builded.\n"
935     fi
936   ;;   ;;
937  esac  esac
938    
939  #for sure  # for sure
940  unset NOPKGBUILD  unset NOPKGBUILD
941    unset NOSTRIP
942    
943  xtitleclean  xtitleclean
944  #echo -e "\nPackage ${PKGNAME} successfully builded.\n"  #echo -e "\nPackage ${PKGNAME} successfully builded.\n"

Legend:
Removed from v.40  
changed lines
  Added in v.198