Skip to main content

ZC Buildout recipe for configure/make/make install

Project description

The configure-make-make-install recipe automates installation of configure-based source distribution into buildouts.

Release History

1.0.2 (2007-06-03)

Added support for patches.

Bugs Fixed

Tests fixed (buildout’s output changed)

1.0.1 (2006-11-22)

Bugs Fixed

Added missing zip_safe flag.

1.0 (2006-11-22)

Initial release.

Detailed Documentation

We have an archive with a demo foo tar ball:

>>> ls(distros)
-  foo.tgz

Let’s update a sample buildout to installs it:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = foo
...
... [foo]
... recipe = zc.recipe.cmmi
... url = file://%s/foo.tgz
... """ % distros)

We used the url option to specify the location of the archive.

If we run the buildout, the configure script in the archive is run. It creates a make file which is also run:

>>> print system('bin/buildout'),
Installing foo.
configuring foo --prefix=/sample-buildout/parts/foo
echo building foo
building foo
echo installing foo
installing foo

The recipe also creates the parts directory:

>>> ls(sample_buildout, 'parts')
d  foo

If we run the buildout again, the update method will be called, which does nothing:

>>> print system('bin/buildout'),
Updating foo.

You can supply extra configure options:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = foo
...
... [foo]
... recipe = zc.recipe.cmmi
... url = file://%s/foo.tgz
... extra_options = -a -b c
... """ % distros)
>>> print system('bin/buildout'),
Uninstalling foo.
Installing foo.
configuring foo --prefix=/sample-buildout/parts/foo -a -b c
echo building foo
building foo
echo installing foo
installing foo

The recipe sets the location option, which can be read by other recipes, to the location where the part is installed:

>>> cat('.installed.cfg')
... # doctest: +ELLIPSIS
[buildout]
installed_develop_eggs =
parts = foo
<BLANKLINE>
[foo]
__buildout_installed__ = /sample-buildout/parts/foo
...
extra_options = -a -b c
location = /sample-buildout/parts/foo
...

Sometimes it’s necessary to patch the sources before building a package. You can specify the name of the patch to apply and (optional) patch options:

First of all let’s write a patchfile:

>>> import sys
>>> mkdir('patches')
>>> write('patches/config.patch',
... """--- configure
... +++ /dev/null
... @@ -1,13 +1,13 @@
...  #!%s
...  import sys
... -print "configuring foo", ' '.join(sys.argv[1:])
... +print "configuring foo patched", ' '.join(sys.argv[1:])
...
...  Makefile_template = '''
...  all:
... -\techo building foo
... +\techo building foo patched
...
...  install:
... -\techo installing foo
... +\techo installing foo patched
...  '''
...
...  open('Makefile', 'w').write(Makefile_template)
...
... """ % sys.executable)

Now let’s create a buildout.cfg file. Note: If no patch option is beeing passed, -p0 is appended by default.

>>> write('buildout.cfg',
... """
... [buildout]
... parts = foo
...
... [foo]
... recipe = zc.recipe.cmmi
... url = file://%s/foo.tgz
... patch = ${buildout:directory}/patches/config.patch
... patch_options = -p0
... """ % distros)
>>> print system('bin/buildout'),
Uninstalling foo.
Installing foo.
patching file configure
configuring foo patched --prefix=/sample_buildout/parts/foo
echo building foo patched
building foo patched
echo installing foo patched
installing foo patched

Download

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zc.recipe.cmmi-1.0.2-py2.4.egg (10.0 kB view details)

Uploaded Egg

File details

Details for the file zc.recipe.cmmi-1.0.2-py2.4.egg.

File metadata

File hashes

Hashes for zc.recipe.cmmi-1.0.2-py2.4.egg
Algorithm Hash digest
SHA256 fcac35d64b31079dabcbdd750db57c277dcf2db3c262f9756c35ea9fb2668658
MD5 68bdfca19d5e92e0cdfc3d22a23e0002
BLAKE2b-256 5a53de1a1c1315c76100473e0260a1c409d12c56b6641cc84b4023a705573776

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page