File pre_checkin.sh of Package gdk-pixbuf

#!/bin/sh

# To update the package:
## 1. update the version tags in _service
## 2. run `osc service ra`;                # get the upstream release, and set the version string in spec
## 3. run `./pre_checkin.sh`;              # generate the zip file
## 4. edit changelog and commit the change # the tar.xz file generated by the step 2 is not necessarily to commit

EXTRACTDIR=$(mktemp -d);
BASENAME=$(grep ^Name\: gdk-pixbuf.spec | cut -d: -f2 | sed 's/[[:space:]]//g');
VERSION=$(grep ^Version\: gdk-pixbuf.spec | cut -d: -f2 | sed 's/[[:space:]]//g');

tar xvfJ $BASENAME-$VERSION.tar.xz -C $EXTRACTDIR;
pushd $EXTRACTDIR/$BASENAME-$VERSION && zip -r -P gecko $BASENAME-$VERSION.zip * && popd && mv $EXTRACTDIR/$BASENAME-$VERSION/$BASENAME-$VERSION.zip .;
rm -fr $EXTRACTDIR && rm -fr $BASENAME-$VERSION.tar.xz;
openSUSE Build Service is sponsored by