Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.cmmi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.recipe.cmmi
Commits
2c59387b
Commit
2c59387b
authored
Aug 26, 2010
by
Kai Lautaportti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented support for passing make options.
parent
41b4defa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
3 deletions
+54
-3
CHANGES.txt
CHANGES.txt
+4
-0
hexagonit/recipe/cmmi/README.txt
hexagonit/recipe/cmmi/README.txt
+47
-1
hexagonit/recipe/cmmi/__init__.py
hexagonit/recipe/cmmi/__init__.py
+3
-2
hexagonit/recipe/cmmi/testdata/haproxy-1.4.8-dummy.tar.gz
hexagonit/recipe/cmmi/testdata/haproxy-1.4.8-dummy.tar.gz
+0
-0
No files found.
CHANGES.txt
View file @
2c59387b
...
...
@@ -4,6 +4,10 @@ Change History
1.4.0 (xxxx-xx-xx)
==================
- Added support for passing options to ``make`` with the new
``make-options`` option. See the "Installing a package without an
``autoconf`` like system" section below for an example. [dokai]
- The ``--prefix`` parameter will be automatically given to the configure
command if and only if a) the ``configure-command`` is not used to specify
a custom configure command and b) ``--prefix`` is not given explicitly in
...
...
hexagonit/recipe/cmmi/README.txt
View file @
2c59387b
...
...
@@ -34,6 +34,11 @@ Supported options
should work on any system that has the ``make`` program available
in the system ``PATH``.
``make-options``
Extra ``KEY=VALUE`` options included in the invocation of the ``make``
program. Multiple options can be given on separate lines to increase
readability.
``make-targets``
Targets for the ``make`` command. Defaults to 'install'
which will be enough to install most software packages. You only
...
...
@@ -142,6 +147,7 @@ We'll use a simple tarball to demonstrate the recipe.
>>> src = join(os.path.dirname(__file__), 'testdata')
>>> ls(src)
- Foo-Bar-0.0.0.tar.gz
- haproxy-1.4.8-dummy.tar.gz
- package-0.0.0.tar.gz
The package contains a dummy ``configure`` script that will simply
...
...
@@ -205,6 +211,46 @@ a custom location within the buildout::
building package
installing package
Installing a package without an ``autoconf`` like system
========================================================
Some packages do not use a configuration mechanism and simply provide a
``Makefile`` for building. It is common in these cases that the build process
is controlled entirely by direct options to ``make``. We can build such a
package by faking a configure command that does nothing and passing the
appropriate options to ``make``. The ``true`` utility found in most shell
environments is a good candidate for this although anything that returns a
zero exit code would do.
We are using a dummy "HAProxy" package as an example of a package with only a
Makefile and using explicit ``make`` options to control the build process.
>>> write('buildout.cfg',
... """
... [buildout]
... newest = false
... parts = haproxy
...
... [haproxy]
... recipe = hexagonit.recipe.cmmi
... configure-command = true
... make-options =
... TARGET=linux26
... CPU=i686
... USE_PCRE=1
... url = file://%s/haproxy-1.4.8-dummy.tar.gz
... """ % src)
>>> print system(buildout)
Uninstalling foobar.
Installing haproxy.
haproxy: Extracting package to /sample_buildout/parts/haproxy__compile__
Building HAProxy 1.4.8 (dummy package)
TARGET: linux26
CPU: i686
USE_PCRE: 1
Installing haproxy
Installing checkouts
====================
...
...
@@ -237,7 +283,7 @@ filesystem and building that.
... """ % checkout_dir)
>>> print system(buildout)
Uninstalling
foobar
.
Uninstalling
haproxy
.
Installing package.
package: Using local source directory: /checkout/package-0.0.0
configure --prefix=/sample_buildout/parts/package
...
...
hexagonit/recipe/cmmi/__init__.py
View file @
2c59387b
...
...
@@ -86,6 +86,7 @@ class Recipe(object):
parts
=
[]
make_cmd
=
self
.
options
.
get
(
'make-binary'
,
'make'
).
strip
()
make_options
=
' '
.
join
(
self
.
options
.
get
(
'make-options'
,
''
).
split
())
make_targets
=
' '
.
join
(
self
.
options
.
get
(
'make-targets'
,
'install'
).
split
())
configure_options
=
self
.
options
.
get
(
'configure-options'
,
''
).
split
()
...
...
@@ -162,8 +163,8 @@ class Recipe(object):
log
.
info
(
'Executing pre-make-hook'
)
self
.
call_script
(
self
.
options
[
'pre-make-hook'
])
self
.
run
(
make_cmd
)
self
.
run
(
'%s %s
'
%
(
make_cmd
,
make_targets
))
self
.
run
(
'%s %s'
%
(
make_cmd
,
make_options
)
)
self
.
run
(
'%s %s
%s'
%
(
make_cmd
,
make_options
,
make_targets
))
if
'post-make-hook'
in
self
.
options
and
len
(
self
.
options
[
'post-make-hook'
].
strip
())
>
0
:
log
.
info
(
'Executing post-make-hook'
)
...
...
hexagonit/recipe/cmmi/testdata/haproxy-1.4.8-dummy.tar.gz
0 → 100644
View file @
2c59387b
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment