-
Notifications
You must be signed in to change notification settings - Fork 22
/
build-rpm
executable file
·44 lines (34 loc) · 920 Bytes
/
build-rpm
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/bash
if [ -z "$SRC_VERSION" ]; then
SRC_VERSION="$(./build-aux/gen-version)"
fi
if [ -z "$VERSION" ]; then
if [ -x build-aux/gen-version ]; then
VERSION="$(./build-aux/gen-version)"
elif [ -r .version ]; then
VERSION="$(cat .version)"
else
echo 'Please set $VERSION' >&2
exit 1
fi
fi
if [ -z "$RELEASE" ];then
echo 'Please set $RELEASE' >&2
exit 1
fi
rpmdev-setuptree
if [ -f metronome-${SRC_VERSION}.tar.bz2 ]; then
mv metronome-${SRC_VERSION}.tar.bz2 $HOME/rpmbuild/SOURCES
else
echo "metronome-${SRC_VERSION}.tar.bz2 not found" >&2
exit 1
fi
set -e
set -x
rm -rf /tmp/metronome.spec
cp -r metronome.spec /tmp
sed -i "s!@VERSION@!${VERSION}!" /tmp/metronome.spec
sed -i "s!@SRC_VERSION@!${SRC_VERSION}!" /tmp/metronome.spec
sed -i "s!@RELEASE@!${RELEASE}!" /tmp/metronome.spec
rpmbuild -bb /tmp/metronome.spec
cp $HOME/rpmbuild/RPMS/x86_64/metronome*-${VERSION}* .