| 1 | #! /bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | version=$2 |
| 4 | symlinkToUpstreamTarball=$3 |
| 5 | |
| 6 | |
| 7 | newdir=$(echoscip-shell system . . echo. $symlinkToUpstreamTarball | sedscip-shell system . . sed. -e 's%^\.\./%%' -e 's/.orig.tar.gz//' -e 's/_/-/') |
| 8 | symlinkToUpstreamTarball=$(echoscip-shell system . . echo. $symlinkToUpstreamTarball | sedscip-shell system . . sed. -e 's%^\.\./%%') |
| 9 | newdir=${newdir}+dfsg1 |
| 10 | |
| 11 | echoscip-shell system . . echo. "convert geophar-$version to $newdir" |
| 12 | wd=$(pwdscip-shell system . . pwd.) |
| 13 | cd .. |
| 14 | tarscip-shell system . . tar. xzf $symlinkToUpstreamTarball |
| 15 | mvscip-shell system . . mv. geophar-$version $newdir |
| 16 | |
| 17 | removedFiles="" |
| 18 | |
| 19 | for f in jsMath jquery.js underscore.js sympy 7zS.sfx; do |
| 20 | for found in $(findscip-shell system . . find. $newdir -name $f); do |
| 21 | removedFiles="$removedFiles $found" |
| 22 | done |
| 23 | echoscip-shell system . . echo. "files to remove: $removedFiles" |
| 24 | findscip-shell system . . find. $newdir -name $f | xargsscip-shell system . . xargs. rm -rf |
| 25 | done |
| 26 | |
| 27 | # build the documentation, which requires dbus running and an X11 server |
| 28 | # these prerequisites are hard to meet inside Debian's compile farm. |
| 29 | |
| 30 | wd1=$(pwdscip-shell system . . pwd.) |
| 31 | mkdirscip-shell system . . mkdir. -p $newdir/doc; cd $newdir/doc; makescip-shell system . . make. html; |
| 32 | cd $wd1 |
| 33 | |
| 34 | echoscip-shell system . . echo. "Those files were removed to comply with DFSG:" > $newdir/README.dfsg.txt |
| 35 | echoscip-shell system . . echo. $removedFiles >> $newdir/README.dfsg.txt |
| 36 | |
| 37 | archive=geophar_$version+dfsg1.orig.tar.xz |
| 38 | |
| 39 | tarscip-shell system . . tar. cJf $archive $newdir |
| 40 | |
| 41 | rmscip-shell system . . rm. -rf $newdir |
| 42 | |
| 43 | echoscip-shell system . . echo. created $archive |
| 44 | |
| 45 | rmscip-shell system . . rm. $(readlinkscip-shell system . . readlink. $symlinkToUpstreamTarball) |
| 46 | rmscip-shell system . . rm. $symlinkToUpstreamTarball |