Naresh Kamboju | b0ad7aa | 2016-11-10 00:33:43 +0530 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Fathi Boudra | 389e745 | 2016-12-08 17:45:37 +0200 | [diff] [blame] | 3 | # you should NOT be root - run following steps on CentOS as user |
| 4 | [ "$(whoami)" = "root" ] || { echo "E: You must be root" && exit 1; } |
Naresh Kamboju | b0ad7aa | 2016-11-10 00:33:43 +0530 | [diff] [blame] | 5 | |
| 6 | # sslverify=0 to be enabled in all repo files |
| 7 | # to work with yumdownloader --source |
| 8 | REPO_FILES="/etc/yum.repos.d/" |
| 9 | # shellcheck disable=SC2044 |
| 10 | for FILE in $(find "${REPO_FILES}"); do |
| 11 | sudo sed -i -e 's/sslverify=1/sslverify=0/g' "${FILE}" |
| 12 | done |
Naresh Kamboju | b0ad7aa | 2016-11-10 00:33:43 +0530 | [diff] [blame] | 13 | |
| 14 | # shellcheck disable=SC2164 |
| 15 | cd "${HOME}" |
Naresh Kamboju | b0ad7aa | 2016-11-10 00:33:43 +0530 | [diff] [blame] | 16 | |
Fathi Boudra | 389e745 | 2016-12-08 17:45:37 +0200 | [diff] [blame] | 17 | sudo yum clean all |
| 18 | sudo yum update -y |
| 19 | sudo yum install -y gcc make rpm-build yum-utils |
Naresh Kamboju | b0ad7aa | 2016-11-10 00:33:43 +0530 | [diff] [blame] | 20 | sudo yumdownloader --source openssl |
Fathi Boudra | 389e745 | 2016-12-08 17:45:37 +0200 | [diff] [blame] | 21 | sudo yum-builddep -y openssl |
| 22 | # no need to run tests as it's part of openssl package rebuild |
| 23 | sudo rpmbuild --rebuild openssl-*.src.rpm |