95 |
[ -z ${SMAGEFILE} ] && die "No smage file given." |
[ -z ${SMAGEFILE} ] && die "No smage file given." |
96 |
[ -e ${SMAGEFILE} ] || die "Smage file '${SMAGEFILE}' does not exist." |
[ -e ${SMAGEFILE} ] || die "Smage file '${SMAGEFILE}' does not exist." |
97 |
|
|
98 |
|
PKGNAME="${PNAME}-${PVER}-${PBUILD}" |
99 |
|
ARCHPKGNAME="${PNAME}-${PVER}-${ARCH}$(distrotag)-${PBUILD}" |
100 |
|
|
101 |
if [[ -n ${PKGTARBALL} ]] |
if [[ -n ${PKGTARBALL} ]] |
102 |
then |
then |
103 |
# abort if given file is not a pkg |
# abort if given file is not a pkg |
120 |
|
|
121 |
# set the right meta-location |
# set the right meta-location |
122 |
[[ ! -d ${METADIR} ]] && install -d ${METADIR} |
[[ ! -d ${METADIR} ]] && install -d ${METADIR} |
123 |
METAFILE="${METADIR}/${PNAME}-${PVER}-${ARCH}-${PBUILD}.${METASUFFIX}" |
METAFILE="${METADIR}/${ARCHPKGNAME}.${METASUFFIX}" |
124 |
|
|
125 |
# create a clean metafile |
# create a clean metafile |
126 |
:> ${METAFILE} |
:> ${METAFILE} |
139 |
|
|
140 |
# arch specific |
# arch specific |
141 |
add2meta ARCH "${ARCH}" |
add2meta ARCH "${ARCH}" |
142 |
add2meta SIZE "$(du -Ds ${BUILDDIR}/${PNAME}-${PVER}-${ARCH}-${PBUILD}/binfiles | sed 's/^\(.*\)\t.*/\1/')" |
add2meta SIZE "$(du -Ds ${BUILDDIR}/${ARCHPKGNAME}/binfiles | sed 's/^\(.*\)\t.*/\1/')" |
143 |
add2meta MTIME "$(< ${BUILDDIR}/${PNAME}-${PVER}-${ARCH}-${PBUILD}/.mtime)" |
add2meta MTIME "$(< ${BUILDDIR}/${ARCHPKGNAME}/.mtime)" |
144 |
|
|
145 |
# provided binfiles |
# provided binfiles |
146 |
SEARCH_DIRS="bin,sbin,usr/bin,usr/sbin" |
SEARCH_DIRS="bin,sbin,usr/bin,usr/sbin" |
150 |
# at last add braces |
# at last add braces |
151 |
SEARCH_DIRS="{${SEARCH_DIRS}}" |
SEARCH_DIRS="{${SEARCH_DIRS}}" |
152 |
# search them |
# search them |
153 |
add2meta PROVIDED_BINARIES "$(find $(eval echo ${BUILDDIR}/${PNAME}-${PVER}-${ARCH}-${PBUILD}/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)" |
154 |
|
|
155 |
# generate MD5SUM (get it with tail -n1) |
# generate MD5SUM (get it with tail -n1) |
156 |
echo >> ${METAFILE} |
echo >> ${METAFILE} |
157 |
echo '# MD5 CHECKSUM:' >> ${METAFILE} |
echo '# MD5 CHECKSUM:' >> ${METAFILE} |
158 |
( cd ${PKGDIR}; md5sum ${PNAME}-${PVER}-${ARCH}-${PBUILD}.${PKGSUFFIX} >> ${METAFILE} ) |
( cd ${PKGDIR}; md5sum ${ARCHPKGNAME}.${PKGSUFFIX} >> ${METAFILE} ) |