-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_rpm.sh
56 lines (40 loc) · 1.09 KB
/
build_rpm.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
#!/bin/bash
set -e
MAKEINSTALLED=`rpm -qa | grep make | wc -l`
if [ "$MAKEINSTALLED" -eq 0 ]
then
echo "Make must be installed. Please execute: sudo yum install make"
exit
fi
AUTOCONFINSTALLED=`rpm -qa | grep autoconf | wc -l`
if [ "$AUTOCONFINSTALLED" -eq 0 ]
then
echo "Autoconf must be installed. Please execute: sudo yum install autoconf"
exit
fi
LIBTOOLINSTALLED=`rpm -qa | grep libtool | wc -l`
if [ "$LIBTOOLINSTALLED" -eq 0 ]
then
echo "libtool must be installed. Please execute: sudo yum install libtool"
exit
fi
RPMBUILDINSTALLED=`rpm -qa | grep rpm-build | grep -v rpm-build-libs | wc -l`
if [ "$RPMBUILDINSTALLED" -eq 0 ]
then
echo "rpm-build must be installed. Please execute: sudo yum install rpm-build"
exit
fi
if [ ! -d "$HOME/rpmbuild" ]
then
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
fi
chmod +x autogen
./autogen
make
make dist-gzip
THISDIR=`pwd`
cp SPECS/help-channel-server.spec $HOME/rpmbuild/SPECS/help-channel-server.spec
cp help-channel-server-*.tar.gz $HOME/rpmbuild/SOURCES/.
cd $HOME/rpmbuild/SPECS
rpmbuild -ba help-channel-server.spec
echo "END ;)"