-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmake_rpm
More file actions
executable file
·44 lines (36 loc) · 820 Bytes
/
Copy pathmake_rpm
File metadata and controls
executable file
·44 lines (36 loc) · 820 Bytes
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
#!/bin/sh -e
if test -z "$1"
then
echo "usage: $0 ~/rpmbuild/SOURCES/mercury-srcdist-*.tar.gz"
exit 1
fi
tarball=$1
if test ! -f "$tarball"
then
echo "Expected source tarball: $tarball" 1>&2
exit 1
fi
base=$( basename $tarball )
base=${base%.tar.*}
version=${base#mercury-srcdist-}
case $version in
rotd-2[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])
;;
[0-9][0-9]*-beta-*)
;;
[0-9][0-9].[0-9][0-9]*)
;;
*)
echo "Could not extract version from filename: $tarball" 1>&2
exit 1
;;
esac
echo "Version $version"
version_with_underscores=${version//-/_}
echo "Building binary package:"
rpmbuild -bb mercury-compiler.spec \
-D"VERSION $version" \
-D"VERSION_WITH_UNDERSCORES ${version_with_underscores}"
echo "done."
exit 0
# vim: set et: