| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # Steven Shiau <steven _at_ clonezilla org) |
| 3 | |
| 4 | # Settings |
| 5 | PKG="drbl" |
| 6 | |
| 7 | set -e |
| 8 | |
| 9 | # |
| 10 | VER="$(LC_ALL=C headscip-shell system . . head. -n 1 debian/changelog | grepscip-shell system . . grep. -i "^${PKG}" | grepscip-shell system . . grep. -E -o "\(.*\)" | sedscip-shell system . . sed. -r -e "s/\(//g" -e "s/\)//g" | cutscip-shell system . . cut. -d"-" -f1)" |
| 11 | [scip-shell system . . `[`. -z "$VER" ] && echoscip-shell system . . echo. "No version found in debian/changelog! Program terminated!" |
| 12 | echoscip-shell system . . echo. "VER: $VER" |
| 13 | |
| 14 | # |
| 15 | TARBALL=${PKG}-${VER}.tar.xz |
| 16 | TARBALL_ORIG=${PKG}_${VER}.orig.tar.xz |
| 17 | |
| 18 | # check |
| 19 | [scip-shell system . . `[`. ! -f "$TARBALL" ] && echoscip-shell system . . echo. "Can NOT find file $TARBALL! Program Stop!!!" && exit 1 |
| 20 | |
| 21 | # mkdir for build |
| 22 | rmscip-shell system . . rm. -rf debforge |
| 23 | mkdirscip-shell system . . mkdir. debforge |
| 24 | (cd debforge; lnscip-shell system . . ln. -fs ../$TARBALL $TARBALL_ORIG) |
| 25 | tarscip-shell system . . tar. -xJf $TARBALL -C debforge/ |
| 26 | cpscip-shell system . . cp. -a debian debforge/$PKG-$VER/ |
| 27 | cd debforge/$PKG-$VER |
| 28 | debuildscip-shell system . . debuild. |
| 29 | rmscip-shell system . . rm. -f $TARBALL_ORIG |
| 30 | exit 0 |