Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
m1k1o
GitHub Repository: m1k1o/neko
Path: blob/master/utils/xorg-deps/xf86-input-neko/release.sh
1007 views
1
#!/bin/bash
2
: 'Copyright (C) 2017, Martin Kepplinger <[email protected]>
3
4
Permission is hereby granted, free of charge, to any person obtaining a
5
copy of this software and associated documentation files (the "Software"),
6
to deal in the Software without restriction, including without limitation
7
the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
and/or sell copies of the Software, and to permit persons to whom the Software
9
is furnished to do so, subject to the following conditions:
10
11
The above copyright notice and this permission notice shall be included in all
12
copies or substantial portions of the Software.
13
14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
THE SOFTWARE.'
21
22
# Script to build release-archives with. This requires a checkout from git.
23
# Before running it, change the version in configure.ac. Only do this. Do
24
# *not* commit this change. This script will do it.
25
26
# WARNING: This script is very dangerous! It may delete any untracked files.
27
28
have_version=0
29
30
usage()
31
{
32
echo "Usage: $0 -v version"
33
}
34
35
args=$(getopt -o v:s -- "$@")
36
if [ $? -ne 0 ] ; then
37
usage
38
exit 1
39
fi
40
eval set -- "$args"
41
while [ $# -gt 0 ]
42
do
43
case "$1" in
44
-v)
45
version=$2
46
have_version=1
47
shift
48
;;
49
--)
50
shift
51
break
52
;;
53
*)
54
echo "Invalid option: $1"
55
usage
56
exit 1
57
;;
58
esac
59
shift
60
done
61
62
# Do we have a desired version number?
63
if [ "$have_version" -gt 0 ] ; then
64
echo "trying to build version $version"
65
else
66
echo "please specify a version"
67
usage
68
exit 1
69
fi
70
71
# Version number sanity check
72
if grep ${version} configure.ac
73
then
74
echo "configurations seems ok"
75
else
76
echo "please check your configure.ac"
77
exit 1
78
fi
79
80
# Check that we are on master
81
branch=$(git rev-parse --abbrev-ref HEAD)
82
echo "we are on branch $branch"
83
84
if [ ! "${branch}" = "master" ] ; then
85
echo "you don't seem to be on the master branch"
86
exit 1
87
fi
88
89
if git diff-index --quiet HEAD --; then
90
# no changes
91
echo "there are no uncommitted changes (version bump)"
92
exit 1
93
fi
94
echo "======================================================"
95
echo " are you fine with the following version bump?"
96
echo "======================================================"
97
git diff
98
echo "======================================================"
99
read -p " Press enter to continue"
100
echo "======================================================"
101
102
./autogen.sh && ./configure && make distcheck
103
./autogen-clean.sh
104
git clean -d -f
105
106
git commit -a -m "xf86-input-neko ${version}"
107
git tag -s ${version} -m "xf86-input-neko ${version}"
108
109
./autogen.sh && ./configure && make distcheck
110
sha256sum xf86-input-neko-${version}.tar.xz > xf86-input-neko-${version}.tar.xz.sha256
111
sha256sum xf86-input-neko-${version}.tar.gz > xf86-input-neko-${version}.tar.gz.sha256
112
sha256sum xf86-input-neko-${version}.tar.bz2 > xf86-input-neko-${version}.tar.bz2.sha256
113
114
sha512sum xf86-input-neko-${version}.tar.xz > xf86-input-neko-${version}.tar.xz.sha512
115
sha512sum xf86-input-neko-${version}.tar.gz > xf86-input-neko-${version}.tar.gz.sha512
116
sha512sum xf86-input-neko-${version}.tar.bz2 > xf86-input-neko-${version}.tar.bz2.sha512
117
118
gpg -b -a xf86-input-neko-${version}.tar.xz
119
gpg -b -a xf86-input-neko-${version}.tar.gz
120
gpg -b -a xf86-input-neko-${version}.tar.bz2
121
122
123