On Saturday 27 March 2010 14:30:12 Pierre-Yves wrote: > I have just put together a version 0.7 which give the option to use mock > to build the rpm. > See R2rpm for the usage. > > Feel free to poke me if it doesn't work for you. Nice work, I am testing it now and it has really improved a lot. :-) I use the attached patch to get the %{name} translation right. I notice that when searching the package (passed with -p) the repository is ignored if passed. R2rpm --cran -p mAr will ignore the --cran argument and test first bioconductor. As I said this is a really small detail. The important thing to notice though is that the above example works. :-) :-D > Thanks for testing, > > Pierre -- José Abílio
diff --git a/R2spec-2.5.3-1.fc11.noarch.rpm b/R2spec-2.5.3-1.fc11.noarch.rpm deleted file mode 100644 index 38410cd..0000000 Binary files a/R2spec-2.5.3-1.fc11.noarch.rpm and /dev/null differ diff --git a/R2spec-2.5.3.tar.gz b/R2spec-2.5.3.tar.gz deleted file mode 100644 index ac0ca87..0000000 Binary files a/R2spec-2.5.3.tar.gz and /dev/null differ diff --git a/devel/r2spec/R2rpm.py b/devel/r2spec/R2rpm.py index ee48ad0..241b945 100644 --- a/devel/r2spec/R2rpm.py +++ b/devel/r2spec/R2rpm.py @@ -65,7 +65,7 @@ class R2rpm: # Generate the spec file r = RPackage() # Determine where to generate the spec according to the rpmmacro - specdir = r.getRPMTopDirectory("_specdir") + specdir = r.getRPMTopDirectory("_specdir", package) # Go to the folder if specdir is not None: diff --git a/devel/r2spec/RPackage.py b/devel/r2spec/RPackage.py index a87bf8d..7596043 100644 --- a/devel/r2spec/RPackage.py +++ b/devel/r2spec/RPackage.py @@ -256,22 +256,24 @@ class RPackage: spec.writeSpec(specname) if todo: spec.writeOut() - def getRPMTopDirectory(self, tag, name = None): + def getRPMTopDirectory(self, tag, package = None): ''' Reads the .rpmmacros and set the values accordingly Code from José Matos. ''' dirname = Popen(["rpm", "-E", '%' + tag], stdout=PIPE).stdout.read()[:-1] - specname = name - if self.name: - specname = "R-" + self.name - if specname: - dirname = dirname.replace("%{name}", specname) - dirname = dirname.replace("%name", specname) + # replace %{name} by the specname since it is not set + + # determine the spec name + if self.name: specname = "R-" + self.name + elif package: specname = "R-" + package + else: specname = "R-unknown" + + # replace %{name} by the specname + dirname = dirname.replace("%{name}", specname) + dirname = dirname.replace("%name", specname) return dirname - - return topdir def moveSource(self, copyFile): ''' Moves the tarball to where it should be to build the RPM '''
_______________________________________________ r-devel mailing list r-devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/r-devel