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