1Shipwright::Manual::UsiUnsgeFrlaCgosn(t3r)ibuted Perl DoSchuimpewnrtiagthito:n:Manual::UsingFlags(3)
2
3
4
6 Shipwright::Manual::UsingFlags - Using flags
7
9 Shipwright flags is a method to make a single shipyard to support
10 multiple variants of vessels.
11
12 Imagine you want to create a project which requires a database. There
13 are several database types you want to support in the same shipyard,
14 while you'd like each built vessel to only support one type. (Sometimes
15 you have to choose one because some dists will be confused if provided
16 with more than one type; e.g. for RT, you have to supply the database
17 type when running ./configure).
18
19 This is a task that you can use Shipwright flags to accomplish.
20
21 For example, say you want to support both mysql and postgresql, and
22 you've imported mysql, DBD::mysql, postgresql and DBD::Pg to the
23 repository.
24
25 The next step is to mark dists with flags; let's use "mysql" and
26 "postgresql" for this example.
27
28 $ shipwright flags -r ... mysql --set mysql
29 $ shipwright flags -r ... cpan-DBD-mysql --set mysql
30 $ shipwright flags -r ... postgresql --set postgresql
31 $ shipwright flags -r ... cpan-DBD-Pg --set postgresql
32 $ shipwright flags -r ... --mandatory --set mysql,postgresql db
33
34 Flags data is stored in shipwright/flags.yml
35
36 When building, you can then set "--flags" to "mysql" or "postgresql" to
37 install support for that database only.
38
39 If a dist needs this info to configure (like RT for example), you'll
40 need to customize the build script; see
41 Shipwright::Manual::CustomizeBuild for information about how to do
42 this.
43
44 If no flags are specified during build, both mysql and postgresql would
45 be installed to the vessel. Which one RT chooses to configure for
46 depends on its build script.
47
48 If necessary, you can also specify certain flags as being mandatory.
49 For example, you can specify that a database flag is mandatory; if no
50 flag labelled "db" is specified when invoking the build script, the
51 first one is used as a default (mysql in this case) rather than the
52 repository being built with no flags. This allows shipyards to support
53 different variants or versions of a program.
54
55 Note:
56
57 Shipwright will automatically add "default" to "--flags", and if a dist
58 has no flags set (i.e. it does not appear in shipwright/flags.yml), it
59 will be given the "default" flag and will be installed by default.
60
62 Shipwright, Shipwright::Manual
63
65 sunnavy "<sunnavy@bestpractical.com>"
66
68 Shipwright is Copyright 2007-2015 Best Practical Solutions, LLC.
69
70 This program is free software; you can redistribute it and/or modify it
71 under the same terms as Perl itself.
72
73
74
75perl v5.36.0 2022-07-22 Shipwright::Manual::UsingFlags(3)