[Erp5-report] r33000 nicolas.dumazet - in /erp5/trunk/utils/rpmgen: ./ recipes/createmandri...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 23 09:39:34 CET 2010


Author: nicolas.dumazet
Date: Tue Feb 23 09:39:34 2010
New Revision: 33000

URL: http://svn.erp5.org?rev=33000&view=rev
Log:
separate user and root commands, use a Makefile

Added:
    erp5/trunk/utils/rpmgen/Makefile   (with props)
    erp5/trunk/utils/rpmgen/common.cfg
    erp5/trunk/utils/rpmgen/root.cfg
    erp5/trunk/utils/rpmgen/user.cfg
      - copied, changed from r32954, erp5/trunk/utils/rpmgen/buildout.cfg
Removed:
    erp5/trunk/utils/rpmgen/buildout.cfg
Modified:
    erp5/trunk/utils/rpmgen/recipes/createmandrivaspec/createmandrivaspec.py
    erp5/trunk/utils/rpmgen/templates/erp5-official-buildout-mandriva2010.spec.in

Added: erp5/trunk/utils/rpmgen/Makefile
URL: http://svn.erp5.org/erp5/trunk/utils/rpmgen/Makefile?rev=33000&view=auto
==============================================================================
--- erp5/trunk/utils/rpmgen/Makefile (added)
+++ erp5/trunk/utils/rpmgen/Makefile [utf8] Tue Feb 23 09:39:34 2010
@@ -1,0 +1,7 @@
+all: bin/buildout
+	bin/buildout -c user.cfg
+	bin/buildout -c root.cfg
+
+bin/buildout:
+	python bootstrap/bootstrap.py -c common.cfg
+

Propchange: erp5/trunk/utils/rpmgen/Makefile
------------------------------------------------------------------------------
    svn:eol-style = native

Removed: erp5/trunk/utils/rpmgen/buildout.cfg
URL: http://svn.erp5.org/erp5/trunk/utils/rpmgen/buildout.cfg?rev=32999&view=auto
==============================================================================
--- erp5/trunk/utils/rpmgen/buildout.cfg [utf8] (original)
+++ erp5/trunk/utils/rpmgen/buildout.cfg (removed)
@@ -1,35 +1,0 @@
-[buildout]
-parts =
-  create-build-directory
-develop =
-  recipes/createmandrivaspec
-
-[version]
-# XXX should be retrieved automatically
-version = 5.4.6
-
-[checkout]
-recipe = infrae.subversion
-location = svn
-urls =
-  https://svn.erp5.org/repos/public/erp5/trunk/buildout .
-
-[create-build-directory]
-recipe = plone.recipe.command
-base = /opt/erp5
-location = ${:base}/${version:version}
-command =
-  mkdir -p ${:base}
-  cp -r ${checkout:dest} ${:location}
-
-[create-spec]
-recipe = createmandrivaspec
-name = erp5-official-buildout
-
-input = templates/${:base}.in
-output = specs/${:base}
-version = ${checkout:location}/VERSION.txt
-package_list = ${dependency:package_list}
-
-# only a helper variable
-base = erp5-official-buildout-mandriva2010.spec

Added: erp5/trunk/utils/rpmgen/common.cfg
URL: http://svn.erp5.org/erp5/trunk/utils/rpmgen/common.cfg?rev=33000&view=auto
==============================================================================
--- erp5/trunk/utils/rpmgen/common.cfg (added)
+++ erp5/trunk/utils/rpmgen/common.cfg [utf8] Tue Feb 23 09:39:34 2010
@@ -1,0 +1,11 @@
+[version]
+# XXX should be retrieved automatically
+version = 5.4.6
+
+[checkout]
+recipe = plone.recipe.command
+location = svn
+command =
+  svn co https://svn.erp5.org/repos/public/erp5/trunk/buildout ${:location}
+update_command =
+  svn up ${:location}

Modified: erp5/trunk/utils/rpmgen/recipes/createmandrivaspec/createmandrivaspec.py
URL: http://svn.erp5.org/erp5/trunk/utils/rpmgen/recipes/createmandrivaspec/createmandrivaspec.py?rev=33000&r1=32999&r2=33000&view=diff
==============================================================================
--- erp5/trunk/utils/rpmgen/recipes/createmandrivaspec/createmandrivaspec.py [utf8] (original)
+++ erp5/trunk/utils/rpmgen/recipes/createmandrivaspec/createmandrivaspec.py [utf8] Tue Feb 23 09:39:34 2010
@@ -1,4 +1,5 @@
 import os
