#!/bin/sh # create a package from gnx mkdistros file lists # Copyright (c) Linus Sphinx 2004 # part of the gnnix conspiracy # # execute in chrooted $DIST as gnxbuild/gnxwrap var/gnx/name-version.files # export TZ=UTC PATH=/tool/bin:/tool/sbin:/bin:/sbin ROOT= DEST=/parts/xml ZIPS=/parts/bin ZIPUNSTRIP=/parts/binunstripped LOGO=/logo # catalogue() { pkg=`basename $1 .files` pfile=${DEST}/${pkg}.xml echo "" > $pfile echo "${pkg%-*}" >> $pfile echo "${pkg#*-}" >> $pfile echo "" >> $pfile echo "sphinx" >> $pfile echo "http://gnnix.org" >> $pfile grep -v ld.so.cache $1 | grep -v -E '^/dev|^/proc|^/sys' | while read i do SKIP=no if [[ -f /gnxbuild/gnxcept/${pkg} ]]; then grep -q "${i}" /gnxbuild/gnxcept/${pkg} if [[ "$?" == "0" ]]; then SKIP=yes fi fi if [[ "${i}" == "/usr/share/info/dir.bz2" ]]; then SKIP=yes fi if [[ "${i}" == "/etc/ld.so.cache" ]]; then SKIP=yes fi if [[ -e "${ROOT}${i}" && "$SKIP" == "no" ]]; then zipnam="${i#/}" echo "" >> $pfile echo "${zipnam}" >> $pfile echo "`stat -c %a ${ROOT}${i}`" >> $pfile echo "`stat -c %u ${ROOT}${i}`" >> $pfile echo "`stat -c %g ${ROOT}${i}`" >> $pfile echo "`stat -c %F ${ROOT}${i}`" >> $pfile if [[ ! -d "${ROOT}${i}" ]]; then g=`stat -c %y ${ROOT}${i}` echo "${g%.*}" >> $pfile mx=`md5sum ${ROOT}${i}` set $mx echo "$1" >> $pfile if [[ -f "${ROOT}${i}" ]]; then if [[ "$STRIP" == "yes" ]]; then echo $i | grep -q -E '^/lib/|^/usr/lib/' if [[ "0" == "$?" ]]; then strip --strip-debug ${ROOT}${i} 1>>/tmp/strip.out 2>/tmp/strip.err else echo "$i" | grep -q -E '^/bin/|^/usr/bin/|^/sbin/|^/usr/sbin/' if [[ "0" == "$?" ]]; then strip --strip-all ${ROOT}${i} 1>>/tmp/strip.out 2>/tmp/strip.err fi fi fi fi fi echo "" >> $pfile echo $zipnam fi done echo "" >> $pfile } if [[ "--nostrip" == "$1" ]]; then ZIPS=${ZIPUNSTRIP} export ZIPS shift elif [[ "--redo" == "$1" ]]; then REDO=1 export REDO shift else STRIP=yes export STRIP fi for i in $@ do if [[ "$STRIP" == "yes" ]]; then echo stripping else echo no stripping fi echo working on: $i catalogue $i | /usr/bin/zip -ry9@ ${ZIPS}/`basename $i .files`.gnx /usr/bin/zip -j9 ${ZIPS}/`basename $i .files`.gnx ${DEST}/`basename $i .files`.xml echo " , , / \ ((__-^^-,-^^-__)) '-_---' '---_-' '--|o' 'o|--' \ | | / ): :( :o_o: '-' part of the gn*nix conspiracy http://gnnix.org gnx content, info and sigs are in `basename $i .files`.xml see /var/gnx for a complete list of installed files ." | /usr/bin/zip -z ${ZIPS}/`basename $i .files`.gnx chmod 0444 ${ZIPS}/`basename $i .files`.gnx done echo done. exit 0