Merge slapos.recipe.build into slapos.recipebox.
[slapos.git] / slapos / recipe / README.build.txt
1 slapos.recipe.build
2 ===================
3
4 Recipe to build the software.
5
6 Example buildout::
7
8 [buildout]
9 parts =
10   file
11
12 develop = slapos.recipe.build
13
14 [zlib]
15 # Use standard configure, make, make install way
16 recipe = slapos.recipe.build:cmmi
17 url = http://prdownloads.sourceforge.net/libpng/zlib-1.2.5.tar.gz?download
18 md5sum = c735eab2d659a96e5a594c9e8541ad63
19 slapos_promisee =
20   directory:include
21   file:include/zconf.h
22   file:include/zlib.h
23   directory:lib
24   statlib:lib/libz.a
25   dynlib:lib/libz.so linked:libc.so.6 rpath:
26   dynlib:lib/libz.so.1 linked:libc.so.6 rpath:
27   dynlib:lib/libz.so.1.2.5 linked:libc.so.6
28   directory:lib/pkgconfig
29   file:lib/pkgconfig/zlib.pc
30   directory:share
31   directory:share/man
32   directory:share/man/man3
33   file:share/man/man3/zlib.3
34
35 [file]
36 recipe = slapos.recipe.build:cmmi
37 url = ftp://ftp.astron.com/pub/file/file-5.04.tar.gz
38 md5sum = accade81ff1cc774904b47c72c8aeea0
39 environment =
40   CPPFLAGS=-I${zlib:location}/include
41   LDFLAGS=-L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib
42 slapos_promisee =
43   directory:bin
44   dynlib:bin/file linked:libz.so.1,libc.so.6,libmagic.so.1 rpath:${zlib:location}/lib,!/lib
45   directory:include
46   file:include/magic.h
47   directory:lib
48   statlib:lib/libmagic.a
49   statlib:lib/libmagic.la
50   dynlib:lib/libmagic.so linked:libz.so.1,libc.so.6 rpath:${zlib:location}/lib
51   dynlib:lib/libmagic.so.1 linked:libz.so.1,libc.so.6 rpath:${zlib:location}/lib
52   dynlib:lib/libmagic.so.1.0.0 linked:libz.so.1,libc.so.6 rpath:${zlib:location}/lib
53   directory:share
54   directory:share/man
55   directory:share/man/man1
56   file:share/man/man1/file.1
57   directory:share/man/man3
58   file:share/man/man3/libmagic.3
59   directory:share/man/man4
60   file:share/man/man4/magic.4
61   directory:share/man/man5
62   directory:share/misc
63   file:share/misc/magic.mgc
64
65 [somethingelse]
66 # default way with using script
67 recipe = slapos.recipe.build
68 url_0 = http://host/path/file.tar.gz
69 md5sum = 9631070eac74f92a812d4785a84d1b4e
70 script =
71   import os
72   os.chdir(%(work_directory)s)
73   unpack(%(url_0), strip_path=True)
74   execute('make')
75   execute('make install DEST=%(location)s')
76 slapos_promisee =
77   ...
78
79 [anythingelse]
80 # reusing different recipe?
81 recipe = slapos.recipe.build:backend
82 backend = hexagonit.recipe.cmmi
83 slapos_promisee =
84   ...
85 # parameters to build
86
87 TODO:
88
89  * add linking suport, buildout definition:
90
91 slapos_link = <relative/path> [optional-path
92
93 can be used as:
94
95 [file]
96 slapos_link =
97   bin/file
98   bin/file ${buildout:bin-directory}/bin/anotherfile
99
100 Which will link ${file:location}/bin/file to ${buildout:bin-directory}/bin/file
101 and ${file:location}/bin/file to ${buildout:bin-directory}/bin/anotherfile