| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | if [scip-shell system . . `[`. $# -ne 0 ]; then |
| 4 | echoscip-shell system . . echo. "Simple packaging file for the Debian source tarball." |
| 5 | echoscip-shell system . . echo. "" |
| 6 | echoscip-shell system . . echo. "Use in the root directory of the game, like so:" |
| 7 | echoscip-shell system . . echo. " scripts/pkg_deb" |
| 8 | echoscip-shell system . . echo. "The script will output a tarball angband_[git describe].orig.tar.gz" |
| 9 | |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | TAG1=angband-`gitscip-shell system . . git. describe` |
| 14 | TAG2=angband_`gitscip-shell system . . git. describe` |
| 15 | OUT=$TAG2.orig.tar.gz |
| 16 | |
| 17 | # Error checking |
| 18 | if [scip-shell system . . `[`. -e $OUT ]; then |
| 19 | catscip-shell system . . cat. <<EOF |
| 20 | The output file $OUT already exists. |
| 21 | Please rename or delete it before running the script again. |
| 22 | EOF |
| 23 | exit 1 |
| 24 | fi |
| 25 | |
| 26 | if [scip-shell system . . `[`. -e $TAG1 ]; then |
| 27 | catscip-shell system . . cat. <<EOF |
| 28 | The output directory $TAG1 already exists. |
| 29 | Please rename or delete it before running the script again. |
| 30 | EOF |
| 31 | exit 1 |
| 32 | fi |
| 33 | |
| 34 | gitscip-shell system . . git. checkout-index --prefix=$TAG1/ -a && |
| 35 | gitscip-shell system . . git. describe > $TAG1/version && |
| 36 | cd $TAG1 && |
| 37 | ./autogen.sh && |
| 38 | rmscip-shell system . . rm. -rf autogen.sh autom4te.cache && |
| 39 | cd .. && |
| 40 | tarscip-shell system . . tar. --exclude .gitignore --exclude *.dll --exclude *.mp3 --exclude lib/tiles/shockbolt/64x64.png -czvf ../$OUT $TAG1 && |
| 41 | rmscip-shell system . . rm. -rf $TAG1 |