Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README - github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/README
blob: 9165edaedf20112abaf568a98b5682c43a1aa12c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
What is poudriere?
------------------

poudriere is a tool primarily designed to test package production on
FreeBSD. However, most people will find it useful to bulk build ports
for FreeBSD.

Its goals are to use modern facilities present in FreeBSD (as ZFS,
jails), to be easy to use and to depend only on base.

It is not designed to build the whole portstree as tinderbox.

Poudriere is able to build packages for versions of FreeBSD that are
different from the box on which it is installed, and also to build
packages for i386 if the host is an amd64 box.

Once the package building is done, the packages will be in a layout
identical to the official one. Therefore they will be useable by any
tool (pkg_add, portmaster, and so on).


What poudriere needs?
---------------------

- FreeBSD
- a ZFS pool
- root access

That is all. For more comfort, we recommend to have quite a lot of RAM
in order to make the builds in a VM resident filesystem.


How to install it?
------------------

Just type "make" at the top-level directory.


What do I have to configure before starting use it?
---------------------------------------------------

 Create a mandatory configuration file
 -------------------------------------

Poudriere will look for a configuration file in /usr/local/etc.

============= /usr/local/etc/poudriere.conf =========================
# The pool where poudriere will create its jails
ZPOOL=tank
# The ftp host where to download base sets and sys set for the jails
FTPHOST=ftp.fr.freebsd.org
# Ethernet interface for the jail
#ETH=nfe0
# If you cannot use another IP on your external interface
USE_LOOPBACK=yes
# IP for the jails
IP=172.16.0.1
# The ports directory to use within jails (mounted via nullfs)
PORTSDIR=/usr/local/poudriere/ports
# the directory where the jail will store the packages and logs
POUDRIERE_DATA=/usr/local/poudriere_data
# use portlint to check ports sanity
USE_PORTLINT=no
# if set WORKDIRPREFIX will be a mdmfs of the given size
MFSSIZE=1024m
=====================================================================

 Create optional make.conf
 -------------------------

You can also specify a global make.conf which will be used for all the
jails, and also add a per-jail make.conf:

    /usr/local/etc/poudriere.d/make.conf

and

    /usr/local/etc/poudriere.d/<jailname>-make.conf


How to use poudriere?
---------------------

 Prepare infrastructure
 ----------------------

First you have to create a jail, which will hold all the building
infrastructure needs.

    poudriere createjail -v 8.2-RELEASE -a amd64 -j 82amd64

Of course you can use another version of FreeBSD, regarless on what
version you are running. amd64 users can choose i386 arch like in this
example:

    poudriere createjail -v 8.1-RELEASE -a i386 -j 81i386

This command will fetch and install a minimal jail, small (~400MB) so
you can create a lot of them. It will install the jail under the pool
you have chosen, at poudriere/jailname.

You also need to have at least one ports tree to build packages from it,
so let us take the default configuration by creating a ports tree.

    poudriere ports -c

 Specify a list of ports you want to build
 -----------------------------------------

Create a flat text file in which you put the ports you want to see
built by poudriere.

    echo "sysutils/screen" > ~/pkglist
    echo "editors/vim" >> ~/pkglist

 Launch the bulk build
 ---------------------

Now you can launch the bulk build. You can specify to build for only one
arch/version ; by default it will make the bulk build on all the jails
created by poudriere.

    poudriere bulk -f ~/pkglist -j 81i386

 Find your packages
 ------------------

Once the bulk build is over, you can meet your shiny new packages here:

/usr/local/poudriere_data/packages/bulk-81i386

with 81i386 as the name of the jail.


Use poudriere for a single port
-------------------------------

Let's take the example of building a single port;

    poudriere testport -d ~/ports-cvs/mybeautifulporttotest

all the tests will be done in all the jails in alphabetical order

it starts the jail, then mount the ports tree (nullfs) then mounts the package
dir (pourdriere_data/packages/jailname) then it mounts the
~/ports-cvs/mybeautifulporttotest (nullfs) it builds all the dependency (except
runtime ones) and log it to
poudriere_data/logs/mybeautifulporttotest-jailname-depends.log)
if packages for the dependencies already exists it will use them

when all the dependencies are built, packages for them are created so that next
time it will be faster.

all the dependency phase is done with PREFIX == LOCALBASE

after that it will build the port itself with LOCALBASE != PREFIX
and log the build to poudriere_data/logs/mybeautifulporttotest-jailname-build.log

it will try to:
 - install it
 - create a package from it
 - deinstall it
 - check for cruft left behind
 - propose the line to add to pkg-plist if needed

It is very easy to extend it so that we can easily add other tests if wanted
One could imaging a webui or stores datas in a SGBD


Caveats
-------

 Jailname
 --------

-j is the name of the jail which will also be the name of the zfs filesystem
be carefull to respects the names supported by jail(8):
"This is an arbitrary string that identifies a jail (except it may not contain a ‘.’)"
be also carefull to not begin the name of the jail by a number if you are not in -stable or current:
http://svn.freebsd.org/viewvc/base?view=revision&revision=209820

Bonus: how to manage poudriere ports using portshaker
-----------------------------------------------------

Create a fake (-f) poudriere portstree:

    poudriere ports -c -f -p foo

Configure the ports tree in /usr/local/etc/portshaker.conf:

    ports_trees="... p_foo"
    use_zfs="yes"
    p_foo_ports_tree="/usr/local/poudriere/ports/foo/ports"
    p_foo_merge_from="ports ..."

You can then use portshaker to manage poudriere portstree:

    portshaker

Bonus: how to use the generated packages with portmaster
--------------------------------------------------------

First, install portmaster from the void:

    fetch -o - http://ftp.fr.freebsd.org/pub/FreeBSD/ports/packages/All/portmaster-3.9.tbz | \
    pkg_add -r -

Then, configure it:

    mkdir -p /usr/ports/Mk
    touch /usr/ports/Mk/bsd.port.mk

    cat > /usr/local/etc/portmaster.rc<<EOF
MASTER_SITE_INDEX=http://example.com/82i386/
LOCALBASE=/usr/local
PACKAGESITE=http://example.com/82i386/
PM_PACKAGES=only
PM_INDEX=yes
PM_INDEX_ONLY=pm_index_only
EOF

Of course you have to install a HTTP server, with /82i386/ an alias to
/usr/local/poudriere_data/packages/bulk-82i386.

You are now ready to invoke portmaster:

    portmaster editors/vim

Happy FreeBSDing!