From 7416bc79cf9d2afda42502d79e03bf0edfe514cb Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 27 Jul 2017 13:57:11 +0000 Subject: [PATCH 1/2] provide mock configuration file This adds the ability to build CentOS packages from Fedora - scylla already has it. Aside from that, this guarantees that the build will work in any system. In particular, by default rpmbuild is not given network access in some of the systems I tested, causing the build to fail as it tries to contact the maven repo. This file is just a copy of the one provided by Centos' mock, with the option to allow rpmbuild network added. Signed-off-by: Glauber Costa --- dist/redhat/mock/scylla-jmx-epel-7-x86_64.cfg | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 dist/redhat/mock/scylla-jmx-epel-7-x86_64.cfg diff --git a/dist/redhat/mock/scylla-jmx-epel-7-x86_64.cfg b/dist/redhat/mock/scylla-jmx-epel-7-x86_64.cfg new file mode 100644 index 0000000..4696847 --- /dev/null +++ b/dist/redhat/mock/scylla-jmx-epel-7-x86_64.cfg @@ -0,0 +1,72 @@ +config_opts['root'] = 'epel-7-x86_64' +config_opts['target_arch'] = 'x86_64' +config_opts['legal_host_arches'] = ('x86_64',) +config_opts['chroot_setup_cmd'] = 'install @buildsys-build' +config_opts['dist'] = 'el7' # only useful for --resultdir variable subst +config_opts['releasever'] = '7' +config_opts['rpmbuild_networking'] = True + +config_opts['yum.conf'] = """ +[main] +keepcache=1 +debuglevel=2 +reposdir=/dev/null +logfile=/var/log/yum.log +retries=20 +obsoletes=1 +gpgcheck=0 +assumeyes=1 +syslog_ident=mock +syslog_device= +mdpolicy=group:primary +best=1 + +# repos +[base] +name=BaseOS +mirrorlist=http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os +failovermethod=priority +gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7 +gpgcheck=1 + +[updates] +name=updates +enabled=1 +mirrorlist=http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates +failovermethod=priority +gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7 +gpgcheck=1 + +[epel] +name=epel +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=x86_64 +failovermethod=priority +gpgkey=file:///usr/share/distribution-gpg-keys/epel/RPM-GPG-KEY-EPEL-7 +gpgcheck=1 + +[extras] +name=extras +mirrorlist=http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras +failovermethod=priority +gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-7 +gpgcheck=1 + +[testing] +name=epel-testing +enabled=0 +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel7&arch=x86_64 +failovermethod=priority + + +[local] +name=local +baseurl=https://kojipkgs.fedoraproject.org/repos/epel7-build/latest/x86_64/ +cost=2000 +enabled=0 + +[epel-debuginfo] +name=epel-debug +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-7&arch=x86_64 +failovermethod=priority +enabled=0 +""" From 566a4f26391f47af31195c6fdd06b0d839498501 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 27 Jul 2017 16:00:45 +0000 Subject: [PATCH 2/2] default to our in-tree mock config when building on CentOS scylla.git does a similar thing, albeit in a more complicated fashion, testing for whether or not a rebuild is asked for and etc. For us, the build process is a lot simpler, so it is better to just point to the file when we detect that we are on CentOS and no explicit target is given. Signed-off-by: Glauber Costa --- dist/redhat/build_rpm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/redhat/build_rpm.sh b/dist/redhat/build_rpm.sh index ba6aea1..8d19c6e 100755 --- a/dist/redhat/build_rpm.sh +++ b/dist/redhat/build_rpm.sh @@ -43,7 +43,7 @@ if [ "$(arch)" != "x86_64" ]; then fi if [ -z "$TARGET" ]; then if [ "$ID" = "centos" -o "$ID" = "rhel" ] && [ "$VERSION_ID" = "7" ]; then - TARGET=epel-7-x86_64 + TARGET=./dist/redhat/mock/scylla-jmx-epel-7-x86_64.cfg elif [ "$ID" = "fedora" ]; then TARGET=$ID-$VERSION_ID-x86_64 else