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.build
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Leymonerie
slapos.recipe.build
Commits
8573732b
Commit
8573732b
authored
Mar 13, 2020
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default: update doc
parent
0957481d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
68 deletions
+19
-68
README.rst
README.rst
+19
-68
No files found.
README.rst
View file @
8573732b
...
@@ -7,96 +7,47 @@
...
@@ -7,96 +7,47 @@
Default
Default
-------
-------
The default recipe can be used to execute ad-hoc Python code at both
The default recipe can be used to execute ad-hoc Python code at
init & install phases.
init/install/update phases. `install` must create the path pointed to by
`location` (default is ${buildout:parts-directory}/${:_buildout_section_name_})
and any other file system change is not tracked by buildout. `install` defaults
to `update`, in which case `location` is ignored.
Example
buildout that build
s software::
Example
that install
s software::
[buildout]
[buildout]
parts =
parts =
script
script
[script]
[script]
# default way with using script
recipe = slapos.recipe.build
recipe = slapos.recipe.build
url_0 = http://host/path/file.tar.gz
md5sum = 9631070eac74f92a812d4785a84d1b4e
script =
import os
os.chdir(%(work_directory)s)
unpack(%(url_0), strip_path=True)
execute('make')
execute('make install DEST=%(location)s')
slapos_promise =
slapos_promise =
directory:bin
dynlib:bin/file linked:libz.so.1,libc.so.6,libmagic.so.1 rpath:${zlib:location}/lib,!/lib
directory:include
directory:include
file:include/magic.h
file:share/man/man1/foo.1
directory:lib
statlib:lib/libfoo.a
statlib:lib/libmagic.a
statlib:lib/libfoo.la
statlib:lib/libmagic.la
dynlib:bin/foo linked:libbar.so.1,libc.so.6,libfoo.so.1 rpath:${bar:location}/lib,!/lib
dynlib:lib/libmagic.so linked:libz.so.1,libc.so.6 rpath:${zlib:location}/lib
dynlib:lib/libmagic.so.1 linked:libz.so.1,libc.so.6 rpath:${zlib:location}/lib
dynlib:lib/libmagic.so.1.0.0 linked:libz.so.1,libc.so.6 rpath:${zlib:location}/lib
directory:share
directory:share/man
directory:share/man/man1
file:share/man/man1/file.1
directory:share/man/man3
file:share/man/man3/libmagic.3
directory:share/man/man4
file:share/man/man4/magic.4
directory:share/man/man5
directory:share/misc
file:share/misc/magic.mgc
[multiarchitecture]
recipe = slapos.recipe.build
slapos_promise =
...
x86 = http://host/path/x86.zip [md5sum]
x86 = http://host/path/x86.zip [md5sum]
x86-64 = http://host/path/x64.zip [md5sum]
x86-64 = http://host/path/x64.zip [md5sum]
script =
install =
if not self.options.get('url'): self.options['url'], self.options['md5sum'] = self.options[guessPlatform()].split(' ')
url, md5sum = options[guessPlatform()].split()
extract_dir = self.extract(self.download(self.options['url'], self.options.get('md5sum')))
extract_dir = self.extract(self.download(url, md5sum))
workdir = guessworkdir(extract_dir)
self.copyTree(guessworkdir(extract_dir), location)
self.copyTree(workdir, "%(location)s")
${:update}
update =
You can remove formatting by using option “format = no” (default is “yes”)
...
For example::
[escaping]
recipe = slapos.recipe.build
example = foobar's one
script =
print('%%s' %% self.options['example'])
# will print “foobar's one”
[no-escaping]
recipe = slapos.recipe.build
example = foobar's one
foo = bar
format = no
script =
print('%s' % self.options['example'])
# will print “foobar's one”
print('%(foo)s')
# will print “%(foo)s”
Using the init option::
Using the init option::
[section-one]
[section-one]
recipe = slapos.recipe.build
recipe = slapos.recipe.build
init =
init =
import
os
import
platform
options['foo'] =
os
.uname()[4]
options['foo'] =
platform
.uname()[4]
[section-two]
[section-two]
bar = ${section-one:foo}
bar = ${section-one:foo}
It is also possible to use both `init` & `script` in the same section.
Pure download
Pure download
~~~~~~~~~~~~~
~~~~~~~~~~~~~
...
...
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