Can now make deb/rpm with Docker
[git-tools-moved-to-github.git] / id-deb-build / in-docker-rpm.sh
diff --git a/id-deb-build/in-docker-rpm.sh b/id-deb-build/in-docker-rpm.sh
new file mode 100755 (executable)
index 0000000..8f915a5
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+# in-docker-rpm.sh
+
+set -x
+DIST=$1
+STEP=$2
+
+yum install -y wget yum-utils rpm-build gcc gcc-c++ make
+
+rpm --import http://ftp.indexdata.com/pub/yum/centos/$STEP/RPM-GPG-KEY-indexdata
+
+wget http://ftp.indexdata.com/pub/yum/centos/$STEP/indexdata.repo -P /etc/yum.repos.d/
+
+echo "%_topdir /build/rpmbuild" >$HOME/.rpmmacros
+echo "%_source_filedigest_algorithm   0" >>$HOME/.rpmmacros
+echo "%_binary_filedigest_algorithm   0" >>$HOME/.rpmmacros
+
+yum-builddep -y SPECS/*.spec
+
+rpmbuild -ba SPECS/*.spec
+
+RET=$?
+
+exit $RET
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 4
+# sh-basic-offset: 4
+# End:
+