Magellan Linux

Diff of /branches/mage-next/usr/lib/mage/meta-generator.sh

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

trunk/mage/usr/lib/mage/meta-generator.sh revision 2292 by niro, Fri Dec 6 09:43:11 2013 UTC branches/mage-next/usr/lib/mage/meta-generator.sh revision 2525 by niro, Wed Jan 29 10:42:21 2014 UTC
# Line 55  add2meta() Line 55  add2meta()
55   local var="$1"   local var="$1"
56   local value="$2"   local value="$2"
57    
58   echo "${var}=\"${value}\"" >> ${METAFILE}   echo "${var}=\"${value}\"" >> ${PKGMETAFILE}
59  }  }
60    
61  ## only for tests -> normally in /etc/rc.d/init.d/functions  ## only for tests -> normally in /etc/rc.d/init.d/functions
# Line 80  PKGTARBALL="" Line 80  PKGTARBALL=""
80  SMAGEFILE=""  SMAGEFILE=""
81  METADIR="${PKGDIR}/meta"  METADIR="${PKGDIR}/meta"
82  METASUFFIX="meta"  METASUFFIX="meta"
83  METAFILE=""  PKGMETADIR=""
84    PKGMETAFILE=""
85    
86  # very basic getops  # very basic getops
87  for i in $*  for i in $*
# Line 95  SMAGEFILE="$1" Line 96  SMAGEFILE="$1"
96  [ -z ${SMAGEFILE} ] && die "No smage file given."  [ -z ${SMAGEFILE} ] && die "No smage file given."
97  [ -e ${SMAGEFILE} ] || die "Smage file '${SMAGEFILE}' does not exist."  [ -e ${SMAGEFILE} ] || die "Smage file '${SMAGEFILE}' does not exist."
98    
99  PKGNAME="${PNAME}-${PVER}-${PBUILD}"  # load mage-features
100  ARCHPKGNAME="${PNAME}-${PVER}-${ARCH}$(distrotag)-${PBUILD}"  load_mage_features
101    
102  if [[ -n ${PKGTARBALL} ]]  if [[ -n ${PKGTARBALL} ]]
103  then  then
# Line 118  fi Line 119  fi
119  # get generic package information from smage file  # get generic package information from smage file
120  smagesource ${SMAGEFILE}  smagesource ${SMAGEFILE}
121    
122    PKGNAME="${PNAME}-${PVER}-${PBUILD}"
123    ARCHPKGNAME="${PNAME}-${PVER}-${ARCH}$(print_distrotag)-${PBUILD}"
124    
125  # set the right meta-location  # set the right meta-location
126    PKGMETADIR="${METADIR}/${ARCHPKGNAME}"
127    PKGMETAFILE="${METADIR}/${ARCHPKGNAME}/${METASUFFIX}"
128    
129  [[ ! -d ${METADIR} ]] && install -d ${METADIR}  [[ ! -d ${METADIR} ]] && install -d ${METADIR}
130  METAFILE="${METADIR}/${ARCHPKGNAME}.${METASUFFIX}"  [[ ! -d ${PKGMETADIR} ]] && install -d ${PKGMETADIR}
131    
132  # create a clean metafile  # create a clean metafile
133  :> ${METAFILE}  :> ${PKGMETAFILE}
134    
135  # basic packages information  # basic packages information
136  add2meta PNAME "${PNAME}"  add2meta PNAME "${PNAME}"
# Line 138  add2meta PBUILD "${PBUILD}" Line 145  add2meta PBUILD "${PBUILD}"
145  add2meta DESCRIPTION "${DESCRIPTION}"  add2meta DESCRIPTION "${DESCRIPTION}"
146  add2meta HOMEPAGE "${HOMEPAGE}"  add2meta HOMEPAGE "${HOMEPAGE}"
147  add2meta PKGTYPE "${PKGTYPE}"  add2meta PKGTYPE "${PKGTYPE}"
148  #add2meta SPLIT_PACKAGE_BASE "${SPLIT_PACKAGE_BASE}"  add2meta SPLIT_PACKAGE_BASE "${SPLIT_PACKAGE_BASE}"
149  #add2meta INHERITS "${INHERITS}"  add2meta INHERITS "${INHERITS}"
150    
151  # arch specific  # arch specific
152  add2meta ARCH "${ARCH}"  add2meta ARCH "${ARCH}"
# Line 152  SEARCH_DIRS+=",usr/*/bin,usr/*/sbin" Line 159  SEARCH_DIRS+=",usr/*/bin,usr/*/sbin"
159  SEARCH_DIRS+=",opt/bin,opt/*/bin,opt/*/sbin"  SEARCH_DIRS+=",opt/bin,opt/*/bin,opt/*/sbin"
160  SEARCH_DIRS+=",opt/*/jre/bin"  SEARCH_DIRS+=",opt/*/jre/bin"
161  # at last add braces  # at last add braces
162  SEARCH_DIRS="{${SEARCH_DIRS}}"  #SEARCH_DIRS="{${SEARCH_DIRS}}"
163  # search them  # search them
164  add2meta PROVIDED_BINARIES "$(find $(eval echo ${BUILDDIR}/${ARCHPKGNAME}/binfiles/${SEARCH_DIRS}) -type f -printf '%f ' 2> /dev/null)"  #add2meta PROVIDED_BINARIES "$(find $(eval echo ${BUILDDIR}/${ARCHPKGNAME}/binfiles/${SEARCH_DIRS}) -type f -printf '%f ' 2> /dev/null)"
   
165  # generate MD5SUM (get it with tail -n1)  # generate MD5SUM (get it with tail -n1)
166  echo >> ${METAFILE}  add2meta PKG_CHECKSUM_MD5 "$(cd ${PKGDIR}; md5sum ${ARCHPKGNAME}.${PKGSUFFIX} | cut -d' ' -f1 )"
167  echo '# MD5 CHECKSUM:' >> ${METAFILE}  
168  ( cd ${PKGDIR}; md5sum ${ARCHPKGNAME}.${PKGSUFFIX} >> ${METAFILE} )  # generate content file
169    find ${BINDIR} | sed "s:${BINDIR}::g;/^$/d" | sort -d > ${PKGMETADIR}/content

Legend:
Removed from v.2292  
changed lines
  Added in v.2525