| |
@@ -715,6 +715,8 @@
|
| |
|
| |
self.section_changelog = defaultChangelogFormat%(version, release)
|
| |
|
| |
+ self.specbasename = None
|
| |
+
|
| |
def get_base_dir(self):
|
| |
return "test-rpmbuild-%s-%s-%s"%(self.name, self.version, expand_macros(self.release))
|
| |
|
| |
@@ -784,6 +786,10 @@
|
| |
"Set URL"
|
| |
self.url = urlName
|
| |
|
| |
+ def addSpecBasename(self, name):
|
| |
+ "Set spec file basename to NAME for NAME.spec"
|
| |
+ self.specbasename = name
|
| |
+
|
| |
def add_pre(self, preLine):
|
| |
"Append a line to the %pre script section of this package"
|
| |
self.section_pre += preLine
|
| |
@@ -802,7 +808,10 @@
|
| |
|
| |
def gather_spec_file(self, tmpDir):
|
| |
import codecs
|
| |
- specFileName = os.path.join(tmpDir, "%s.spec"%self.name)
|
| |
+ if self.specbasename and self.specbasename != '':
|
| |
+ specFileName = os.path.join(tmpDir, "%s.spec" % self.specbasename)
|
| |
+ else:
|
| |
+ specFileName = os.path.join(tmpDir, "%s.spec"%self.name)
|
| |
specFile = codecs.open(specFileName, "wb", self.specfileEncoding)
|
| |
specFile.write(self.header)
|
| |
specFile.write("Summary: %s\n"%self.basePackage.summary)
|
| |
This is to support a test case I want to have in rpminspect. Per
packaging policy in Fedora, we require the SRPM file spec file basename
to match the package name. For example, the gcc package must come with
a gcc.spec file, not gcc-is-a-compiler.spec file. With this patch you
can do:
And override the default spec filename generated from using self.name
to the text you provide.