summaryrefslogtreecommitdiffstats
path: root/makesrc.sh
blob: 4e9292ba0a66566992549ea8a85096f5f1ca0ac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
NAME=$(basename $PWD)
VERSION=$(sed -n '/^Version:/{s/.* //;p}'           $NAME.spec)

if [ -f $NAME-$VERSION.tar.xz ]; then
	echo Already done
else
	echo "Cloning..."
	rm -rf $NAME-$VERSION
	git clone --recursive --depth 1 --shallow-submodules https://github.com/qelectrotech/qelectrotech-source-mirror.git --branch $VERSION $NAME-$VERSION

	echo "Archiving..."
	tar cJf $NAME-$VERSION.tar.xz --exclude-vcs $NAME-$VERSION

	echo "Cleaning..."
	rm -rf $NAME-$VERSION
fi