1ab77d7
#!/bin/sh -x
1ab77d7
1ab77d7
pkgname=kiten
1ab77d7
litepkgname=kiten-stripped
1ab77d7
1ab77d7
if test "x$1" = x; then
1ab77d7
    echo "help: $0 <kiten tar ball>"
1ab77d7
    exit 1
1ab77d7
fi
1ab77d7
1ab77d7
#compute file/path name
1ab77d7
tarfile=$1
1ab77d7
expandpath=${tarfile%.tar.xz}
1ab77d7
newtarfile="$litepkgname${tarfile#$pkgname}"
1ab77d7
1ab77d7
#prepare tmp directory
1ab77d7
rm -f $newtarfile
1ab77d7
mkdir ./tmp
1ab77d7
1ab77d7
pushd "./tmp"
1ab77d7
	tar xf ../$tarfile
1ab77d7
1ab77d7
	pushd "$expandpath/data"
1ab77d7
                # remove the skip code from kanjidic
1ab77d7
		sed -i 's/ P[0-9]*-[0-9]*-[0-9]*//g' kanjidic
1ab77d7
	popd
1ab77d7
1ab77d7
	tar Jcf ${newtarfile} $expandpath
1ab77d7
	rm -r $expandpath
1ab77d7
popd
1ab77d7
1ab77d7
mv ./tmp/$newtarfile .
1ab77d7
rmdir ./tmp