PACKAGE_README.html revision 1.1.1.3.14.1 1 1.1 tron <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
2 1.1 tron "http://www.w3.org/TR/html4/loose.dtd">
3 1.1 tron
4 1.1 tron <html>
5 1.1 tron
6 1.1 tron <head>
7 1.1 tron
8 1.1 tron <title>Guidelines for Package Builders</title>
9 1.1 tron
10 1.1.1.3.14.1 martin <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
11 1.1.1.3.14.1 martin <link rel='stylesheet' type='text/css' href='postfix-doc.css'>
12 1.1 tron
13 1.1 tron </head>
14 1.1 tron
15 1.1 tron <body>
16 1.1 tron
17 1.1 tron <h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Guidelines for Package Builders</h1>
18 1.1 tron
19 1.1 tron <hr>
20 1.1 tron
21 1.1 tron <h2>Purpose of this document</h2>
22 1.1 tron
23 1.1 tron <p> This document has hints and tips for those who manage their
24 1.1.1.2 tron own Postfix binary distribution for internal use, and for those who
25 1.1.1.2 tron maintain Postfix binary distributions for general use. </p>
26 1.1 tron
27 1.1 tron <h2>General distributions: please provide a small default main.cf
28 1.1 tron file</h2>
29 1.1 tron
30 1.1 tron <p> The installed main.cf file must be small. PLEASE resist the
31 1.1 tron temptation to list all parameters in the main.cf file. Postfix
32 1.1 tron is supposed to be easy to configure. Listing all parameters in main.cf
33 1.1 tron defeats the purpose. It is an invitation for hobbyists to make
34 1.1 tron random changes without understanding what they do, and gets them
35 1.1 tron into endless trouble. </p>
36 1.1 tron
37 1.1 tron <h2>General distributions: please include README or HTML files</h2>
38 1.1 tron
39 1.1 tron <p> Please provide the applicable README or HTML files. They are
40 1.1 tron referenced by the Postfix manual pages and by other files. Without
41 1.1 tron README or HTML files, Postfix will be difficult if not impossible
42 1.1 tron to configure. </p>
43 1.1 tron
44 1.1 tron <h2>Postfix Installation parameters</h2>
45 1.1 tron
46 1.1 tron <p> Postfix installation is controlled by a dozen installation
47 1.1 tron parameters. See the postfix-install and post-install files for
48 1.1 tron details. Most parameters have system-dependent default settings
49 1.1 tron that are configurable at compile time, as described in the INSTALL
50 1.1 tron file. </p>
51 1.1 tron
52 1.1 tron <h2>Preparing a pre-built package for distribution to other
53 1.1 tron systems</h2>
54 1.1 tron
55 1.1 tron <p> You can build a Postfix package on a machine that does not have
56 1.1 tron Postfix installed on it. All you need is Postfix source code and
57 1.1 tron a compilation environment that is compatible with the target system.
58 1.1 tron </p>
59 1.1 tron
60 1.1 tron <p> You can build a pre-built Postfix package as an unprivileged
61 1.1 tron user. </p>
62 1.1 tron
63 1.1 tron <p> First compile Postfix. After successful compilation, execute:
64 1.1 tron </p>
65 1.1 tron
66 1.1 tron <blockquote> <pre> % <b>make package</b> </pre>
67 1.1 tron </blockquote>
68 1.1 tron
69 1.1 tron <p> With Postfix versions before 2.2 you must invoke the post-install
70 1.1 tron script directly (<tt>% <b>sh post-install</b></tt>). </p>
71 1.1 tron
72 1.1 tron <p> You will be prompted for installation parameters. Specify an
73 1.1 tron install_root directory other than /. The mail_owner and setgid_group
74 1.1 tron installation parameter settings will be recorded in the main.cf
75 1.1 tron file, but they won't take effect until the package is unpacked and
76 1.1 tron installed on the destination machine. </p>
77 1.1 tron
78 1.1 tron <p> If you want to fully automate this process, specify all the
79 1.1 tron non-default installation parameters on the command line: </p>
80 1.1 tron
81 1.1 tron <blockquote>
82 1.1 tron <pre> % <b>make non-interactive-package install_root=/some/where</b>...
83 1.1 tron </pre> </blockquote>
84 1.1 tron
85 1.1 tron <p> With Postfix versions before 2.2 you must invoke the post-install
86 1.1 tron script directly (<tt>% <b>sh post-install -non-interactive
87 1.1 tron install_root...</b></tt>). </p>
88 1.1 tron
89 1.1.1.3 christos <p> With Postfix 3.0 and later, the command "make package name=value
90 1.1.1.3 christos ..." will replace the string MAIL_VERSION in a configuration parameter
91 1.1.1.3 christos value with the Postfix release version. Do not try to specify
92 1.1.1.3 christos something like $mail_version on this command line. This produces
93 1.1.1.3 christos inconsistent results with different versions of the make(1) command.
94 1.1.1.3 christos </p>
95 1.1.1.3 christos
96 1.1 tron <h2>Begin Security Alert</h2>
97 1.1 tron
98 1.1 tron <p> <b> When building an archive for distribution, be sure to
99 1.1 tron archive only files and symbolic links, not their parent directories.
100 1.1 tron Otherwise, unpacking a pre-built Postfix package may mess up
101 1.1 tron permission and/or ownership of system directories such as / /etc
102 1.1 tron /usr /usr/bin /var /var/spool and so on. This is especially an
103 1.1 tron issue if you executed postfix-install (see above) as an unprivileged
104 1.1 tron user. </b> </p>
105 1.1 tron
106 1.1 tron <h2>End Security Alert</h2>
107 1.1 tron
108 1.1 tron <p> Thus, to tar up the pre-built package, take the following steps:
109 1.1 tron </p>
110 1.1 tron
111 1.1 tron <blockquote> <pre>
112 1.1 tron % cd INSTALL_ROOT
113 1.1 tron % rm -f SOMEWHERE/outputfile
114 1.1 tron % find . \! -type d -print | xargs tar rf SOMEWHERE/outputfile
115 1.1 tron % gzip SOMEWHERE/outputfile </pre> </blockquote>
116 1.1 tron
117 1.1 tron <p>This way you will not include any directories that might cause
118 1.1 tron trouble upon extraction. </p>
119 1.1 tron
120 1.1 tron <h2>Installing a pre-built Postfix package</h2>
121 1.1 tron
122 1.1 tron <ul>
123 1.1 tron
124 1.1 tron <li> <p> To unpack a pre-built Postfix package, execute the equivalent
125 1.1 tron of: </p>
126 1.1 tron
127 1.1 tron <pre>
128 1.1 tron # umask 022
129 1.1 tron # gzip -d <outputfile.tar.gz | (cd / ; tar xvpf -) </pre>
130 1.1 tron
131 1.1 tron <p> The umask command is necessary for getting the correct permissions
132 1.1 tron on non-Postfix directories that need to be created in the process.
133 1.1 tron </p>
134 1.1 tron
135 1.1 tron <li> <p> Create the necessary mail_owner account and setgid_group
136 1.1 tron group for exclusive use by Postfix. </p>
137 1.1 tron
138 1.1 tron <li> <p> Execute the postfix command to set ownership and permission
139 1.1 tron of Postfix files and directories, and to update Postfix configuration
140 1.1 tron files. If necessary, specify any non-default settings for mail_owner
141 1.1 tron or setgid_group on the postfix command line: </p>
142 1.1 tron
143 1.1 tron <pre>
144 1.1 tron # postfix set-permissions upgrade-configuration \
145 1.1 tron setgid_group=xxx mail_owner=yyy
146 1.1 tron </pre>
147 1.1 tron
148 1.1 tron <p> With Postfix versions before 2.1 you achieve the same result
149 1.1 tron by invoking the post-install script directly. </p>
150 1.1 tron
151 1.1 tron </ul>
152 1.1 tron
153 1.1 tron </body>
154 1.1 tron
155 1.1 tron </html>
156