Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:nad1r
xchroot
debexport
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File debexport of Package xchroot
#!/bin/bash msg() { echo -e "\e[1;34m$@\e[0m" >&2; } err() { echo -e "\e[1;31m$@\e[0m" >&2; } isin() { local tok="$1"; while [[ $# -gt 1 ]]; do [[ "$tok" = "$2" ]] && return 0; shift; done; return 1; } exec 9>/dev/null TARGETDIR=$NAME; buildTarget=debian; let OnlySource=0; let opterr=0 force=0; while [[ "${1:0:1}" = "-" ]]; do if [[ "$1" = "--help" ]]; then msg "$(basename $0)\e[0m destdirname ... ships to ${DEBROOT}/usr/src/destdirname\n"; let opterr=-1; elif [[ "$1" = "--ubuntu" ]]; then TARGETDIR=xchroot-ubuntu; buildTarget=ubuntu; let OnlySource=1; elif [[ "$1" = "--force" ]]; then let force=1; else err "unknown option: $1" >&2; let opterr=1; fi shift; done [[ opterr -gt 0 ]] && exit 1; [[ opterr -lt 0 ]] && exit 0; [[ -n "$1" ]] && TARGETDIR="$1"; if [[ -z "$DEBROOT" ]]; then if [[ -d /mnt/debian/usr ]]; then DEBROOT=/mnt/debian else DEBROOT=/ fi fi NAME=xchroot SOURCE="xchroot-v2.7.5.tar.bz2"; ADDSOURCE="" ADDSOURCE_TAG="" #PATCHES="xchroot-v2.7.4-quiet-install.patch" PATCHES="" # -> debian.series: patchfile -p1 #SOURCES="xchroot-v2.7.4.tar.gz xchroot-v2.7.4-quiet-install.patch"; [[ -z "$TARGETDIR" ]] && TARGETDIR=$NAME echo "exporting for build target $buildTarget as $TARGETDIR ..." >&2 destdir="${DEBROOT}/usr/src/$TARGETDIR" if [[ -d "$destdir" && force -le 0 ]]; then err "destination dir '$TARGETDIR' already exists; choose another one for creation.\n"; exit 2; fi [ -d "$destdir" ] && rm -r $destdir; mkdir -p $destdir entireVersion=$(sed -n 's#[Vv]ersion:\s*\(\S*\)\s*$#\1#p' <${NAME}.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 BUILD=$NAME-$version srcbz2base=${NAME}_${version}.orig.tar.bz2 srcbz2base_add=${NAME}_${version}.orig-$ADDSOURCE_TAG.tar.bz2 #newsources=$destdir/$NAME-$version #mkdir $newsources || { err "could not create directory $newsources"; exit 4; } #for i in $SOURCES; do cp $i $newsources/; done cp "$SOURCE" $destdir/$srcbz2base [[ -n "$ADDSOURCE" ]] && bzip2 -c -9 <"$ADDSOURCE" >$destdir/$srcbz2base_add pushd $destdir >&9 && { #tar -cz $NAME-$version >$srcbz2base tar -xjf $srcbz2base [[ -n "$ADDSOURCE" ]] && tar -C $BUILD -xjf $srcbz2base_add [[ -d "$BUILD" ]] || echo "error: did not unpack $BUILD !!" >&2 [[ -d "$BUILD/$ADDSOURCE_TAG" ]] || echo "error: did not unpack $BUILD/$ADDSOURCE_TAG !!" >&2 mkdir -p $BUILD/debian/source echo "3.0 (quilt)" >$BUILD/debian/source/format popd >&9 } if [[ -n "$PATCHES" ]]; then mkdir $destdir/$BUILD/debian/patches; cp debian.series $destdir/$BUILD/debian/patches/series; for i in $PATCHES; do cp $i $destdir/$BUILD/debian/patches; done fi #cp ${NAME}.dsc $destdir/${NAME}_$entireVersion.dsc sed '/^Files:\s*$/,$d;/^Debtransform-/d' <${NAME}.dsc >$destdir/${NAME}_$entireVersion.dsc #cp ${NAME}.dsc $destdir/${NAME}_$entireVersion.dsc sed '/# obs-only[ \t]*$/d' <debian.rules >$destdir/$BUILD/debian/rules if [[ "$buildTarget" = "ubuntu" ]]; then sed 's#\<stable\>#jammy#' <debian.changelog >$destdir/$BUILD/debian/changelog addnotcp=changelog fi # not what we want: #srcbz2="$destdir/$srcbz2base" #sed '/^Files:\s*$/,$d' <${NAME}.dsc | { # cat; echo "Files: "; echo " $(md5sum $srcbz2| cut -f 1 -d " ") $(ls -l $srcbz2| cut -f 5 -d " ") $srcbz2base"; #} >$destdir/${NAME}_$entireVersion.dsc for i in debian.*; do t=${i#debian.}; t=${t%.native} isin $t series tar rules $addnotcp || cp $i $destdir/$BUILD/debian/$t; done { shopt -s nullglob; pushd $destdir/$BUILD/debian/ && { for file in *.native; do mv ${file} ${file%.native}; done; popd; }; } >&9 chmod +x $destdir/$BUILD/debian/rules # sed -i 's#^INST_DIR := $(CURDIR)/debian/tmp#INST_DIR := $(CURDIR)/debian/xchroot#' $destdir/BUILD/debian/rules if [[ OnlySource -eq 0 ]]; then cat >$destdir/run <<EOQ #!/bin/bash pushd $BUILD dpkg-buildpackage -sa -kestellnb@elstel.org popd echo ------------------------------------ dpkg-deb -c ${NAME}_${entireVersion}_all.deb EOQ else cat >$destdir/run <<EOQ #!/bin/bash pushd $BUILD dpkg-buildpackage -S -sa -kestellnb@elstel.org popd echo ------------------------------------ ls EOQ fi chmod +x $destdir/run
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor