Support CentOS 5
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 4 Jan 2017 09:25:47 +0000 (10:25 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 4 Jan 2017 09:25:47 +0000 (10:25 +0100)
id-deb-build/docker-build.sh
id-deb-build/in-docker-rpm.sh

index aa39fb4..b4ad44d 100755 (executable)
@@ -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 "
index fa41656..78a12ad 100755 (executable)
@@ -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=$?