Bug 1041480
Summary: | Unable to build EL7 package | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Miroslav Suchý <msuchy> |
Component: | mock | Assignee: | Clark Williams <williams> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | ajb, kevin, mebrown, pnemade, sgallagh, sgraf, toracat, williams |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-01-20 18:15:35 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Miroslav Suchý
2013-12-12 16:23:49 UTC
That error is cause because mock look for: /var/lib/mock/epel-7-x86_64/root/builddir/build/SPECS/*.spec while that spec reside in: /var/lib/mock/epel-7-x86_64/root/builddir/rpmbuild/SPECS/sssd.spec Any idea who is creating the 'rpmbuild' directory? Mock creates the 'builddir' directory under the chroot path as the homedir for the mockbuild user (the uid mock uses to build things as) and then creates the 'build' directory under that. So the question is: how is the 'rpmbuild' directory being created inside the chroot? Is it part of the SRPM install? No idea. But I can even reproduce it on Fedora 20. Take mock config from #0 and with: mock-1.1.35-1.fc20.noarch run: wget http://kojipkgs.fedoraproject.org//packages/mock/1.1.35/1.fc20/src/mock-1.1.35-1.fc20.src.rpm mock -r epel-7-x86_64 mock-1.1.35-1.fc20.src.rpm .... ERROR: No Spec file found in srpm: mock-1.1.35-1.fc20.src.rpm, /var/lib/mock/epel-7-x86_64/root/builddir/build/SPECS/*.spec, /builddir/build/originals/mock-1.1.35-1.fc20.src.rpm Mock just run: rpm -Uvh foo.src.rpm and as result it place spec file into $CHROOT/rpmbuild/SPECS/foo.spec My guess is that this is because of macro %{_topdir} which is defined as %{getenv:HOME}/rpmbuild. Mock redefine it (in util.py) to: '%_topdir': '%s/build' % config_opts['chroothome'], but this substitution probably does not happend on EL7. Or el7 override it. I do not know. SOLVED. This config works: config_opts['chroothome'] = '/builddir' config_opts['basedir'] = '/var/lib/mock' 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 bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-release-server redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' config_opts['dist'] = 'el7' # only useful for --resultdir variable subst config_opts['macros'] = {} config_opts['macros']['%_topdir'] = '/builddir/build' config_opts['macros']['%_rpmfilename'] = '%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' config_opts['plugin_conf']['root_cache_enable'] = False config_opts['plugin_conf']['yum_cache_enable'] = False config_opts['plugin_conf']['ccache_enable'] = False config_opts['yum.conf'] = """ [main] cachedir=/var/cache/yum debuglevel=1 logfile=/var/log/yum.log reposdir=/dev/null retries=20 obsoletes=1 gpgcheck=0 assumeyes=1 syslog_ident=mock syslog_device= # repos [beta] name=beta baseurl=http://ftp.redhat.com/redhat/rhel/beta/7/x86_64/os/ """ Good, closing. For the record. The following lines need to be added: config_opts['macros']['%dist'] = '.el7' config_opts['macros']['%rhel'] = '7' |