From 829168df8a902ff17d0c2cf02f5d9027ec407d99 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 4 Jan 2017 10:25:47 +0100 Subject: [PATCH] Support CentOS 5 --- id-deb-build/docker-build.sh | 23 +++++++++++++++-------- id-deb-build/in-docker-rpm.sh | 6 ++++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/id-deb-build/docker-build.sh b/id-deb-build/docker-build.sh index aa39fb4..b4ad44d 100755 --- a/id-deb-build/docker-build.sh +++ b/id-deb-build/docker-build.sh @@ -92,18 +92,20 @@ if $upload; then if $centos; then for dist in ${CENTOS_DIST}; do case $dist in + centos5) + F=5.5;; centos6) - D=6;; + F=6;; centos7) - D=7;; + F=7;; *) echo "$dist not supported" exit 1 esac - ssh ${UPLOAD_HOST} "mkdir -p ${UPLOAD_PATH}/${PRODUCT}/redhat/centos/$D/RPMS" - ssh ${UPLOAD_HOST} "mkdir -p ${UPLOAD_PATH}/${PRODUCT}/redhat/centos/$D/SRPMS" - scp -r build/centos/$dist/rpmbuild/RPMS ${UPLOAD_URI}/redhat/centos/$D - scp -r build/centos/$dist/rpmbuild/SRPMS ${UPLOAD_URI}/redhat/centos/$D + ssh ${UPLOAD_HOST} "mkdir -p ${UPLOAD_PATH}/${PRODUCT}/redhat/centos/$F/RPMS" + ssh ${UPLOAD_HOST} "mkdir -p ${UPLOAD_PATH}/${PRODUCT}/redhat/centos/$F/SRPMS" + scp -r build/centos/$dist/rpmbuild/RPMS ${UPLOAD_URI}/redhat/centos/$F + scp -r build/centos/$dist/rpmbuild/SRPMS ${UPLOAD_URI}/redhat/centos/$F done if ! ssh ${UPLOAD_HOST} "sudo -n /home/indexdata/proj/git-tools/update-archive/update-yum-archive.sh" >yum-update.log 2>&1; then echo "update-yum-archive.sh failed; inspect yum-update.log" @@ -205,9 +207,14 @@ fi if test "${CENTOS_DIST}"; then for dist in ${CENTOS_DIST}; do case $dist in + centos5) + F=5.5 + D=5;; centos6) + F=6 D=6;; centos7) + F=7 D=7;; *) echo "$dist not supported" @@ -217,8 +224,8 @@ if test "${CENTOS_DIST}"; then echo "FROM centos:$D" >Dockerfile echo "RUN yum install -y wget yum-utils rpm-build gcc gcc-c++ make" >>Dockerfile - echo "RUN rpm --import http://ftp.indexdata.com/pub/yum/centos/$D/RPM-GPG-KEY-indexdata" >>Dockerfile - echo "RUN wget http://ftp.indexdata.com/pub/yum/centos/$D/indexdata.repo -P /etc/yum.repos.d/" >>Dockerfile + echo "RUN rpm --import http://ftp.indexdata.com/pub/yum/centos/$F/RPM-GPG-KEY-indexdata" >>Dockerfile + echo "RUN wget http://ftp.indexdata.com/pub/yum/centos/$F/indexdata.repo -P /etc/yum.repos.d/" >>Dockerfile echo 'ENTRYPOINT ["/bin/sh", "-c"]' >>Dockerfile docker build -t indexdata-build-centos-$D . echo -n "$dist " diff --git a/id-deb-build/in-docker-rpm.sh b/id-deb-build/in-docker-rpm.sh index fa41656..78a12ad 100755 --- a/id-deb-build/in-docker-rpm.sh +++ b/id-deb-build/in-docker-rpm.sh @@ -11,9 +11,11 @@ echo "%_binary_filedigest_algorithm 0" >>$HOME/.rpmmacros groupadd -g 1000 bob useradd -u 1000 -g bob bob -yum-builddep -y SPECS/*.spec +rpmbuild -bs --nodeps SPECS/*.spec -rpmbuild -ba SPECS/*.spec +yum-builddep -y SRPMS/*.src.rpm + +rpmbuild -bb SPECS/*.spec RET=$? -- 1.7.10.4