forked from IndySockets/Indy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeindyrpm.sh
executable file
·42 lines (38 loc) · 1.43 KB
/
makeindyrpm.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
#!/bin/sh
set -x
#set -e
echo "Extracting Program and RPM Values:"
INDYVERSION=10.2.0.1
# You actually should use three version values.
# FPCVer is for the value reported by fpc for some path specs.
# FPCRPMVER is used for our "Requires section so that this is
# tied to the EXACT version of the fpc RPM you used to build
# this.
# FPCSRCRPMVER is used for our "Requires section so that this
# is tied to the EXACT version of the fpc-src RPM you used
# you have to prevent errors.
INDYRELNO=8
FPCVER=`fpc -iV`
FPCRPMVER=$(rpm -qa | egrep '^fpc-[0-9]')
FPCRPMVER=${FPCRPMVER:4}
FPCSRCRPMVER=$(rpm -qa | egrep '^fpc-src-[0-9]')
FPCSRCRPMVER=${FPCSRCRPMVER:8}
echo "FPC Version: $FPCVER"
echo "FPC RPM Ver: $FPCRPMVER"
echo "FPCSRC RPM Ver: $FPCSRCRPMVER"
echo "making tarball"
#rm indy-$INDY_Version.tar.bz2
tar jcf indy-$INDYVERSION.tar.bz2 .
pwd
echo "copying tarball to ~/rpmbuild/SOURCES"
cp indy-$INDYVERSION.tar.bz2 ~/rpmbuild/SOURCES
echo "Making RPM spec file"
cat indy-fpc.spec.template| \
sed -e "s/^%define _FPC_Version .*/%define _FPC_Version $FPCVER/" \
-e "s/^%define _FPC_RPM_Ver .*/%define _FPC_RPM_Ver $FPCRPMVER/" \
-e "s/^%define _FPC_SRC_RPM_Ver .*/%define _FPC_SRC_RPM_Ver $FPCSRCRPMVER/" \
-e "s/^Version: .*/Version: $INDYVERSION/" \
-e "s/^Release: .*/Release: $INDYRELNO/" \
> indy-fpc.spec
echo "Building RPM"
rpmbuild -bb -v indy-fpc.spec