summaryrefslogtreecommitdiffstats
path: root/cpgx/make-tarball
blob: 925c78f96bed3d1c6b2a45e447ac94793443331c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

# to release
# edit VERSION with new number and without -git
# edit cpgx.spec with new version numbers
# commit changes to VERSION and cpgx.spec
# make tarball (uses commited VERSION and cpgx.spec)
# edit VERSION adding -git
# commit VERSION change
# push

WC=`git diff | wc -l`

if [ "$WC" != "0" ]
then
	echo "error uncommited changes"
	exit 2
fi

VER=`cat VERSION`

VER2=`awk '/^Version:/ { print $2 }' < cpgx.spec`

if [ "$VER" != "$VER2" ]
then
	echo "error VERSION = $VER, cpgx.spec = $VER2"
	exit 2
fi

echo "version $VER"

git archive --format=tar --prefix=cpgx-$VER/ HEAD^{tree} | gzip > cpgx-$VER.tar.gz

# rpmbuild -ts cpgx-1.0.tar.gz --define "dist .el5"
# brew build --scratch --skip-tag dist-5E-eso cpgx-1.0-1.el5.src.rpm