forked from bdbcat/oernc_pi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.sh
executable file
·69 lines (54 loc) · 1.89 KB
/
publish.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Launchpad publishing script
# Copyright 2012 - Pavel Kalian ([email protected])
# Licensed under the terms of GPLv2+
# Use it:
# a. $cd ~/Projects/ofc_pi
# b. edit publish.sh, change the version number
# c. $rm -rf /tmp/launchpad
# e. $./publish.sh "Beta Version 0.1.412"
# note that the script may use the [beta-ppa] or [ocpn-ppa]
VERSION=0.1.412
AUTHOR='Dave Register <[email protected]>'
DATE=`date -R`
SERIES=1
Ubuntus=('xenial' 'trusty' 'precise' 'bionic')
WORKDIR=/tmp/launchpad
BRANCH=master
MYDIR=`pwd`
if [ $# -lt 1 ] ; then
echo You must supply changelog message
exit 0
fi
mkdir $WORKDIR
git archive $BRANCH | tar -x -C $WORKDIR
rm -rf $WORKDIR/wxWidgets
rm -rf $WORKDIR/buildosx
rm -rf $WORKDIR/buildwin
rm -rf $WORKDIR/buildandroid
rm -rf $WORKDIR/build_debug
rm -rf $WORKDIR/build_no_local
rm -rf $WORKDIR/include/GL/
TOMOVE=`ls -d $WORKDIR/*`
mkdir $WORKDIR/ofc_pi
mv $TOMOVE $WORKDIR/ofc_pi
tar -cf $WORKDIR/ofc_pi_$VERSION.orig.tar -C $WORKDIR/ofc_pi .
cp $WORKDIR/ofc_pi_$VERSION.orig.tar $WORKDIR/ofc-pi_$VERSION.orig.tar
xz $WORKDIR/ofc-pi_$VERSION.orig.tar
cp -rf debian $WORKDIR/ofc_pi
read -p "Press [Enter] to publish (now it's time to apply patches manually if needed)"
for u in "${Ubuntus[@]}"
do
cat changelog.tpl|sed "s/VERSION/$VERSION/g"|sed "s/UBUNTU/$u/g"|sed "s/SERIES/$SERIES/g"|sed "s/MESSAGE/$1/g"|sed "s/AUTHOR/$AUTHOR/g"|sed "s/TIMESTAMP/$DATE/g" > $WORKDIR/dummy
cat $WORKDIR/ofc_pi/debian/changelog >> $WORKDIR/dummy
cp $WORKDIR/dummy $WORKDIR/ofc_pi/debian/changelog
cd $WORKDIR/ofc_pi
# -sa option forces the inclusion of the full source package as well as the changes
#debuild -sa -k0x2E50AC4A -S
debuild -k0x2E50AC4A -S
#dput -f ocpn-ppa ../ofc-pi_$VERSION-0~"$u""$SERIES"_source.changes
dput -f beta-ppa ../ofc-pi_$VERSION-0~"$u""$SERIES"_source.changes
cd $MYDIR
done
cp $WORKDIR/ofc_pi/debian/changelog debian
rm -rf $WORKDIR