This should allow people to build from git repositories that have a
different structure than Fedora (they still need some magic with
source_cmd). The patch is not too intrusive and can be set per
Let me know if it can be considered for inclusion. I am happy to rework it.
diff --git a/builder/kojid b/builder/kojid
index b3d0d1c..89f9474 100755
@@ -3292,7 +3292,7 @@ class BuildSRPMFromSCMTask(BaseBuildTask):
self.patch_scm_source(sourcedir, logfile, opts)
# Find and verify that there is only one spec file.
- spec_files = glob.glob("%s/*.spec" % sourcedir)
+ spec_files = glob.glob("%s/%s*.spec" % (sourcedir, scm.spec_path))
if len(spec_files) == 0:
raise koji.BuildError("No spec file found")
elif len(spec_files) > 1:
diff --git a/koji/daemon.py b/koji/daemon.py
index 205f62e..68af212 100644
@@ -200,6 +200,7 @@ class SCM(object):
- use_common (defaults to True, may be set by assert_allowed())
- source_cmd (defaults to ['make', 'sources'], may be set by
+ - spec_path
The exact format of each attribute is SCM-specific, but the
structure of the url
must conform to the template above, or an error will be raised.
@@ -220,6 +221,7 @@ class SCM(object):
self.revision = fragment
self.use_common = True
self.source_cmd = ['make', 'sources']
+ self.spec_path = '/'
for scmtype, schemes in SCM.types.items():
if self.scheme in schemes:
@@ -311,6 +313,10 @@ class SCM(object):
# there was nothing after the trailing :,
so they don't want to run a source_cmd at all
self.source_cmd = None
+ # check if spec path is defined
+ if len(scm_tuple) >= 5:
+ if scm_tuple:
+ self.spec_path = scm_tuple + '/'
self.logger.warn('Ignoring incorrectly formatted SCM
host:repository: %s' % allowed_scm)
I wrote a wrapper for rpkg to assist in our internal RPM builds, and while doing so I fixed a few bugs and added some minor features. Might someone review them and consider them for inclusion upstream?
after the proof of concept I posted about some months ago I elaborated
a little on the topic.
Pre-release version 0.9 can be found here:
What does it do?
It uses docker to build a native rpm from a source directory holding a
.spec and source/patch files; it's VERY useful in CI environments,
wherever you need to build an RPM as your final product.
At the moment is still a bit rough, but it's very small and it should
be very easy to make it fit to anyone's needs.
Advantages over plain mock:
- work on any host distribution as long as it supports docker;
- doesn't require the creation of a source rpm before building a binary
- as far as I have been testing, it's much faster.
If anybody tries it and thinks it's worth contributing, contact me
and/or open tickets or pull request on github.
My development blog: ollivander.franzoni.eu . @franzeur on Twitter
contact me at public(a)[mysurname].eu
Just installed my first EL7 koji slave and merge repo is kicking out
Traceback (most recent call last):
File "/usr/libexec/kojid/mergerepos", line 276, in <module>
File "/usr/libexec/kojid/mergerepos", line 271, in main
File "/usr/libexec/kojid/mergerepos", line 251, in write_metadata
File "/usr/lib/python2.7/site-packages/createrepo/__init__.py", line 404, in doPkgMetadata
if '://' in pkg: # remote
File "/usr/lib/python2.7/site-packages/yum/packages.py", line 384, in __getitem__
return getattr(self, key)
TypeError: getattr(): attribute name must be string
Figured I'd pass it along....
Scientific Linux developer