diff options
author | J Pipkin <j@dawnrazor.net> | 2013-01-16 03:52:56 -0600 |
---|---|---|
committer | J Pipkin <j@dawnrazor.net> | 2013-01-16 03:52:56 -0600 |
commit | 09fc8036c8ec387615facad8c627e3d91e0f0555 (patch) | |
tree | 2644d8ffeb5a8530ae6fe1356b9614b8d1139299 /tools | |
parent | 3d800e14030c226430f36082e9d88efb2e62fd64 (diff) | |
download | sbotools-09fc8036c8ec387615facad8c627e3d91e0f0555.tar.xz |
package_up.sh, generate separate source and slackbuild tarballs
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/package_up.sh | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/tools/package_up.sh b/tools/package_up.sh index a33f1f4..8a16933 100755 --- a/tools/package_up.sh +++ b/tools/package_up.sh @@ -26,7 +26,9 @@ trap "cleanup $TMP_DIR; exit 2" INT TERM EXIT TMP_DIR=$(mktemp -d /tmp/$PACKAGE.XXXXXXXXXXXX) PKG_DIR=$TMP_DIR/$PACKAGE-$VERSION +SBO_DIR=$TMP_DIR/$PACKAGE mkdir $PKG_DIR +mkdir $SBO_DIR for i in $(ls $PKG_HOME); do cp -R $PKG_HOME/$i $PKG_DIR @@ -38,31 +40,27 @@ fi if [[ -d $PKG_DIR/tools ]]; then rm -rf $PKG_DIR/tools fi +if [[ -d $PKG_DIR/slackbuild/$PACKAGE ]]; then + if [[ -f $PKG_DIR/slackbuild/$PACKAGE/README ]]; then + cp $PKG_DIR/slackbuild/$PACKAGE/README $PKG_DIR/ + fi + mv $PKG_DIR/slackbuild/$PACKAGE/* $SBO_DIR + rm -rf $PKG_DIR/slackbuild + (cd $TMP_DIR + tar cjf $PACKAGE.tar.bz2 $PACKAGE/ + ) + mv $TMP_DIR/$PACKAGE.tar.bz2 $HOME/SBo/ +fi + -find $PKG_DIR -type f -name \*~ -exec rm {} \; +find $TMP_DIR -type f -name \*~ -exec rm {} \; -FILENAME=$PACKAGE-$VERSION.tar.xz +FILENAME=$PACKAGE-$VERSION.tar.gz (cd $TMP_DIR - tar cJf $FILENAME $PACKAGE-$VERSION/ + tar czf $FILENAME $PACKAGE-$VERSION/ cp $FILENAME $HOME ) -(cd $HOME - tar xf $FILENAME -) - -if [[ ! -d $HOME/$PACKAGE ]]; then - echo "Unable to find the slackbuild directory." - cleanup $TMP_DIR - exit 1 -fi - -mv $TMP_DIR/$FILENAME $HOME/$PACKAGE -OUTFILE=$PACKAGE-$VERSION.tar - -(cd $HOME - tar cf $OUTFILE $PACKAGE -) cleanup $TMP_DIR exit 0 |