LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File debexport of Package xchroot (Project home:estellnb:elstel)

#!/bin/bash

msg() { echo -e "\e[1;34m$@\e[0m" >&2; }
err() { echo -e "\e[1;31m$@\e[0m" >&2; }

: ${DEBROOT:=/dst/debchroot}
NAME=xchroot
SOURCES="xchroot.8 xchroot-v2.3.2 xchroot-doc-2013-10-28.tar.gz";

{
if [ -z "$1" ]; then msg "$(basename $0)\e[0m destdirname ... ships to ${DEBROOT}/usr/src/destdirname\n"; exit 1; fi

destdir="${DEBROOT}/usr/src/$1"
# if [ -d "$destdir" ]; then err "destination dir '$1' already exists; choose another one for creation.\n"; exit 2; fi
mkdir -p $destdir

entireVersion=$(sed -n 's#[Vv]ersion:\s*\(\S*\)\s*$#\1#p' <${NAME}.dsc)
cp ${NAME}.dsc $destdir/${NAME}_$entireVersion.dsc

version=$(sed -n 's#[Vv]ersion:\s*\(\S*\)\s*$#\1#p' <${NAME}.spec)
if [ "${entireVersion#$version}" = "${entireVersion}" ]; then err "$version is not a praefix of $entireVersion! stop."; exit 3; fi

newsources=$destdir/$NAME-$version
mkdir $newsources || { err "could not create directory $newsources"; exit 4; }
for i in $SOURCES; do cp $i $newsources/; done
pushd $destdir >&9 && {
 tar -cz $NAME-$version >${NAME}_${version}.orig.tar.gz

 mv $NAME-$version SOURCES

 #mkdir BUILD
 cp -a SOURCES BUILD
 mkdir -p BUILD/debian/source
 echo "2.0" >BUILD/debian/source/format

popd >&9
}

for i in debian.*; do t=${i#debian.}; cp $i $destdir/BUILD/debian/$t; done
chmod +x $destdir/BUILD/debian/rules








} 9>/dev/null