-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
build_rpm.sh
executable file
·134 lines (122 loc) · 2.73 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/sh
NAME=check_rbl
VERSION=$(grep "our\ \$VERSION\ =\ " "${NAME}" | sed "s/^[^']*'\([0-9.]*\)';/\1/")
TARBALL="${NAME}-${VERSION}.tar.gz"
# delete current distribution
rm -f "${TARBALL}"
# build a new tarball
make dist
# build the RPMs
OUT=$(rpmbuild -ta "${TARBALL}" 2>&1 | grep ^Wrote)
echo "${OUT}"
RPM=$(echo "${OUT}" | grep /RPMS | grep -v debug | sed 's/.*\ //')
SRPM=$(echo "${OUT}" | grep SRPMS | sed 's/.*\ //')
echo "RPM: ${RPM}"
echo "SRPM: ${SRPM}"
ARCH=$(echo "${RPM}" | sed 's/\.rpm$//' | sed 's/.*\.//')
DIST=$(echo "${SRPM}" | sed 's/\.src\.rpm$//' | sed 's/.*\.//')
echo "arch: ${ARCH}"
echo "dist: ${DIST}"
WEBROOT=/var/www/rpm
case ${DIST} in
fc30)
RPMDIR="${WEBROOT}/fedora/30/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/30/SRPMS"
DIST='fedora'
RELEASE='30'
;;
fc31)
RPMDIR="${WEBROOT}/fedora/31/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/31/SRPMS"
DIST='fedora'
RELEASE='31'
;;
fc32)
RPMDIR="${WEBROOT}/fedora/32/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/32/SRPMS"
DIST='fedora'
RELEASE='32'
;;
fc33)
RPMDIR="${WEBROOT}/fedora/33/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/33/SRPMS"
DIST='fedora'
RELEASE='33'
;;
fc34)
RPMDIR="${WEBROOT}/fedora/34/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/34/SRPMS"
DIST='fedora'
RELEASE='34'
;;
fc35)
RPMDIR="${WEBROOT}/fedora/35/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/35/SRPMS"
DIST='fedora'
RELEASE='35'
;;
fc36)
RPMDIR="${WEBROOT}/fedora/36/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/36/SRPMS"
DIST='fedora'
RELEASE='36'
;;
fc37)
RPMDIR="${WEBROOT}/fedora/37/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/37/SRPMS"
DIST='fedora'
RELEASE='37'
;;
fc38)
RPMDIR="${WEBROOT}/fedora/38/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/38/SRPMS"
DIST='fedora'
RELEASE='38'
;;
fc39)
RPMDIR="${WEBROOT}/fedora/39/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/39/SRPMS"
DIST='fedora'
RELEASE='39'
;;
fc40)
RPMDIR="${WEBROOT}/fedora/40/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/40/SRPMS"
DIST='fedora'
RELEASE='40'
;;
fc41)
RPMDIR="${WEBROOT}/fedora/41/${ARCH}"
SRPMDIR="${WEBROOT}/fedora/41/SRPMS"
DIST='fedora'
RELEASE='41'
;;
el7)
RPMDIR="${WEBROOT}/epel/7/${ARCH}"
SRPMDIR="${WEBROOT}/epel/7/SRPMS"
DIST='epel'
RELEASE='7'
;;
el8)
RPMDIR="${WEBROOT}/epel/8/${ARCH}"
SRPMDIR="${WEBROOT}/epel/8/SRPMS"
DIST='epel'
RELEASE='8'
;;
*)
echo "Unknown distribution ${DIST}" 1>&2
exit 1
;;
esac
echo "RPMDIR: ${RPMDIR}"
echo "SRPMDIR: ${SRPMDIR}"
echo "RPM: ${RPM}"
echo "SRPM: ${SRPM}"
echo "DIST: ${DIST}"
echo "RELEASE: ${RELEASE}"
export RPMDIR
export SRPMDIR
export RPM
export SRPM
export DIST
export RELEASE