-
Notifications
You must be signed in to change notification settings - Fork 3
/
pull_github.sh
executable file
·32 lines (27 loc) · 781 Bytes
/
pull_github.sh
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
#!/bin/sh
#
# pull a file from github and make it a tar ball for RPM and DEB builds
#
# 2014,2016 [email protected]
set -x
tstamp=$(date +"%Y%m%d")
source=$(grep Source0: *.spec)
set $source
source=$2
name=showspeed
srcname=showspeed.pl
rm $srcname
# if there is no url in the specfile, use this:
if [ "$source" == "$srcname" ]; then
source="https://raw.githubusercontent.com/jnweiger/$name/master/$srcname"
fi
set -x
wget $source -O $srcname
version=$(perl ./$srcname --version 2>&1)
sed -i -e "s@^\(Version:\s*\).*@\1"$version"@" *.spec
sed -i -e "s@^\(pkgver=\s*\).*@\1"$version"@" PKGBUILD
sed -i -e "s@^\(Version:\s*\).*@\1"$version-$tstamp"@" *.dsc
tar zcvf $name.tar.gz $srcname COPYING
set +x
osc vc -m "Version $version -- $0"
echo Try: debchange -mc debian.changelog