File update.sh of Package rtklib-beta

#! /bin/bash

BRANCH=rtklib_2.4.3
#BRANCH=master

NAME=rtklib
git clone --depth 1 --single-branch --branch ${BRANCH} https://github.com/tomojitakasu/RTKLIB/ ${NAME}
osc rm $NAME-*.tar.bz2
pushd ${NAME}
VER=`cat src/rtklib.h | sed -n 's/.*VER_RTKLIB  "\(.*\)".*/\1/p;s/.*PATCH_LEVEL "\(.*\)".*/.\1/p' | sed ':a;N;$!ba;s/\n//g'`
ARC=$NAME-$VER.tar.bz2
git archive --prefix=$NAME-$VER/ ${BRANCH} | bzip2 >../$ARC
popd
echo "New version $VER"
sed -i "s/\(Version: \+\).\+/\1$VER/" $NAME.spec
rm -rf $NAME
osc add $ARC

NAME=rtklib-bin
git clone --depth 1 --single-branch --branch ${BRANCH} https://github.com/tomojitakasu/RTKLIB_bin/ ${NAME}
osc rm $NAME-*.tar.bz2
pushd ${NAME}
# take version from above
ARC=$NAME-$VER.tar.bz2
git archive --prefix=$NAME-$VER/ ${BRANCH} | bzip2 >../$ARC
popd
rm -rf $NAME
osc add $ARC
openSUSE Build Service is sponsored by