ZC Buildout recipe for BDB configure/make/make install
Project description
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 = ro.bdb.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. foo: Downloading .../distros/foo.tgz foo: Unpacking and configuring 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 = ro.bdb.cmmi ... url = file://%s/foo.tgz ... extra_options = -a -b c ... """ % distros)>>> print system('bin/buildout'), Uninstalling foo. Installing foo. foo: Downloading .../distros/foo.tgz foo: Unpacking and configuring 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 = ro.bdb.cmmi ... url = file://%s/foo.tgz ... patch = ${buildout:directory}/patches/config.patch ... patch_options = -p0 ... """ % distros)>>> print system('bin/buildout'), Uninstalling foo. Installing foo. foo: Downloading .../distros/foo.tgz foo: Unpacking and configuring 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 Cache
The recipe supports use of a download cache in the same way as zc.buildout. See downloadcache.txt for details
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 Distribution
File details
Details for the file ro.bdb.cmmi-1.0.5.tar.gz
.
File metadata
- Download URL: ro.bdb.cmmi-1.0.5.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0dde77ae2d3315b80062dc7a0762cb4ed69b0074b6936c56e244e8f2653ac96 |
|
MD5 | 7b8488b3e43acedc9019f4830f489d29 |
|
BLAKE2b-256 | 417463d15c0a07031d8cd3e25fe9fd5147a73849761a6a29aa34e116dc9069ba |