1.\" $Id$
2.Dd September 30, 2008
3.Dt PORTSHAKER.CONF 5
4.Os
5.Sh NAME
6.Nm portshaker.conf
7.Nd format of the
8.Xr portshaker 8
9configuration file
10.Sh DESCRIPTION
11The file
12.Nm
13contains descriptive information about which
14.Ar source
15ports trees
16.Xr portshaker 8
17has to be merged into which
18.Ar target
19ports trees.
20.Pp
21Options are set with
22.Dq Ar name Ns Li = Ns Ar value
23assignments that use
24.Xr sh 1
25syntax.
26The following list provides a name and short description for each
27variable that can be set in the
28.Nm
29file:
30.Bl -tag -width mirror_base_dir
31.It Va mirror_base_dir
32.Pq Vt str
33Base directory where
34.Xr portshaker 8
35will fetch
36.Ar source
37ports trees.
38.It Va ports_trees
39.Pq Vt str
40Set to the list of
41.Ar target
42ports trees to maintain.
43.Pp
44A
45.Ao Ar target Ac Ns Va _ports_tree
46or a
47.Ao Ar target Ac Ns Va _poudriere_tree
48variable must be set to tell
49.Xr portshaker 8
50where the ports trees has to be merged to and a
51.Ao Ar target Ac Ns Va _merge_from
52variable must be set to the list of
53.Ar source
54ports trees to merge from.
55.Pp
56When specifying a
57.Ao Ar target Ac Ns Va _ports_tree ,
58it should be set to the full path of the directory where the
59.Ar target
60ports tree is located.
61.Pp
62When specifying a
63.Ao Ar target Ac Ns Va _poudriere_tree ,
64it should be set to the
65.Ar name
66of the ports tree that will be later-on used with
67.Xr poudriere 8 .
68.Pp
69.Ao Ar target Ac Ns Va _ports_tree
70and
71.Ao Ar target Ac Ns Va _poudriere_tree
72are mutually exclusive.
73.Pp
74If the
75.Ar source
76ports tree name contains colons, they are replaced by spaces and
77.Xr portshaker 8
78will pass these extra argument to the script named by the first component. This
79allowing some kind of factorisation for multiple sources in a single
80repository.
81.Pp
82If a
83.Ar source
84ports tree is known to provide ports that are already provided in another ports
85tree, and while both ports provide the same version of a software package they
86do not contain the same files,
87.Xr portshaker 8
88can be told to automatically install the updated ports without prompting the
89user by appending an exclamation mark after the
90.Ar source
91ports tree name.
92.Pp
93Alternatively, appending a plus sign after the
94.Ar source
95ports tree name will, regardless of version, install or replace matching files
96in the
97.Ar target
98port tree whilst preserving any pre-existing non matching port files. This is
99useful when the
100.Ar source
101ports tree contains an incomplete subset of files for instance only local
102patches.
103.It Va fail_on_conflict
104.Pq Vt bool
105Fail if a merge conflict is encountered.
106.It Va poudriere_dataset
107.Pq Vt string
108The ZFS filesystem
109.Xr poudriere 8
110is configured to use.
111.It Va poudriere_ports_mountpoint
112.Pq string
113The directory where
114.Xr poudriere 8
115ports directory are mounted, usually
116.Ar @@PREFIX@@/poudriere/ports .
117.It Va source_zfs_compression
118.Pq Vt string
119ZFS compression to use when creating a
120.Ar source
121ports tree (require
122.Ar use_zfs
123to be set).  Defaults to
124.Ar lz4 .
125.It Va target_zfs_compression
126.Pq Vt string
127ZFS compression to use when creating a
128.Ar target
129ports tree (require
130.Ar use_zfs
131to be set).  Defaults to
132.Ar off .
133.It Va use_zfs
134.Pq Vt bool
135Whether to use ZFS for cloning the first
136.Ar source
137ports tree to the
138.Ar target
139ports tree.
140.Pp
141When set, the
142.Ar mirror_base_dir
143directory should be a ZFS filesystem for
144.Xr portshaker 8
145to create new ZFS filesystems automatically (one per
146.Ar source
147ports tree); otherwise the ZFS filesystem shall be created by the user before
148running
149.Xr portshaker 8
150for the first time.
151.Pp
152A
153.Ao Ar target Ac Ns Va _zfs_dataset
154variable can be used to control the ZFS dataset used for the filesystem. By default, a dataset with the name of the
155.Ar target
156ports tree is created as a child of the dataset of the
157.Ar target
158ports tree's parent directory's dataset (i.e. if the
159.Ar /usr
160filesystem's dataset is
161.Ar data/foo ,
162then the dataset for the
163.Ar /usr/ports
164directory will be
165.Ar data/foo/ports ) .
166This requires the
167.Ar target
168ports tree's parent directory to be a ZFS filesystem.
169.Pp
170When using this option, you may want to set
171.Ar DISTDIR
172and
173.Ar PACKAGES
174in
175.Ar /etc/make.conf
176in order to avoid lossing distfiles and packages each time you merge your
177.Ar target
178ports tree.
179.It Va verbose
180.Pq Vt int
181Default verbosity level,
182.Vt 0
183if unspecified.
184.El
185.Ss Hooking
186Hooks for
187.Xr portshaker 8
188can be defined in
189.Nm
190as functions named
191.Ao Ar port_tree Ac Ns Ar _pre Ns Ao Ar action Ac Ns ()
192and
193.Ao Ar port_tree Ac Ns Ar _post Ns Ao Ar action Ac Ns ()
194where
195.Va action
196is one of
197.Vt update
198or
199.Vt merge .
200.Sh EXAMPLES
201To maintain a single ports tree with BSD# ports:
202.Bd -literal
203ports_trees="main"
204main_ports_tree="/usr/ports"
205main_merge_from="ports bsd_sharp"
206.Ed
207.Pp
208To configure a tinderbox with official ports tree (tb_official), a second one with BSD# ports tree (tb_bsd_sharp), a third one with GNOME-devel ports tree (tb_gnome) and a last one with both upcomming BSD# and GNOME (tb_bsd_sharp_gnome):
209.Bd -literal
210ports_trees="tb_official tb_bsd_sharp tb_gnome tb_bsd_sharp_gnome"
211
212tb="@@PREFIX@@/tinderbox/"
213tb_official_ports_tree="${tb}/portstrees/FreeBSD/ports"
214tb_official_merge_from="ports"
215
216tb_bsd_sharp_ports_tree="${tb}/portstrees/BSD-sharp/ports"
217tb_bsd_sharp_merge_from="ports bsd_sharp"
218
219tb_gnome_ports_tree="${tb}/portstrees/GNOME/ports"
220tb_gnome_merge_from="ports gnomedevel"
221
222tb_bsd_sharp_gnome_ports_tree="${tb}/portstrees/BSD-sharp-gnome/ports"
223tb_bsd_sharp_gnome_merge_from="ports bsd_sharp gnomedevel"
224.Ed
225.Pp
226To merge multiples redports sources in a single target ports tree:
227.Bd -literal
228ports_trees="main"
229main_ports_tree="/usr/ports"
230main_merge_from="ports redports:foo redports:bar"
231.Ed
232.Sh SEE ALSO
233.Xr make.conf 5 ,
234.Xr portshaker.d 5 ,
235.Xr portshaker 8 ,
236.Xr poudriere 8
237.Sh AUTHORS
238.An Romain Tarti�re Aq romain@blogreen.org
239