+from subprocess import Popen, PIPE
 import collective.recipe.template
 
 class Recipe(collective.recipe.template.Recipe):
@@ -11,13 +12,16 @@
       - version: rpm version number, can be either the version
           or a file path containing the version
       - (section) name: rpm name
-      - build_requires: a list of Mandriva packages required to build the rpm
-      - svnpath: SVN path to current buildout
+      - helper_script: path to distribution-specific helper script
 
       optional:
         - release: rpm release number. Defaults to 1
     """
-    package_list = options['package_list'].splitlines()
+
+    process = Popen([options['helper_script'], "-l"], stdout=PIPE)
+    stdout, stderr = process.communicate()
+
+    package_list = stdout.splitlines()
     package_list = map(lambda x: x.strip(), package_list)
     dependencies = ["BuildRequires: %s" % pkg for pkg in package_list if pkg]
 
@@ -30,6 +34,4 @@
     options.update(dependencies="\n".join(dependencies),
                    version=version,
                    release=release)
-
     collective.recipe.template.Recipe.__init__(self, buildout, name, options)
-

Added: erp5/trunk/utils/rpmgen/root.cfg
URL: http://svn.erp5.org/erp5/trunk/utils/rpmgen/root.cfg?rev=33000&view=auto
==============================================================================
--- erp5/trunk/utils/rpmgen/root.cfg (added)
+++ erp5/trunk/utils/rpmgen/root.cfg [utf8] Tue Feb 23 09:39:34 2010
@@ -1,0 +1,13 @@
+[buildout]
+extends = common.cfg
+parts =
+  create-build-directory
+
+[create-build-directory]
+recipe = plone.recipe.command
+base = /opt/erp5
+location = ${:base}/${version:version}
+command =
+  mkdir -p ${:base}
+  cp -r ${checkout:location} ${:location}
+

Modified: erp5/trunk/utils/rpmgen/templates/erp5-official-buildout-mandriva2010.spec.in
URL: http://svn.erp5.org/erp5/trunk/utils/rpmgen/templates/erp5-official-buildout-mandriva2010.spec.in?rev=33000&r1=32999&r2=33000&view=diff
==============================================================================
--- erp5/trunk/utils/rpmgen/templates/erp5-official-buildout-mandriva2010.spec.in [utf8] (original)
+++ erp5/trunk/utils/rpmgen/templates/erp5-official-buildout-mandriva2010.spec.in [utf8] Tue Feb 23 09:39:34 2010
@@ -26,13 +26,8 @@
 %description
 %{summary}
 
-%prep
-%{__rm} -rf %{installdir}
-%{__mkdir_p} %{installdir}
-
 %build
 cd %{installdir}
-svn co ${:svnpath} .
 python bootstrap/bootstrap.py
 bin/buildout
 

Copied: erp5/trunk/utils/rpmgen/user.cfg (from r32954, erp5/trunk/utils/rpmgen/buildout.cfg)
URL: http://svn.erp5.org/erp5/trunk/utils/rpmgen/user.cfg?p2=erp5/trunk/utils/rpmgen/user.cfg&p1=erp5/trunk/utils/rpmgen/buildout.cfg&r1=32954&r2=33000&rev=33000&view=diff
==============================================================================
--- erp5/trunk/utils/rpmgen/buildout.cfg [utf8] (original)
+++ erp5/trunk/utils/rpmgen/user.cfg [utf8] Tue Feb 23 09:39:34 2010
@@ -1,35 +1,20 @@
 [buildout]
+extends = common.cfg
 parts =
-  create-build-directory
+  checkout
+  create-spec
 develop =
   recipes/createmandrivaspec
 
-[version]
-# XXX should be retrieved automatically
-version = 5.4.6
-
-[checkout]
-recipe = infrae.subversion
-location = svn
-urls =
-  https://svn.erp5.org/repos/public/erp5/trunk/buildout .
-
-[create-build-directory]
-recipe = plone.recipe.command
-base = /opt/erp5
-location = ${:base}/${version:version}
-command =
-  mkdir -p ${:base}
-  cp -r ${checkout:dest} ${:location}
 
 [create-spec]
 recipe = createmandrivaspec
 name = erp5-official-buildout
-
 input = templates/${:base}.in
 output = specs/${:base}
+
 version = ${checkout:location}/VERSION.txt
-package_list = ${dependency:package_list}
+helper_script = ${checkout:location}/helpers/mandriva2010.0.sh
 
 # only a helper variable
 base = erp5-official-buildout-mandriva2010.spec




More information about the Erp5-report mailing list