summaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2016-12-08 17:45:37 +0200
committerFathi Boudra <fathi.boudra@linaro.org>2016-12-08 15:49:06 +0000
commit389e7455da6d7872fc24f7690f945f0af5c121bc (patch)
treebea6f6853fdd71a4e27bf7efefd3f07d01f8b904 /manual
parentb5045414d4d8a3e818d35b84b63c1c9dd6f144e9 (diff)
downloadtest-definitions-pipe-389e7455da6d7872fc24f7690f945f0af5c121bc.tar.gz
manual: openssl-centos: rewrite openssl rebuild on CentOS
We don't need to run the tests since it's run as part of the package itself. Change-Id: Iddd7a1f2bcfcc1c2e72a6a51aba66acc6f78d78a Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'manual')
-rwxr-xr-xmanual/generic/linux/openssl-centos.sh59
1 files changed, 8 insertions, 51 deletions
diff --git a/manual/generic/linux/openssl-centos.sh b/manual/generic/linux/openssl-centos.sh
index 3f5eff4..b8b992c 100755
--- a/manual/generic/linux/openssl-centos.sh
+++ b/manual/generic/linux/openssl-centos.sh
@@ -1,12 +1,7 @@
#!/bin/sh
-# you should NOT be root
-# run following steps on CentOS as user
-sudo yum -y update
-# build dependencies
-sudo yum -y install autoconf automake binutils bison flex gcc gcc-c++ gettext \
- libtool sed make patch pkgconfig redhat-rpm-config rpm-build \
- diffutils coreutils glibc-static yum-utils
+# you should NOT be root - run following steps on CentOS as user
+[ "$(whoami)" = "root" ] || { echo "E: You must be root" && exit 1; }
# sslverify=0 to be enabled in all repo files
# to work with yumdownloader --source
@@ -15,52 +10,14 @@ REPO_FILES="/etc/yum.repos.d/"
for FILE in $(find "${REPO_FILES}"); do
sudo sed -i -e 's/sslverify=1/sslverify=0/g' "${FILE}"
done
-sudo yum -y clean all
-
-# install openssl dependencies
-sudo yum -y install perl openssl-devel krb5-devel zlib-devel
-
-mkdir -p "${HOME}"/rpmbuild/BUILD
-mkdir -p "${HOME}"/rpmbuild/RPMS
-mkdir -p "${HOME}"/rpmbuild/SOURCES
-mkdir -p "${HOME}"/rpmbuild/SPECS
-mkdir -p "${HOME}"/rpmbuild/SRPMS
-
-echo "%_topdir %(echo $HOME)/rpmbuild" > ~/.rpmmacros
# shellcheck disable=SC2164
cd "${HOME}"
-# build and install lksctp-tools
-sudo yumdownloader --source lksctp-tools
-
-# get version and release of lksctp-tools
-SCTP_VERSION=$(sudo yum info lksctp-tools | grep Version | head -1| awk '{print $3}')
-SCTP_RELEASE=$(sudo yum info lksctp-tools | grep Release | head -1| awk '{print $3}')
-rpmbuild --recompile lksctp-tools-"${SCTP_VERSION}""-""${SCTP_RELEASE}".src.rpm
-# shellcheck disable=SC2164
-cd "${HOME}""/rpmbuild/BUILD/lksctp-tools-""${SCTP_VERSION}"/
-sudo make install
-
-# shellcheck disable=SC2164
-cd "${HOME}"
+sudo yum clean all
+sudo yum update -y
+sudo yum install -y gcc make rpm-build yum-utils
sudo yumdownloader --source openssl
-
-# get version and release of openssl
-SSL_VERSION=$(sudo yum info openssl | grep Version | awk '{print $3}')
-SSL_RELEASE=$(sudo yum info openssl | grep Release | awk '{print $3}')
-# run below step, you could see list of dependencies not met and exit
-rpmbuild --rebuild openssl-"${SSL_VERSION}""-""${SSL_RELEASE}".src.rpm
-
-# shellcheck disable=SC2164
-cd "${HOME}"/rpmbuild/SPECS/
-
-sed -i -e 's/BuildRequires: lksctp-tools-devel/# BuildRequires: lksctp-tools-devel/g' openssl.spec
-# build will start from this command
-rpmbuild -ba openssl.spec
-
-# shellcheck disable=SC2164
-cd "${HOME}""/rpmbuild/BUILD/openssl-""${SSL_VERSION}"/
-make
-sudo make install
-make tests
+sudo yum-builddep -y openssl
+# no need to run tests as it's part of openssl package rebuild
+sudo rpmbuild --rebuild openssl-*.src.rpm