Magellan Linux

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

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

revision 1641 by niro, Fri Jan 13 18:31:48 2012 UTC revision 1689 by niro, Thu Feb 16 11:58:12 2012 UTC
# Line 7  Line 7 
7  smagesource()  smagesource()
8  {  {
9   local file="$1"   local file="$1"
10   local mystate   local localstate
11   local mycodename   local distfilestate
12     local mytag
13    
14   source ${file}   source ${file}
15    
# Line 19  smagesource() Line 20  smagesource()
20   if [[ -n ${PCATEGORIE} ]]   if [[ -n ${PCATEGORIE} ]]
21   then   then
22   PCAT="${PCATEGORIE}"   PCAT="${PCATEGORIE}"
23     unset PCATEGORIE
24   # print a warning   # print a warning
25   echo -e "${COLYELLOW}Warning: 'PCATEGORIE' is deprecated and gets removed in the future.${COLDEFAULT}"   echo -e "${COLYELLOW}Warning: 'PCATEGORIE' is deprecated and gets removed in the future.${COLDEFAULT}"
26   echo -e "${COLYELLOW}         Please modify this smage2 script to use the 'PCAT' variable.${COLDEFAULT}"   echo -e "${COLYELLOW}         Please modify this smage2 script to use the 'PCAT' variable.${COLDEFAULT}"
# Line 28  smagesource() Line 30  smagesource()
30   fi   fi
31   fi   fi
32    
33   [[ -n ${STATE} ]] && mystate="${STATE}"   [[ -n ${STATE} ]] && localstate="${STATE}"
34     [[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}"
  # do not overide if local state was broken or disabled!  
  case ${STATE} in  
  broken) return ;;  
  disabled) return ;;  
  esac  
35    
36   if [ -f ${SMAGESCRIPTSDIR}/distribution ]   if [ -f ${SMAGESCRIPTSDIR}/distribution ]
37   then   then
38   source ${SMAGESCRIPTSDIR}/distribution   source ${SMAGESCRIPTSDIR}/distribution
39   [[ -n ${STATE} ]] && mystate="${STATE}"   [[ -n ${STATE} ]] && distfilestate="${STATE}"
40     [[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}"
41     fi
42     # now switch state and export it but do not overide any local states
43     if [[ ! -z ${localstate} ]]
44     then
45     STATE="${localstate}"
46     else
47     STATE="${distfilestate}"
48     fi
49    
50     if mqueryfeature "pkgdistrotag"
51     then
52     # if DISTROTAG was not defined globally
53     # or in distribution file then deactivate this feature!
54     # at this point $mytag must have the distrotag
55     if [[ -z ${mytag} ]]
56     then
57     FVERBOSE=off msetfeature "!pkgdistrotag"
58     unset DISTROTAG
59     echo -e "${COLRED}Requested 'pkgdistrotag' but no \$DISTROTAG found!${COLDEFAULT}"
60     echo -e "${COLRED}Disabled the feature for pkgbuild sanity!${COLDEFAULT}"
61     else
62     # now switch state and export it but do not overide any local states
63     export DISTROTAG="${mytag}"
64     fi
65     else
66     unset DISTROTAG
67     fi
68    }
69    
70    print_distrotag()
71    {
72     if FVERBOSE=off mqueryfeature "pkgdistrotag"
73     then
74     if [[ ! -z ${DISTROTAG} ]]
75     then
76     # add a point as prefix
77     echo ".${DISTROTAG}"
78     fi
79   fi   fi
  # now switch state and export it  
  STATE="${mystate}"  
80  }  }
81    
82  showversion()  showversion()
# Line 247  mconfigure() Line 281  mconfigure()
281   fi   fi
282   fi   fi
283    
284   # always enable shared by default   # always enable shared by default but not for waf configure
285   if [[ ! -z $(./configure --help | grep -- '--.*able-shared') ]]   if [[ ! -z $(./configure --help | grep -- '--.*able-shared') ]] &&
286     [[ -z $(./configure --version | grep waf) ]]
287   then   then
288   myopts+=" --enable-shared"   myopts+=" --enable-shared"
289   fi   fi
# Line 536  sminclude() Line 571  sminclude()
571   fi   fi
572  }  }
573    
574    march()
575    {
576     local retval
577    
578     if [[ ! -z ${ARCH} ]]
579     then
580     echo "${ARCH}"
581     retval=0
582     else
583     retval=1
584     fi
585    
586     return "${retval}"
587    }
588    
589    marchsrcfile()
590    {
591     local retval
592     if [[ ! -z $(eval echo \$SRCFILE_${ARCH/i*86/x86}) ]]
593     then
594     eval echo \$SRCFILE_${ARCH/i*86/x86} | tr ';' '\n'
595     retval=0
596     else
597     retval=1
598     fi
599    
600     return "${retval}"
601    }
602    
603    marchsrcdir()
604    {
605     local retval
606     if [[ ! -z $(eval echo \$SRCDIR_${ARCH/i*86/x86}) ]]
607     then
608     eval echo \$SRCDIR_${ARCH/i*86/x86} | tr ';' '\n'
609     retval=0
610     else
611     retval=1
612     fi
613    
614     return "${retval}"
615    }
616    
617    marchdepend()
618    {
619     local retval
620    
621     if [[ ! -z $(eval echo \$DEPEND_${ARCH/i*86/x86}) ]]
622     then
623     echo "\$(eval echo \\\$DEPEND_\${ARCH/i*86/x86} | tr ';' '\n')"
624     retval=0
625     else
626     retval=1
627     fi
628    
629     return "${retval}"
630    }
631    
632    marchsdepend()
633    {
634     local retval
635     if [[ ! -z $(eval echo \$SDEPEND_${ARCH/i*86/x86}) ]]
636     then
637     echo "\$(eval echo \\\$SDEPEND_\${ARCH/i*86/x86} | tr ';' '\n')"
638     retval=0
639     else
640     retval=1
641     fi
642    
643     return "${retval}"
644    }
645    
646  setup_distcc_environment()  setup_distcc_environment()
647  {  {
648   if [ -x /usr/bin/distcc ]   if [ -x /usr/bin/distcc ]
# Line 627  EOF Line 734  EOF
734  #   STATE                 state of pkg stable|unstable|old  #   STATE                 state of pkg stable|unstable|old
735  #   DESCRIPTION           a short description (opt)  #   DESCRIPTION           a short description (opt)
736  #   HOMEPAGE              homepage (opt)  #   HOMEPAGE              homepage (opt)
737    #   LICENSE               license information of the pkg (opt)
738  #   DEPEND                runtime dependencies (opt)  #   DEPEND                runtime dependencies (opt)
739  #   SDEPEND               adds needed deps to build the pkg (opt)  #   SDEPEND               adds needed deps to build the pkg (opt)
740  #   PROVIDE               provides a virtual (opt)  #   PROVIDE               provides a virtual (opt)
# Line 677  build_mage_script() Line 785  build_mage_script()
785   > ${dest}   > ${dest}
786    
787   # pgkname and state   # pgkname and state
788   echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest}   echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}$(print_distrotag)-${PBUILD}\"" >> ${dest}
789   echo "STATE=\"${STATE}\"" >> ${dest}   echo "STATE=\"${STATE}\"" >> ${dest}
790    
791   # description and homepage   # description and homepage
792   echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest}   echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest}
793   echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}   echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}
794    
795     # license information
796     echo "LICENSE=\"${LICENSE}\"" >> ${dest}
797    
798   # special tags and vars   # special tags and vars
799   echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}   echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}
800    
# Line 775  regen_mage_tree() Line 886  regen_mage_tree()
886   # get the right variables for the split   # get the right variables for the split
887   export PNAME="${subpackage}"   export PNAME="${subpackage}"
888   split_info_${subpackage}   split_info_${subpackage}
889     # fix PCATEGORIE -> PCAT
890     if [[ ! -z ${PCATEGORIE} ]]
891     then
892     PCAT="${PCATEGORIE}"
893     unset PCATEGORIE
894     fi
895   # get the preinstall etc   # get the preinstall etc
896   split_export_inherits ${subpackage}   split_export_inherits ${subpackage}
897   build_mage_script --split-pkg-base "${split_pkg_base}"   build_mage_script --split-pkg-base "${split_pkg_base}"
# Line 1086  generate_package_md5sum() Line 1203  generate_package_md5sum()
1203   [ -n "${target}" ] && target="-${target}"   [ -n "${target}" ] && target="-${target}"
1204    
1205   # build pkgname   # build pkgname
1206   pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"   pkgname="${pname}${target}-${pver}-${parch}$(print_distrotag)-${pbuild}"
1207    
1208   # build pkg-md5-sum only if requested   # build pkg-md5-sum only if requested
1209   if mqueryfeature regentree   if mqueryfeature regentree
# Line 1139  source_pkg_build() Line 1256  source_pkg_build()
1256   [[ ! -d ${SRCPKGDIR} ]] && install -d ${SRCPKGDIR}   [[ ! -d ${SRCPKGDIR} ]] && install -d ${SRCPKGDIR}
1257   mv ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${SRCPKGDIR}/${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX}   mv ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${SRCPKGDIR}/${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX}
1258    
1259   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}\n"
1260  }  }
1261    
1262  step_by_step()  step_by_step()

Legend:
Removed from v.1641  
changed lines
  Added in v.1689