forked from matteocorti/check_ssl_cert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_rpm.sh
executable file
·94 lines (85 loc) · 1.87 KB
/
prepare_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
#!/bin/sh
echo "Building the RPMs"
OUT=$(make rpm 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'
;;
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