| @@ -1,3449 +1,3388 @@ | | | @@ -1,3449 +1,3388 @@ |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
2 | <html> | | 2 | <html> |
3 | <head> | | 3 | <head> |
4 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | | 4 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
5 | <title>The pkgsrc guide</title> | | 5 | <title>The pkgsrc guide</title> |
6 | <link rel="stylesheet" type="text/css" href="/global.css"> | | 6 | <link rel="stylesheet" type="text/css" href="/global.css"> |
7 | <meta name="generator" content="DocBook XSL Stylesheets VX.X.X"> | | 7 | <meta name="generator" content="DocBook XSL Stylesheets VX.X.X"> |
8 | <meta name="description" content="pkgsrc is a centralized package management system for Unix-like operating systems. This guide provides information for users and developers of pkgsrc. It covers installation of binary and source packages, creation of binary and source packages and a high-level overview about the infrastructure."> | | 8 | <meta name="description" content="pkgsrc is a centralized package management system for Unix-like operating systems. This guide provides information for users and developers of pkgsrc. It covers installation of binary and source packages, creation of binary and source packages and a high-level overview about the infrastructure."> |
9 | </head> | | 9 | </head> |
10 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book"> | | 10 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book"> |
11 | <div class="titlepage"> | | 11 | <div class="titlepage"> |
12 | <div> | | 12 | <div> |
13 | <div><h1 class="title"> | | 13 | <div><h1 class="title"> |
14 | <a name="the-pkgsrc-guide"></a>The pkgsrc guide</h1></div> | | 14 | <a name="the-pkgsrc-guide"></a>The pkgsrc guide</h1></div> |
15 | <div><h2 class="subtitle">Documentation on the NetBSD packages system</h2></div> | | 15 | <div><h2 class="subtitle">Documentation on the NetBSD packages system</h2></div> |
16 | <div><div class="authorgroup"> | | 16 | <div><div class="authorgroup"> |
17 | <div class="author"> | | 17 | <div class="author"> |
18 | <h3 class="author"> | | 18 | <h3 class="author"> |
19 | <span class="firstname">Alistair</span> <span class="surname">Crooks</span> | | 19 | <span class="firstname">Alistair</span> <span class="surname">Crooks</span> |
20 | </h3> | | 20 | </h3> |
21 | <div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:agc@NetBSD.org">agc@NetBSD.org</a>></code></p></div></div> | | 21 | <div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:agc@NetBSD.org">agc@NetBSD.org</a>></code></p></div></div> |
22 | </div> | | 22 | </div> |
23 | <div class="author"> | | 23 | <div class="author"> |
24 | <h3 class="author"> | | 24 | <h3 class="author"> |
25 | <span class="firstname">Hubert</span> <span class="surname">Feyrer</span> | | 25 | <span class="firstname">Hubert</span> <span class="surname">Feyrer</span> |
26 | </h3> | | 26 | </h3> |
27 | <div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:hubertf@NetBSD.org">hubertf@NetBSD.org</a>></code></p></div></div> | | 27 | <div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:hubertf@NetBSD.org">hubertf@NetBSD.org</a>></code></p></div></div> |
28 | </div> | | 28 | </div> |
29 | <h3 class="corpauthor"> | | 29 | <h3 class="corpauthor"> |
30 | The pkgsrc Developers | | 30 | The pkgsrc Developers |
31 | </h3> | | 31 | </h3> |
32 | </div></div> | | 32 | </div></div> |
33 | <div><p class="copyright">Copyright © 1994-2020 The NetBSD Foundation, Inc</p></div> | | 33 | <div><p class="copyright">Copyright © 1994-2020 The NetBSD Foundation, Inc</p></div> |
34 | <div><p class="pubdate">$NetBSD: pkgsrc.xml,v 1.36 2020/01/03 15:55:24 leot Exp $</p></div> | | 34 | <div><p class="pubdate">$NetBSD: pkgsrc.xml,v 1.36 2020/01/03 15:55:24 leot Exp $</p></div> |
35 | <div><div class="abstract"> | | 35 | <div><div class="abstract"> |
36 | <p class="title"><b>Abstract</b></p> | | 36 | <p class="title"><b>Abstract</b></p> |
37 | <p>pkgsrc is a centralized package management system for | | 37 | <p>pkgsrc is a centralized package management system for |
38 | Unix-like operating systems. This guide provides information for | | 38 | Unix-like operating systems. This guide provides information for |
39 | users and developers of pkgsrc. It covers installation of binary | | 39 | users and developers of pkgsrc. It covers installation of binary |
40 | and source packages, creation of binary and source packages and | | 40 | and source packages, creation of binary and source packages and |
41 | a high-level overview about the infrastructure.</p> | | 41 | a high-level overview about the infrastructure.</p> |
42 | </div></div> | | 42 | </div></div> |
43 | </div> | | 43 | </div> |
44 | <hr> | | 44 | <hr> |
45 | </div> | | 45 | </div> |
46 | <div class="toc"> | | 46 | <div class="toc"> |
47 | <p><b>Table of Contents</b></p> | | 47 | <p><b>Table of Contents</b></p> |
48 | <dl class="toc"> | | 48 | <dl class="toc"> |
49 | <dt><span class="chapter"><a href="#introduction">1. What is pkgsrc?</a></span></dt> | | 49 | <dt><span class="chapter"><a href="#introduction">1. What is pkgsrc?</a></span></dt> |
50 | <dd><dl> | | 50 | <dd><dl> |
51 | <dt><span class="sect1"><a href="#introduction-section">1.1. Introduction</a></span></dt> | | 51 | <dt><span class="sect1"><a href="#introduction-section">1.1. Introduction</a></span></dt> |
52 | <dd><dl> | | 52 | <dd><dl> |
53 | <dt><span class="sect2"><a href="#why-pkgsrc">1.1.1. Why pkgsrc?</a></span></dt> | | 53 | <dt><span class="sect2"><a href="#why-pkgsrc">1.1.1. Why pkgsrc?</a></span></dt> |
54 | <dt><span class="sect2"><a href="#intro.platforms">1.1.2. Supported platforms</a></span></dt> | | 54 | <dt><span class="sect2"><a href="#intro.platforms">1.1.2. Supported platforms</a></span></dt> |
55 | </dl></dd> | | 55 | </dl></dd> |
56 | <dt><span class="sect1"><a href="#overview">1.2. Overview</a></span></dt> | | 56 | <dt><span class="sect1"><a href="#overview">1.2. Overview</a></span></dt> |
57 | <dt><span class="sect1"><a href="#terminology">1.3. Terminology</a></span></dt> | | 57 | <dt><span class="sect1"><a href="#terminology">1.3. Terminology</a></span></dt> |
58 | <dd><dl><dt><span class="sect2"><a href="#term.roles">1.3.1. Roles involved in pkgsrc</a></span></dt></dl></dd> | | 58 | <dd><dl><dt><span class="sect2"><a href="#term.roles">1.3.1. Roles involved in pkgsrc</a></span></dt></dl></dd> |
59 | <dt><span class="sect1"><a href="#typography">1.4. Typography</a></span></dt> | | 59 | <dt><span class="sect1"><a href="#typography">1.4. Typography</a></span></dt> |
60 | </dl></dd> | | 60 | </dl></dd> |
61 | <dt><span class="part"><a href="#users-guide">I. The pkgsrc user's guide</a></span></dt> | | 61 | <dt><span class="part"><a href="#users-guide">I. The pkgsrc user's guide</a></span></dt> |
62 | <dd><dl> | | 62 | <dd><dl> |
63 | <dt><span class="chapter"><a href="#help-user">2. Getting help</a></span></dt> | | 63 | <dt><span class="chapter"><a href="#help-user">2. Getting help</a></span></dt> |
64 | <dt><span class="chapter"><a href="#getting">3. Where to get pkgsrc and how to keep it up-to-date</a></span></dt> | | 64 | <dt><span class="chapter"><a href="#getting">3. Where to get pkgsrc and how to keep it up-to-date</a></span></dt> |
65 | <dd><dl> | | 65 | <dd><dl> |
66 | <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt> | | 66 | <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt> |
67 | <dd><dl> | | 67 | <dd><dl> |
68 | <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt> | | 68 | <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt> |
69 | <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt> | | 69 | <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt> |
70 | </dl></dd> | | 70 | </dl></dd> |
71 | <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt> | | 71 | <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt> |
72 | <dd><dl> | | 72 | <dd><dl> |
73 | <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt> | | 73 | <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt> |
74 | <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt> | | 74 | <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt> |
75 | </dl></dd> | | 75 | </dl></dd> |
76 | </dl></dd> | | 76 | </dl></dd> |
77 | <dt><span class="chapter"><a href="#platforms">4. Using pkgsrc on systems other than NetBSD</a></span></dt> | | 77 | <dt><span class="chapter"><a href="#platforms">4. Using pkgsrc on systems other than NetBSD</a></span></dt> |
78 | <dd><dl> | | 78 | <dd><dl> |
79 | <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt> | | 79 | <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt> |
80 | <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt> | | 80 | <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt> |
81 | </dl></dd> | | 81 | </dl></dd> |
82 | <dt><span class="chapter"><a href="#using">5. Using pkgsrc</a></span></dt> | | 82 | <dt><span class="chapter"><a href="#using">5. Using pkgsrc</a></span></dt> |
83 | <dd><dl> | | 83 | <dd><dl> |
84 | <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt> | | 84 | <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt> |
85 | <dd><dl> | | 85 | <dd><dl> |
86 | <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt> | | 86 | <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt> |
87 | <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt> | | 87 | <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt> |
88 | <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt> | | 88 | <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt> |
89 | <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt> | | 89 | <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt> |
90 | <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> | | 90 | <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> |
91 | <dt><span class="sect2"><a href="#pkg_versions">5.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> | | 91 | <dt><span class="sect2"><a href="#pkg_versions">5.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> |
92 | <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt> | | 92 | <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt> |
93 | </dl></dd> | | 93 | </dl></dd> |
94 | <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt> | | 94 | <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt> |
95 | <dd><dl> | | 95 | <dd><dl> |
96 | <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt> | | 96 | <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt> |
97 | <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt> | | 97 | <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt> |
98 | <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt> | | 98 | <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt> |
99 | </dl></dd> | | 99 | </dl></dd> |
100 | </dl></dd> | | 100 | </dl></dd> |
101 | <dt><span class="chapter"><a href="#configuring">6. Configuring pkgsrc</a></span></dt> | | 101 | <dt><span class="chapter"><a href="#configuring">6. Configuring pkgsrc</a></span></dt> |
102 | <dd><dl> | | 102 | <dd><dl> |
103 | <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt> | | 103 | <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt> |
104 | <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt> | | 104 | <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt> |
105 | <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt> | | 105 | <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt> |
106 | <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt> | | 106 | <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt> |
107 | <dd><dl> | | 107 | <dd><dl> |
108 | <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt> | | 108 | <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt> |
109 | <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt> | | 109 | <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt> |
110 | <dt><span class="sect2"><a href="#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt> | | 110 | <dt><span class="sect2"><a href="#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt> |
111 | </dl></dd> | | 111 | </dl></dd> |
112 | <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt> | | 112 | <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt> |
113 | <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt> | | 113 | <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt> |
114 | </dl></dd> | | 114 | </dl></dd> |
115 | <dt><span class="chapter"><a href="#binary">7. Creating binary packages</a></span></dt> | | 115 | <dt><span class="chapter"><a href="#binary">7. Creating binary packages</a></span></dt> |
116 | <dd><dl> | | 116 | <dd><dl> |
117 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> | | 117 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> |
118 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> | | 118 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> |
119 | </dl></dd> | | 119 | </dl></dd> |
120 | <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk | | 120 | <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk |
121 | builds)</a></span></dt> | | 121 | builds)</a></span></dt> |
122 | <dd><dl> | | 122 | <dd><dl> |
123 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> | | 123 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> |
124 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> | | 124 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> |
125 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> | | 125 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> |
126 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> | | 126 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> |
127 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> | | 127 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> |
128 | <dd><dl> | | 128 | <dd><dl> |
129 | <dt><span class="sect2"><a href="#bulk.var.subst_noop">8.4.1. Strict SUBST blocks</a></span></dt> | | 129 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt> |
130 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.2. Detect unknown configure options</a></span></dt> | | 130 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt> |
131 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.3. Detect classes of bugs by forcing compiler warnings</a></span></dt> | | 131 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.3. Use custom directories</a></span></dt> |
132 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt> | | 132 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.4. Turn warnings into errors</a></span></dt> |
133 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt> | | 133 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.5. Reject packages for which pkglint reports errors</a></span></dt> |
134 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt> | | 134 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.6. Reject packages that contain forbidden strings</a></span></dt> |
135 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt> | | 135 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.7. Reject packages whose self-test fails</a></span></dt> |
136 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt> | | 136 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.8. Reject packages that use undefined shell variables</a></span></dt> |
137 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt> | | 137 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.9. Turn off verbose logging</a></span></dt> |
138 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt> | | | |
139 | <dt><span class="sect2"><a href="#bulk.var.options">8.4.11. Select random sets of options</a></span></dt> | | | |
140 | <dt><span class="sect2"><a href="#bulk.var.build_defs">8.4.12. Select random configurations of BUILD_DEFS</a></span></dt> | | | |
141 | </dl></dd> | | 138 | </dl></dd> |
142 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> | | 139 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> |
143 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> | | 140 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> |
144 | </dl></dd> | | 141 | </dl></dd> |
145 | <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt> | | 142 | <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt> |
146 | <dd><dl> | | 143 | <dd><dl> |
147 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> | | 144 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> |
148 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> | | 145 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> |
149 | </dl></dd> | | 146 | </dl></dd> |
150 | <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt> | | 147 | <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt> |
151 | <dd><dl> | | 148 | <dd><dl> |
152 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> | | 149 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> |
153 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> | | 150 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> |
154 | <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt> | | 151 | <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt> |
155 | <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt> | | 152 | <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt> |
156 | <dt><span class="sect1"><a href="#x.org-from-pkgsrc">10.5. How can I install/use modular X.org from pkgsrc?</a></span></dt> | | 153 | <dt><span class="sect1"><a href="#x.org-from-pkgsrc">10.5. How can I install/use modular X.org from pkgsrc?</a></span></dt> |
157 | <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt> | | 154 | <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt> |
158 | <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt> | | 155 | <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt> |
159 | <dt><span class="sect1"><a href="#passive-ftp">10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</a></span></dt> | | 156 | <dt><span class="sect1"><a href="#passive-ftp">10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</a></span></dt> |
160 | <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt> | | 157 | <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt> |
161 | <dt><span class="sect1"><a href="#tmac.andoc-missing">10.10. What does <span class="quote">“<span class="quote">Don't know how to make | | 158 | <dt><span class="sect1"><a href="#tmac.andoc-missing">10.10. What does <span class="quote">“<span class="quote">Don't know how to make |
162 | /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt> | | 159 | /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt> |
163 | <dt><span class="sect1"><a href="#bsd.own.mk-missing">10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</a></span></dt> | | 160 | <dt><span class="sect1"><a href="#bsd.own.mk-missing">10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</a></span></dt> |
164 | <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt> | | 161 | <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt> |
165 | <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt> | | 162 | <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt> |
166 | <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt> | | 163 | <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt> |
167 | <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt> | | 164 | <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt> |
168 | <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt> | | 165 | <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt> |
169 | <dt><span class="sect1"><a href="#faq.rcs-conflicts">10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</a></span></dt> | | 166 | <dt><span class="sect1"><a href="#faq.rcs-conflicts">10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</a></span></dt> |
170 | </dl></dd> | | 167 | </dl></dd> |
171 | </dl></dd> | | 168 | </dl></dd> |
172 | <dt><span class="part"><a href="#developers-guide">II. The pkgsrc developer's guide</a></span></dt> | | 169 | <dt><span class="part"><a href="#developers-guide">II. The pkgsrc developer's guide</a></span></dt> |
173 | <dd><dl> | | 170 | <dd><dl> |
174 | <dt><span class="chapter"><a href="#help-devel">11. Getting help</a></span></dt> | | 171 | <dt><span class="chapter"><a href="#help-devel">11. Getting help</a></span></dt> |
175 | <dt><span class="chapter"><a href="#creating">12. Creating a new pkgsrc package from scratch</a></span></dt> | | 172 | <dt><span class="chapter"><a href="#creating">12. Creating a new pkgsrc package from scratch</a></span></dt> |
176 | <dd><dl> | | 173 | <dd><dl> |
177 | <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt> | | 174 | <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt> |
178 | <dd><dl> | | 175 | <dd><dl> |
179 | <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt> | | 176 | <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt> |
180 | <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt> | | 177 | <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt> |
181 | <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt> | | 178 | <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt> |
182 | <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt> | | 179 | <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt> |
183 | </dl></dd> | | 180 | </dl></dd> |
184 | <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt> | | 181 | <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt> |
185 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">12.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> | | 182 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">12.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> |
186 | </dl></dd> | | 183 | </dl></dd> |
187 | <dt><span class="chapter"><a href="#components">13. Package components - files, directories and contents</a></span></dt> | | 184 | <dt><span class="chapter"><a href="#components">13. Package components - files, directories and contents</a></span></dt> |
188 | <dd><dl> | | 185 | <dd><dl> |
189 | <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt> | | 186 | <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt> |
190 | <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt> | | 187 | <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt> |
191 | <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt> | | 188 | <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt> |
192 | <dd><dl> | | 189 | <dd><dl> |
193 | <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt> | | 190 | <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt> |
194 | <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt> | | 191 | <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt> |
195 | <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt> | | 192 | <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt> |
196 | <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt> | | 193 | <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt> |
197 | <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt> | | 194 | <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt> |
198 | </dl></dd> | | 195 | </dl></dd> |
199 | <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt> | | 196 | <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt> |
200 | <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt> | | 197 | <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt> |
201 | <dd><dl> | | 198 | <dd><dl> |
202 | <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt> | | 199 | <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt> |
203 | <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt> | | 200 | <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt> |
204 | <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt> | | 201 | <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt> |
205 | </dl></dd> | | 202 | </dl></dd> |
206 | <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt> | | 203 | <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt> |
207 | <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt> | | 204 | <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt> |
208 | </dl></dd> | | 205 | </dl></dd> |
209 | <dt><span class="chapter"><a href="#makefile">14. Programming in <code class="filename">Makefile</code>s</a></span></dt> | | 206 | <dt><span class="chapter"><a href="#makefile">14. Programming in <code class="filename">Makefile</code>s</a></span></dt> |
210 | <dd><dl> | | 207 | <dd><dl> |
211 | <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt> | | 208 | <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt> |
212 | <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt> | | 209 | <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt> |
213 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd> | | 210 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd> |
214 | <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt> | | 211 | <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt> |
215 | <dd><dl> | | 212 | <dd><dl> |
216 | <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt> | | 213 | <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt> |
217 | <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt> | | 214 | <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt> |
218 | <dt><span class="sect2"><a href="#cflags-gnu-configure">14.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt> | | 215 | <dt><span class="sect2"><a href="#cflags-gnu-configure">14.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt> |
219 | <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt> | | 216 | <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt> |
220 | </dl></dd> | | 217 | </dl></dd> |
221 | </dl></dd> | | 218 | </dl></dd> |
222 | <dt><span class="chapter"><a href="#plist">15. PLIST issues</a></span></dt> | | 219 | <dt><span class="chapter"><a href="#plist">15. PLIST issues</a></span></dt> |
223 | <dd><dl> | | 220 | <dd><dl> |
224 | <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt> | | 221 | <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt> |
225 | <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> | | 222 | <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> |
226 | <dt><span class="sect1"><a href="#print-PLIST">15.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> | | 223 | <dt><span class="sect1"><a href="#print-PLIST">15.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> |
227 | <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt> | | 224 | <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt> |
228 | <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt> | | 225 | <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt> |
229 | <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> | | 226 | <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> |
230 | <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt> | | 227 | <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt> |
231 | <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt> | | 228 | <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt> |
232 | <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt> | | 229 | <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt> |
233 | </dl></dd> | | 230 | </dl></dd> |
234 | <dt><span class="chapter"><a href="#buildlink">16. Buildlink methodology</a></span></dt> | | 231 | <dt><span class="chapter"><a href="#buildlink">16. Buildlink methodology</a></span></dt> |
235 | <dd><dl> | | 232 | <dd><dl> |
236 | <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt> | | 233 | <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt> |
237 | <dt><span class="sect1"><a href="#creating-buildlink3.mk">16.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt> | | 234 | <dt><span class="sect1"><a href="#creating-buildlink3.mk">16.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt> |
238 | <dd><dl> | | 235 | <dd><dl> |
239 | <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt> | | 236 | <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt> |
240 | <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating | | 237 | <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating |
241 | <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code> | | 238 | <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code> |
242 | and | | 239 | and |
243 | <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code> | | 240 | <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code> |
244 | in <code class="filename">buildlink3.mk</code> files</a></span></dt> | | 241 | in <code class="filename">buildlink3.mk</code> files</a></span></dt> |
245 | </dl></dd> | | 242 | </dl></dd> |
246 | <dt><span class="sect1"><a href="#writing-builtin.mk">16.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt> | | 243 | <dt><span class="sect1"><a href="#writing-builtin.mk">16.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt> |
247 | <dd><dl> | | 244 | <dd><dl> |
248 | <dt><span class="sect2"><a href="#anatomy-of-builtin.mk">16.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</a></span></dt> | | 245 | <dt><span class="sect2"><a href="#anatomy-of-builtin.mk">16.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</a></span></dt> |
249 | <dt><span class="sect2"><a href="#native-or-pkgsrc-preference">16.3.2. Global preferences for native or pkgsrc software</a></span></dt> | | 246 | <dt><span class="sect2"><a href="#native-or-pkgsrc-preference">16.3.2. Global preferences for native or pkgsrc software</a></span></dt> |
250 | </dl></dd> | | 247 | </dl></dd> |
251 | </dl></dd> | | 248 | </dl></dd> |
252 | <dt><span class="chapter"><a href="#pkginstall">17. The pkginstall framework</a></span></dt> | | 249 | <dt><span class="chapter"><a href="#pkginstall">17. The pkginstall framework</a></span></dt> |
253 | <dd><dl> | | 250 | <dd><dl> |
254 | <dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">17.1. Files and directories outside the installation prefix</a></span></dt> | | 251 | <dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">17.1. Files and directories outside the installation prefix</a></span></dt> |
255 | <dd><dl> | | 252 | <dd><dl> |
256 | <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt> | | 253 | <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt> |
257 | <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt> | | 254 | <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt> |
258 | </dl></dd> | | 255 | </dl></dd> |
259 | <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt> | | 256 | <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt> |
260 | <dd><dl> | | 257 | <dd><dl> |
261 | <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt> | | 258 | <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt> |
262 | <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt> | | 259 | <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt> |
263 | <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt> | | 260 | <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt> |
264 | <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt> | | 261 | <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt> |
265 | </dl></dd> | | 262 | </dl></dd> |
266 | <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt> | | 263 | <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt> |
267 | <dd><dl><dt><span class="sect2"><a href="#rcd-scripts-disable">17.3.1. Disabling handling of system startup scripts</a></span></dt></dl></dd> | | 264 | <dd><dl><dt><span class="sect2"><a href="#rcd-scripts-disable">17.3.1. Disabling handling of system startup scripts</a></span></dt></dl></dd> |
268 | <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt> | | 265 | <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt> |
269 | <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt> | | 266 | <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt> |
270 | <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd> | | 267 | <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd> |
271 | <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt> | | 268 | <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt> |
272 | <dd><dl><dt><span class="sect2"><a href="#fonts-disable">17.6.1. Disabling automatic update of the fonts databases</a></span></dt></dl></dd> | | 269 | <dd><dl><dt><span class="sect2"><a href="#fonts-disable">17.6.1. Disabling automatic update of the fonts databases</a></span></dt></dl></dd> |
273 | </dl></dd> | | 270 | </dl></dd> |
274 | <dt><span class="chapter"><a href="#options">18. Options handling</a></span></dt> | | 271 | <dt><span class="chapter"><a href="#options">18. Options handling</a></span></dt> |
275 | <dd><dl> | | 272 | <dd><dl> |
276 | <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt> | | 273 | <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt> |
277 | <dt><span class="sect1"><a href="#converting-to-options">18.2. Converting packages to use <code class="filename">bsd.options.mk</code></a></span></dt> | | 274 | <dt><span class="sect1"><a href="#converting-to-options">18.2. Converting packages to use <code class="filename">bsd.options.mk</code></a></span></dt> |
278 | <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt> | | 275 | <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt> |
279 | <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt> | | 276 | <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt> |
280 | </dl></dd> | | 277 | </dl></dd> |
281 | <dt><span class="chapter"><a href="#build">19. The build process</a></span></dt> | | 278 | <dt><span class="chapter"><a href="#build">19. The build process</a></span></dt> |
282 | <dd><dl> | | 279 | <dd><dl> |
283 | <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt> | | 280 | <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt> |
284 | <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt> | | 281 | <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt> |
285 | <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt> | | 282 | <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt> |
286 | <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt> | | 283 | <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt> |
287 | <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt> | | 284 | <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt> |
288 | <dd><dl> | | 285 | <dd><dl> |
289 | <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt> | | 286 | <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt> |
290 | <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt> | | 287 | <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt> |
291 | </dl></dd> | | 288 | </dl></dd> |
292 | <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt> | | 289 | <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt> |
293 | <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt> | | 290 | <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt> |
294 | <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt> | | 291 | <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt> |
295 | <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt> | | 292 | <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt> |
296 | <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt> | | 293 | <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt> |
297 | <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt> | | 294 | <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt> |
298 | <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt> | | 295 | <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt> |
299 | <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt> | | 296 | <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt> |
300 | <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt> | | 297 | <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt> |
301 | <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt> | | 298 | <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt> |
302 | <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt> | | 299 | <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt> |
303 | <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt> | | 300 | <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt> |
304 | </dl></dd> | | 301 | </dl></dd> |
305 | <dt><span class="chapter"><a href="#tools">20. Tools needed for building or running</a></span></dt> | | 302 | <dt><span class="chapter"><a href="#tools">20. Tools needed for building or running</a></span></dt> |
306 | <dd><dl> | | 303 | <dd><dl> |
307 | <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt> | | 304 | <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt> |
308 | <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt> | | 305 | <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt> |
309 | <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt> | | 306 | <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt> |
310 | </dl></dd> | | 307 | </dl></dd> |
311 | <dt><span class="chapter"><a href="#fixes">21. Making your package work</a></span></dt> | | 308 | <dt><span class="chapter"><a href="#fixes">21. Making your package work</a></span></dt> |
312 | <dd><dl> | | 309 | <dd><dl> |
313 | <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt> | | 310 | <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt> |
314 | <dd><dl> | | 311 | <dd><dl> |
315 | <dt><span class="sect2"><a href="#pulling-vars-from-etc-mk.conf">21.1.1. How to pull in user-settable variables from <code class="filename">mk.conf</code></a></span></dt> | | 312 | <dt><span class="sect2"><a href="#pulling-vars-from-etc-mk.conf">21.1.1. How to pull in user-settable variables from <code class="filename">mk.conf</code></a></span></dt> |
316 | <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt> | | 313 | <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt> |
317 | <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt> | | 314 | <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt> |
318 | <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt> | | 315 | <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt> |
319 | <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt> | | 316 | <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt> |
320 | <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt> | | 317 | <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt> |
321 | <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt> | | 318 | <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt> |
322 | <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt> | | 319 | <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt> |
323 | <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt> | | 320 | <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt> |
324 | <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt> | | 321 | <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt> |
325 | <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt> | | 322 | <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt> |
326 | </dl></dd> | | 323 | </dl></dd> |
327 | <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt> | | 324 | <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt> |
328 | <dd><dl> | | 325 | <dd><dl> |
329 | <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> | | 326 | <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> |
330 | <dt><span class="sect2"><a href="#modified-distfiles-same-name">21.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> | | 327 | <dt><span class="sect2"><a href="#modified-distfiles-same-name">21.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> |
331 | <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt> | | 328 | <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt> |
332 | </dl></dd> | | 329 | </dl></dd> |
333 | <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt> | | 330 | <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt> |
334 | <dd><dl> | | 331 | <dd><dl> |
335 | <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt> | | 332 | <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt> |
336 | <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> | | 333 | <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> |
337 | <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt> | | 334 | <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt> |
338 | </dl></dd> | | 335 | </dl></dd> |
339 | <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt> | | 336 | <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt> |
340 | <dd><dl> | | 337 | <dd><dl> |
341 | <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt> | | 338 | <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt> |
342 | <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt> | | 339 | <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt> |
343 | <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt> | | 340 | <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt> |
344 | <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt> | | 341 | <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt> |
345 | <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt> | | 342 | <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt> |
346 | </dl></dd> | | 343 | </dl></dd> |
347 | <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt> | | 344 | <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt> |
348 | <dd><dl> | | 345 | <dd><dl> |
349 | <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt> | | 346 | <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt> |
350 | <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt> | | 347 | <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt> |
351 | <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt> | | 348 | <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt> |
352 | <dt><span class="sect2"><a href="#undefined-reference">21.5.4. Undefined reference to <span class="quote">“<span class="quote">...</span>”</span></a></span></dt> | | 349 | <dt><span class="sect2"><a href="#undefined-reference">21.5.4. Undefined reference to <span class="quote">“<span class="quote">...</span>”</span></a></span></dt> |
353 | <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt> | | 350 | <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt> |
354 | </dl></dd> | | 351 | </dl></dd> |
355 | <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt> | | 352 | <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt> |
356 | <dd><dl> | | 353 | <dd><dl> |
357 | <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt> | | 354 | <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt> |
358 | <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt> | | 355 | <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt> |
359 | <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt> | | 356 | <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt> |
360 | <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt> | | 357 | <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt> |
361 | <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt> | | 358 | <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt> |
362 | <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt> | | 359 | <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt> |
363 | <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt> | | 360 | <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt> |
364 | <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt> | | 361 | <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt> |
365 | <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt> | | 362 | <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt> |
366 | <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt> | | 363 | <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt> |
367 | <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt> | | 364 | <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt> |
368 | <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt> | | 365 | <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt> |
369 | <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt> | | 366 | <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt> |
370 | <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt> | | 367 | <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt> |
371 | <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt> | | 368 | <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt> |
372 | <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt> | | 369 | <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt> |
373 | <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt> | | 370 | <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt> |
374 | <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in | | 371 | <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in |
375 | emulation</a></span></dt> | | 372 | emulation</a></span></dt> |
376 | <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt> | | 373 | <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt> |
377 | <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt> | | 374 | <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt> |
378 | </dl></dd> | | 375 | </dl></dd> |
379 | <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt> | | 376 | <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt> |
380 | </dl></dd> | | 377 | </dl></dd> |
381 | <dt><span class="chapter"><a href="#debug">22. Debugging</a></span></dt> | | 378 | <dt><span class="chapter"><a href="#debug">22. Debugging</a></span></dt> |
382 | <dt><span class="chapter"><a href="#submit">23. Submitting and Committing</a></span></dt> | | 379 | <dt><span class="chapter"><a href="#submit">23. Submitting and Committing</a></span></dt> |
383 | <dd><dl> | | 380 | <dd><dl> |
384 | <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt> | | 381 | <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt> |
385 | <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt> | | 382 | <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt> |
386 | <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt> | | 383 | <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt> |
387 | <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt> | | 384 | <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt> |
388 | <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt> | | 385 | <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt> |
389 | <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt> | | 386 | <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt> |
390 | <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt> | | 387 | <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt> |
391 | <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt> | | 388 | <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt> |
392 | </dl></dd> | | 389 | </dl></dd> |
393 | <dt><span class="chapter"><a href="#devfaq">24. Frequently Asked Questions</a></span></dt> | | 390 | <dt><span class="chapter"><a href="#devfaq">24. Frequently Asked Questions</a></span></dt> |
394 | <dt><span class="chapter"><a href="#gnome">25. GNOME packaging and porting</a></span></dt> | | 391 | <dt><span class="chapter"><a href="#gnome">25. GNOME packaging and porting</a></span></dt> |
395 | <dd><dl> | | 392 | <dd><dl> |
396 | <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt> | | 393 | <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt> |
397 | <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt> | | 394 | <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt> |
398 | <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt> | | 395 | <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt> |
399 | <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt> | | 396 | <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt> |
400 | </dl></dd> | | 397 | </dl></dd> |
401 | </dl></dd> | | 398 | </dl></dd> |
402 | <dt><span class="part"><a href="#infrastructure">III. The pkgsrc infrastructure internals</a></span></dt> | | 399 | <dt><span class="part"><a href="#infrastructure">III. The pkgsrc infrastructure internals</a></span></dt> |
403 | <dd><dl> | | 400 | <dd><dl> |
404 | <dt><span class="chapter"><a href="#infr.design">26. Design of the pkgsrc infrastructure</a></span></dt> | | 401 | <dt><span class="chapter"><a href="#infr.design">26. Design of the pkgsrc infrastructure</a></span></dt> |
405 | <dd><dl> | | 402 | <dd><dl> |
406 | <dt><span class="sect1"><a href="#infr.vardef">26.1. The meaning of variable definitions</a></span></dt> | | 403 | <dt><span class="sect1"><a href="#infr.vardef">26.1. The meaning of variable definitions</a></span></dt> |
407 | <dt><span class="sect1"><a href="#infr.vardef.problems">26.2. Avoiding problems before they arise</a></span></dt> | | 404 | <dt><span class="sect1"><a href="#infr.vardef.problems">26.2. Avoiding problems before they arise</a></span></dt> |
408 | <dt><span class="sect1"><a href="#infr.var">26.3. Variable evaluation</a></span></dt> | | 405 | <dt><span class="sect1"><a href="#infr.var">26.3. Variable evaluation</a></span></dt> |
409 | <dd><dl> | | 406 | <dd><dl> |
410 | <dt><span class="sect2"><a href="#infr.var.load">26.3.1. At load time</a></span></dt> | | 407 | <dt><span class="sect2"><a href="#infr.var.load">26.3.1. At load time</a></span></dt> |
411 | <dt><span class="sect2"><a href="#infr.var.run">26.3.2. At runtime</a></span></dt> | | 408 | <dt><span class="sect2"><a href="#infr.var.run">26.3.2. At runtime</a></span></dt> |
412 | </dl></dd> | | 409 | </dl></dd> |
413 | <dt><span class="sect1"><a href="#infr.varspec">26.4. How can variables be specified?</a></span></dt> | | 410 | <dt><span class="sect1"><a href="#infr.varspec">26.4. How can variables be specified?</a></span></dt> |
414 | <dt><span class="sect1"><a href="#infr.design.intf">26.5. Designing interfaces for Makefile fragments</a></span></dt> | | 411 | <dt><span class="sect1"><a href="#infr.design.intf">26.5. Designing interfaces for Makefile fragments</a></span></dt> |
415 | <dd><dl> | | 412 | <dd><dl> |
416 | <dt><span class="sect2"><a href="#infr.design.intf.proc">26.5.1. Procedures with parameters</a></span></dt> | | 413 | <dt><span class="sect2"><a href="#infr.design.intf.proc">26.5.1. Procedures with parameters</a></span></dt> |
417 | <dt><span class="sect2"><a href="#infr.design.intf.action">26.5.2. Actions taken on behalf of parameters</a></span></dt> | | 414 | <dt><span class="sect2"><a href="#infr.design.intf.action">26.5.2. Actions taken on behalf of parameters</a></span></dt> |
418 | </dl></dd> | | 415 | </dl></dd> |
419 | <dt><span class="sect1"><a href="#infr.order">26.6. The order in which files are loaded</a></span></dt> | | 416 | <dt><span class="sect1"><a href="#infr.order">26.6. The order in which files are loaded</a></span></dt> |
420 | <dd><dl> | | 417 | <dd><dl> |
421 | <dt><span class="sect2"><a href="#infr.order.prefs">26.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt> | | 418 | <dt><span class="sect2"><a href="#infr.order.prefs">26.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt> |
422 | <dt><span class="sect2"><a href="#infr.order.pkg">26.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt> | | 419 | <dt><span class="sect2"><a href="#infr.order.pkg">26.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt> |
423 | </dl></dd> | | 420 | </dl></dd> |
424 | </dl></dd> | | 421 | </dl></dd> |
425 | <dt><span class="chapter"><a href="#regression">27. Regression tests</a></span></dt> | | 422 | <dt><span class="chapter"><a href="#regression">27. Regression tests</a></span></dt> |
426 | <dd><dl> | | 423 | <dd><dl> |
427 | <dt><span class="sect1"><a href="#regression.run">27.1. Running the regression tests</a></span></dt> | | 424 | <dt><span class="sect1"><a href="#regression.run">27.1. Running the regression tests</a></span></dt> |
428 | <dt><span class="sect1"><a href="#regression.new">27.2. Adding a new regression test</a></span></dt> | | 425 | <dt><span class="sect1"><a href="#regression.new">27.2. Adding a new regression test</a></span></dt> |
429 | <dd><dl> | | 426 | <dd><dl> |
430 | <dt><span class="sect2"><a href="#regression.fun.override">27.2.1. Overridable functions</a></span></dt> | | 427 | <dt><span class="sect2"><a href="#regression.fun.override">27.2.1. Overridable functions</a></span></dt> |
431 | <dt><span class="sect2"><a href="#regression.fun.helper">27.2.2. Helper functions</a></span></dt> | | 428 | <dt><span class="sect2"><a href="#regression.fun.helper">27.2.2. Helper functions</a></span></dt> |
432 | </dl></dd> | | 429 | </dl></dd> |
433 | </dl></dd> | | 430 | </dl></dd> |
434 | <dt><span class="chapter"><a href="#porting">28. Porting pkgsrc</a></span></dt> | | 431 | <dt><span class="chapter"><a href="#porting">28. Porting pkgsrc</a></span></dt> |
435 | <dd><dl><dt><span class="sect1"><a href="#porting.opsys">28.1. Porting pkgsrc to a new operating system</a></span></dt></dl></dd> | | 432 | <dd><dl><dt><span class="sect1"><a href="#porting.opsys">28.1. Porting pkgsrc to a new operating system</a></span></dt></dl></dd> |
436 | </dl></dd> | | 433 | </dl></dd> |
437 | <dt><span class="appendix"><a href="#examples">A. A simple example package: bison</a></span></dt> | | 434 | <dt><span class="appendix"><a href="#examples">A. A simple example package: bison</a></span></dt> |
438 | <dd><dl> | | 435 | <dd><dl> |
439 | <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt> | | 436 | <dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt> |
440 | <dd><dl> | | 437 | <dd><dl> |
441 | <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt> | | 438 | <dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt> |
442 | <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt> | | 439 | <dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt> |
443 | <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt> | | 440 | <dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt> |
444 | <dt><span class="sect2"><a href="#checking-package-with-pkglint">A.1.4. Checking a package with pkglint</a></span></dt> | | 441 | <dt><span class="sect2"><a href="#checking-package-with-pkglint">A.1.4. Checking a package with pkglint</a></span></dt> |
445 | </dl></dd> | | 442 | </dl></dd> |
446 | <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. Steps for building, installing, packaging</a></span></dt> | | 443 | <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. Steps for building, installing, packaging</a></span></dt> |
447 | </dl></dd> | | 444 | </dl></dd> |
448 | <dt><span class="appendix"><a href="#logs">B. Build logs</a></span></dt> | | 445 | <dt><span class="appendix"><a href="#logs">B. Build logs</a></span></dt> |
449 | <dd><dl> | | 446 | <dd><dl> |
450 | <dt><span class="sect1"><a href="#logs.building">B.1. Building figlet</a></span></dt> | | 447 | <dt><span class="sect1"><a href="#logs.building">B.1. Building figlet</a></span></dt> |
451 | <dt><span class="sect1"><a href="#logs.package">B.2. Packaging figlet</a></span></dt> | | 448 | <dt><span class="sect1"><a href="#logs.package">B.2. Packaging figlet</a></span></dt> |
452 | </dl></dd> | | 449 | </dl></dd> |
453 | <dt><span class="appendix"><a href="#ftp-layout">C. Directory layout of the pkgsrc FTP server</a></span></dt> | | 450 | <dt><span class="appendix"><a href="#ftp-layout">C. Directory layout of the pkgsrc FTP server</a></span></dt> |
454 | <dd><dl> | | 451 | <dd><dl> |
455 | <dt><span class="sect1"><a href="#ftp-distfiles">C.1. <code class="filename">distfiles</code>: The distributed source files</a></span></dt> | | 452 | <dt><span class="sect1"><a href="#ftp-distfiles">C.1. <code class="filename">distfiles</code>: The distributed source files</a></span></dt> |
456 | <dt><span class="sect1"><a href="#ftp-misc">C.2. <code class="filename">misc</code>: Miscellaneous things</a></span></dt> | | 453 | <dt><span class="sect1"><a href="#ftp-misc">C.2. <code class="filename">misc</code>: Miscellaneous things</a></span></dt> |
457 | <dt><span class="sect1"><a href="#ftp-packages">C.3. <code class="filename">packages</code>: Binary packages</a></span></dt> | | 454 | <dt><span class="sect1"><a href="#ftp-packages">C.3. <code class="filename">packages</code>: Binary packages</a></span></dt> |
458 | <dt><span class="sect1"><a href="#ftp-reports">C.4. <code class="filename">reports</code>: Bulk build reports</a></span></dt> | | 455 | <dt><span class="sect1"><a href="#ftp-reports">C.4. <code class="filename">reports</code>: Bulk build reports</a></span></dt> |
459 | <dt><span class="sect1"><a href="#ftp-source">C.5. <code class="filename">current</code>, | | 456 | <dt><span class="sect1"><a href="#ftp-source">C.5. <code class="filename">current</code>, |
460 | <code class="filename">stable</code>, | | 457 | <code class="filename">stable</code>, |
461 | <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>: | | 458 | <code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>: |
462 | source packages</a></span></dt> | | 459 | source packages</a></span></dt> |
463 | </dl></dd> | | 460 | </dl></dd> |
464 | <dt><span class="appendix"><a href="#help-topics">D. Help topics</a></span></dt> | | 461 | <dt><span class="appendix"><a href="#help-topics">D. Help topics</a></span></dt> |
465 | <dt><span class="appendix"><a href="#editing">E. Editing guidelines for the pkgsrc guide</a></span></dt> | | 462 | <dt><span class="appendix"><a href="#editing">E. Editing guidelines for the pkgsrc guide</a></span></dt> |
466 | <dd><dl> | | 463 | <dd><dl> |
467 | <dt><span class="sect1"><a href="#targets">E.1. Make targets</a></span></dt> | | 464 | <dt><span class="sect1"><a href="#targets">E.1. Make targets</a></span></dt> |
468 | <dt><span class="sect1"><a href="#procedure">E.2. Procedure</a></span></dt> | | 465 | <dt><span class="sect1"><a href="#procedure">E.2. Procedure</a></span></dt> |
469 | </dl></dd> | | 466 | </dl></dd> |
470 | </dl> | | 467 | </dl> |
471 | </div> | | 468 | </div> |
472 | <div class="list-of-tables"> | | 469 | <div class="list-of-tables"> |
473 | <p><b>List of Tables</b></p> | | 470 | <p><b>List of Tables</b></p> |
474 | <dl> | | 471 | <dl> |
475 | <dt>1.1. <a href="#supported-platforms">Platforms supported by pkgsrc</a> | | 472 | <dt>1.1. <a href="#supported-platforms">Platforms supported by pkgsrc</a> |
476 | </dt> | | 473 | </dt> |
477 | <dt>13.1. <a href="#patch-examples">Patching examples</a> | | 474 | <dt>13.1. <a href="#patch-examples">Patching examples</a> |
478 | </dt> | | 475 | </dt> |
479 | <dt>25.1. <a href="#plist-handling">PLIST handling for GNOME packages</a> | | 476 | <dt>25.1. <a href="#plist-handling">PLIST handling for GNOME packages</a> |
480 | </dt> | | 477 | </dt> |
481 | </dl> | | 478 | </dl> |
482 | </div> | | 479 | </div> |
483 | <div class="chapter"> | | 480 | <div class="chapter"> |
484 | <div class="titlepage"><div><div><h1 class="title"> | | 481 | <div class="titlepage"><div><div><h1 class="title"> |
485 | <a name="introduction"></a>Chapter 1. What is pkgsrc?</h1></div></div></div> | | 482 | <a name="introduction"></a>Chapter 1. What is pkgsrc?</h1></div></div></div> |
486 | <div class="toc"> | | 483 | <div class="toc"> |
487 | <p><b>Table of Contents</b></p> | | 484 | <p><b>Table of Contents</b></p> |
488 | <dl class="toc"> | | 485 | <dl class="toc"> |
489 | <dt><span class="sect1"><a href="#introduction-section">1.1. Introduction</a></span></dt> | | 486 | <dt><span class="sect1"><a href="#introduction-section">1.1. Introduction</a></span></dt> |
490 | <dd><dl> | | 487 | <dd><dl> |
491 | <dt><span class="sect2"><a href="#why-pkgsrc">1.1.1. Why pkgsrc?</a></span></dt> | | 488 | <dt><span class="sect2"><a href="#why-pkgsrc">1.1.1. Why pkgsrc?</a></span></dt> |
492 | <dt><span class="sect2"><a href="#intro.platforms">1.1.2. Supported platforms</a></span></dt> | | 489 | <dt><span class="sect2"><a href="#intro.platforms">1.1.2. Supported platforms</a></span></dt> |
493 | </dl></dd> | | 490 | </dl></dd> |
494 | <dt><span class="sect1"><a href="#overview">1.2. Overview</a></span></dt> | | 491 | <dt><span class="sect1"><a href="#overview">1.2. Overview</a></span></dt> |
495 | <dt><span class="sect1"><a href="#terminology">1.3. Terminology</a></span></dt> | | 492 | <dt><span class="sect1"><a href="#terminology">1.3. Terminology</a></span></dt> |
496 | <dd><dl><dt><span class="sect2"><a href="#term.roles">1.3.1. Roles involved in pkgsrc</a></span></dt></dl></dd> | | 493 | <dd><dl><dt><span class="sect2"><a href="#term.roles">1.3.1. Roles involved in pkgsrc</a></span></dt></dl></dd> |
497 | <dt><span class="sect1"><a href="#typography">1.4. Typography</a></span></dt> | | 494 | <dt><span class="sect1"><a href="#typography">1.4. Typography</a></span></dt> |
498 | </dl> | | 495 | </dl> |
499 | </div> | | 496 | </div> |
500 | <div class="sect1"> | | 497 | <div class="sect1"> |
501 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 498 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
502 | <a name="introduction-section"></a>1.1. Introduction</h2></div></div></div> | | 499 | <a name="introduction-section"></a>1.1. Introduction</h2></div></div></div> |
503 | <p>There is a lot of software freely available for Unix-based | | 500 | <p>There is a lot of software freely available for Unix-based |
504 | systems, which is usually available in form of the source code. Before | | 501 | systems, which is usually available in form of the source code. Before |
505 | such software can be used, it needs to be configured to the local | | 502 | such software can be used, it needs to be configured to the local |
506 | system, compiled and installed, and this is exactly what The NetBSD | | 503 | system, compiled and installed, and this is exactly what The NetBSD |
507 | Packages Collection (pkgsrc) does. pkgsrc also has some basic commands | | 504 | Packages Collection (pkgsrc) does. pkgsrc also has some basic commands |
508 | to handle binary packages, so that not every user has to build the | | 505 | to handle binary packages, so that not every user has to build the |
509 | packages for himself, which is a time-costly task.</p> | | 506 | packages for himself, which is a time-costly task.</p> |
510 | <p>pkgsrc currently contains several thousand packages, | | 507 | <p>pkgsrc currently contains several thousand packages, |
511 | including:</p> | | 508 | including:</p> |
512 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 509 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
513 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/apache24/README.html" target="_top"><code class="filename">www/apache24</code></a> - The Apache | | 510 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/apache24/README.html" target="_top"><code class="filename">www/apache24</code></a> - The Apache |
514 | web server</p></li> | | 511 | web server</p></li> |
515 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a> - The Firefox | | 512 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a> - The Firefox |
516 | web browser</p></li> | | 513 | web browser</p></li> |
517 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome/README.html" target="_top"><code class="filename">meta-pkgs/gnome</code></a> - The GNOME | | 514 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome/README.html" target="_top"><code class="filename">meta-pkgs/gnome</code></a> - The GNOME |
518 | Desktop Environment</p></li> | | 515 | Desktop Environment</p></li> |
519 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/kde4/README.html" target="_top"><code class="filename">meta-pkgs/kde4</code></a> - The K | | 516 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/kde4/README.html" target="_top"><code class="filename">meta-pkgs/kde4</code></a> - The K |
520 | Desktop Environment</p></li> | | 517 | Desktop Environment</p></li> |
521 | </ul></div> | | 518 | </ul></div> |
522 | <p>… just to name a few.</p> | | 519 | <p>… just to name a few.</p> |
523 | <p>pkgsrc has built-in support for handling varying dependencies, | | 520 | <p>pkgsrc has built-in support for handling varying dependencies, |
524 | such as pthreads and X11, and extended features such as IPv6 support on | | 521 | such as pthreads and X11, and extended features such as IPv6 support on |
525 | a range of platforms.</p> | | 522 | a range of platforms.</p> |
526 | <div class="sect2"> | | 523 | <div class="sect2"> |
527 | <div class="titlepage"><div><div><h3 class="title"> | | 524 | <div class="titlepage"><div><div><h3 class="title"> |
528 | <a name="why-pkgsrc"></a>1.1.1. Why pkgsrc?</h3></div></div></div> | | 525 | <a name="why-pkgsrc"></a>1.1.1. Why pkgsrc?</h3></div></div></div> |
529 | <p> | | 526 | <p> |
530 | pkgsrc provides the following key features: | | 527 | pkgsrc provides the following key features: |
531 | </p> | | 528 | </p> |
532 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 529 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
533 | <li class="listitem"><p>Easy building of software from source as well as the creation | | 530 | <li class="listitem"><p>Easy building of software from source as well as the creation |
534 | and installation of binary packages. The source and latest | | 531 | and installation of binary packages. The source and latest |
535 | patches are retrieved from a master or mirror download site, checksum | | 532 | patches are retrieved from a master or mirror download site, checksum |
536 | verified, then built on your system. Support for binary-only | | 533 | verified, then built on your system. Support for binary-only |
537 | distributions is available for both native platforms and NetBSD | | 534 | distributions is available for both native platforms and NetBSD |
538 | emulated platforms.</p></li> | | 535 | emulated platforms.</p></li> |
539 | <li class="listitem"><p>All packages are installed in a consistent directory tree, | | 536 | <li class="listitem"><p>All packages are installed in a consistent directory tree, |
540 | including binaries, libraries, man pages and other | | 537 | including binaries, libraries, man pages and other |
541 | documentation.</p></li> | | 538 | documentation.</p></li> |
542 | <li class="listitem"><p>Tracking of package dependencies automatically, including when | | 539 | <li class="listitem"><p>Tracking of package dependencies automatically, including when |
543 | performing updates, to ensure required packages are installed. The | | 540 | performing updates, to ensure required packages are installed. The |
544 | configuration files of various packages are handled automatically during | | 541 | configuration files of various packages are handled automatically during |
545 | updates, so local changes are preserved.</p></li> | | 542 | updates, so local changes are preserved.</p></li> |
546 | <li class="listitem"><p>Like NetBSD, pkgsrc is designed with portability in mind and | | 543 | <li class="listitem"><p>Like NetBSD, pkgsrc is designed with portability in mind and |
547 | consists of highly portable code. This allows the greatest speed of | | 544 | consists of highly portable code. This allows the greatest speed of |
548 | development when porting to a new platform. This portability also | | 545 | development when porting to a new platform. This portability also |
549 | ensures that pkgsrc is <span class="emphasis"><em>consistent across all | | 546 | ensures that pkgsrc is <span class="emphasis"><em>consistent across all |
550 | platforms</em></span>.</p></li> | | 547 | platforms</em></span>.</p></li> |
551 | <li class="listitem"><p>The installation prefix, acceptable software licenses, | | 548 | <li class="listitem"><p>The installation prefix, acceptable software licenses, |
552 | international encryption requirements and build-time options for a | | 549 | international encryption requirements and build-time options for a |
553 | large number of packages are all set in a simple, central | | 550 | large number of packages are all set in a simple, central |
554 | configuration file.</p></li> | | 551 | configuration file.</p></li> |
555 | <li class="listitem"><p>The entire source (not including the distribution files) is | | 552 | <li class="listitem"><p>The entire source (not including the distribution files) is |
556 | freely available under a BSD license, so you may extend and adapt | | 553 | freely available under a BSD license, so you may extend and adapt |
557 | pkgsrc to your needs. Support for local packages and patches is | | 554 | pkgsrc to your needs. Support for local packages and patches is |
558 | available right out of the box, so you can configure it specifically | | 555 | available right out of the box, so you can configure it specifically |
559 | for your environment.</p></li> | | 556 | for your environment.</p></li> |
560 | </ul></div> | | 557 | </ul></div> |
561 | <p>The following principles are basic to pkgsrc:</p> | | 558 | <p>The following principles are basic to pkgsrc:</p> |
562 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 559 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
563 | <li class="listitem"><p><span class="quote">“<span class="quote">It should only work if it's right.</span>”</span> | | 560 | <li class="listitem"><p><span class="quote">“<span class="quote">It should only work if it's right.</span>”</span> |
564 | — That means, if a package contains bugs, it's better to find | | 561 | — That means, if a package contains bugs, it's better to find |
565 | them and to complain about them rather than to just install the package | | 562 | them and to complain about them rather than to just install the package |
566 | and hope that it works. There are numerous checks in pkgsrc that try to | | 563 | and hope that it works. There are numerous checks in pkgsrc that try to |
567 | find such bugs: static analysis tools (<a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>), build-time checks (portability | | 564 | find such bugs: static analysis tools (<a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>), build-time checks (portability |
568 | of shell scripts), and post-installation checks (installed files, | | 565 | of shell scripts), and post-installation checks (installed files, |
569 | references to shared libraries, script interpreters).</p></li> | | 566 | references to shared libraries, script interpreters).</p></li> |
570 | <li class="listitem"><p><span class="quote">“<span class="quote">If it works, it should work everywhere</span>”</span> | | 567 | <li class="listitem"><p><span class="quote">“<span class="quote">If it works, it should work everywhere</span>”</span> |
571 | — Like NetBSD has been ported to many hardware architectures, | | 568 | — Like NetBSD has been ported to many hardware architectures, |
572 | pkgsrc has been ported to many operating systems. Care is taken that | | 569 | pkgsrc has been ported to many operating systems. Care is taken that |
573 | packages behave the same on all platforms.</p></li> | | 570 | packages behave the same on all platforms.</p></li> |
574 | </ul></div> | | 571 | </ul></div> |
575 | </div> | | 572 | </div> |
576 | <div class="sect2"> | | 573 | <div class="sect2"> |
577 | <div class="titlepage"><div><div><h3 class="title"> | | 574 | <div class="titlepage"><div><div><h3 class="title"> |
578 | <a name="intro.platforms"></a>1.1.2. Supported platforms</h3></div></div></div> | | 575 | <a name="intro.platforms"></a>1.1.2. Supported platforms</h3></div></div></div> |
579 | <p>pkgsrc consists of both a source distribution and a binary | | 576 | <p>pkgsrc consists of both a source distribution and a binary |
580 | distribution for these operating systems. After retrieving the required | | 577 | distribution for these operating systems. After retrieving the required |
581 | source or binaries, you can be up and running with pkgsrc in just | | 578 | source or binaries, you can be up and running with pkgsrc in just |
582 | minutes!</p> | | 579 | minutes!</p> |
583 | <p>pkgsrc was derived from FreeBSD's ports system, and | | 580 | <p>pkgsrc was derived from FreeBSD's ports system, and |
584 | initially developed for NetBSD only. Since then, pkgsrc has | | 581 | initially developed for NetBSD only. Since then, pkgsrc has |
585 | grown a lot, and now supports the following platforms:</p> | | 582 | grown a lot, and now supports the following platforms:</p> |
586 | <div class="table"> | | 583 | <div class="table"> |
587 | <a name="supported-platforms"></a><p class="title"><b>Table 1.1. Platforms supported by pkgsrc</b></p> | | 584 | <a name="supported-platforms"></a><p class="title"><b>Table 1.1. Platforms supported by pkgsrc</b></p> |
588 | <div class="table-contents"><table class="table" summary="Platforms supported by pkgsrc" border="1"> | | 585 | <div class="table-contents"><table class="table" summary="Platforms supported by pkgsrc" border="1"> |
589 | <colgroup> | | 586 | <colgroup> |
590 | <col> | | 587 | <col> |
591 | <col> | | 588 | <col> |
592 | <col> | | 589 | <col> |
593 | </colgroup> | | 590 | </colgroup> |
594 | <thead><tr> | | 591 | <thead><tr> |
595 | <th>Platform</th> | | 592 | <th>Platform</th> |
596 | <th>Date Support Added</th> | | 593 | <th>Date Support Added</th> |
597 | <th>Notes</th> | | 594 | <th>Notes</th> |
598 | </tr></thead> | | 595 | </tr></thead> |
599 | <tbody> | | 596 | <tbody> |
600 | <tr> | | 597 | <tr> |
601 | <td><a class="ulink" href="https://www.NetBSD.org/" target="_top">NetBSD</a></td> | | 598 | <td><a class="ulink" href="https://www.NetBSD.org/" target="_top">NetBSD</a></td> |
602 | <td align="center">Aug 1997</td> | | 599 | <td align="center">Aug 1997</td> |
603 | <td class="auto-generated"> </td> | | 600 | <td class="auto-generated"> </td> |
604 | </tr> | | 601 | </tr> |
605 | <tr> | | 602 | <tr> |
606 | <td><a class="ulink" href="http://wwws.sun.com/software/solaris/" target="_top">Solaris</a></td> | | 603 | <td><a class="ulink" href="http://wwws.sun.com/software/solaris/" target="_top">Solaris</a></td> |
607 | <td align="center">Mar 1999</td> | | 604 | <td align="center">Mar 1999</td> |
608 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Solaris" target="_top">README.Solaris</a></td> | | 605 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Solaris" target="_top">README.Solaris</a></td> |
609 | </tr> | | 606 | </tr> |
610 | <tr> | | 607 | <tr> |
611 | <td><a class="ulink" href="https://www.kernel.org/" target="_top">Linux</a></td> | | 608 | <td><a class="ulink" href="https://www.kernel.org/" target="_top">Linux</a></td> |
612 | <td align="center">Jun 1999</td> | | 609 | <td align="center">Jun 1999</td> |
613 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Linux" target="_top">README.Linux</a></td> | | 610 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Linux" target="_top">README.Linux</a></td> |
614 | </tr> | | 611 | </tr> |
615 | <tr> | | 612 | <tr> |
616 | <td> | | 613 | <td> |
617 | <a class="ulink" href="https://developer.apple.com/macos/" target="_top">Darwin / Mac OS X / OS X / macOS</a> | | 614 | <a class="ulink" href="https://developer.apple.com/macos/" target="_top">Darwin / Mac OS X / OS X / macOS</a> |
618 | </td> | | 615 | </td> |
619 | <td align="center">Oct 2001</td> | | 616 | <td align="center">Oct 2001</td> |
620 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.MacOSX" target="_top">README.MacOSX</a></td> | | 617 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.MacOSX" target="_top">README.MacOSX</a></td> |
621 | </tr> | | 618 | </tr> |
622 | <tr> | | 619 | <tr> |
623 | <td><a class="ulink" href="https://www.freebsd.org/" target="_top">FreeBSD</a></td> | | 620 | <td><a class="ulink" href="https://www.freebsd.org/" target="_top">FreeBSD</a></td> |
624 | <td align="center">Nov 2002</td> | | 621 | <td align="center">Nov 2002</td> |
625 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.FreeBSD" target="_top">README.FreeBSD</a></td> | | 622 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.FreeBSD" target="_top">README.FreeBSD</a></td> |
626 | </tr> | | 623 | </tr> |
627 | <tr> | | 624 | <tr> |
628 | <td><a class="ulink" href="https://www.openbsd.org/" target="_top">OpenBSD</a></td> | | 625 | <td><a class="ulink" href="https://www.openbsd.org/" target="_top">OpenBSD</a></td> |
629 | <td align="center">Nov 2002</td> | | 626 | <td align="center">Nov 2002</td> |
630 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OpenBSD" target="_top">README.OpenBSD</a></td> | | 627 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OpenBSD" target="_top">README.OpenBSD</a></td> |
631 | </tr> | | 628 | </tr> |
632 | <tr> | | 629 | <tr> |
633 | <td><a class="ulink" href="https://www.sgi.com/software/irix/" target="_top">IRIX</a></td> | | 630 | <td><a class="ulink" href="https://www.sgi.com/software/irix/" target="_top">IRIX</a></td> |
634 | <td align="center">Dec 2002</td> | | 631 | <td align="center">Dec 2002</td> |
635 | <td> | | 632 | <td> |
636 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX" target="_top">README.IRIX</a> | | 633 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX" target="_top">README.IRIX</a> |
637 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX5.3" target="_top">README.IRIX5.3</a> | | 634 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX5.3" target="_top">README.IRIX5.3</a> |
638 | </td> | | 635 | </td> |
639 | </tr> | | 636 | </tr> |
640 | <tr> | | 637 | <tr> |
641 | <td>BSD/OS</td> | | 638 | <td>BSD/OS</td> |
642 | <td align="center">Dec 2003</td> | | 639 | <td align="center">Dec 2003</td> |
643 | <td class="auto-generated"> </td> | | 640 | <td class="auto-generated"> </td> |
644 | </tr> | | 641 | </tr> |
645 | <tr> | | 642 | <tr> |
646 | <td><a class="ulink" href="https://www-1.ibm.com/servers/aix/" target="_top">AIX</a></td> | | 643 | <td><a class="ulink" href="https://www-1.ibm.com/servers/aix/" target="_top">AIX</a></td> |
647 | <td align="center">Dec 2003</td> | | 644 | <td align="center">Dec 2003</td> |
648 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.AIX" target="_top">README.AIX</a></td> | | 645 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.AIX" target="_top">README.AIX</a></td> |
649 | </tr> | | 646 | </tr> |
650 | <tr> | | 647 | <tr> |
651 | <td> | | 648 | <td> |
652 | <a class="ulink" href="https://www.microsoft.com/windows/sfu/" target="_top">Interix</a> | | 649 | <a class="ulink" href="https://www.microsoft.com/windows/sfu/" target="_top">Interix</a> |
653 | (Microsoft Windows Services for Unix) | | 650 | (Microsoft Windows Services for Unix) |
654 | </td> | | 651 | </td> |
655 | <td align="center">Mar 2004</td> | | 652 | <td align="center">Mar 2004</td> |
656 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Interix" target="_top">README.Interix</a></td> | | 653 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Interix" target="_top">README.Interix</a></td> |
657 | </tr> | | 654 | </tr> |
658 | <tr> | | 655 | <tr> |
659 | <td><a class="ulink" href="https://www.dragonflybsd.org/" target="_top">DragonFlyBSD</a></td> | | 656 | <td><a class="ulink" href="https://www.dragonflybsd.org/" target="_top">DragonFlyBSD</a></td> |
660 | <td align="center">Oct 2004</td> | | 657 | <td align="center">Oct 2004</td> |
661 | <td class="auto-generated"> </td> | | 658 | <td class="auto-generated"> </td> |
662 | </tr> | | 659 | </tr> |
663 | <tr> | | 660 | <tr> |
664 | <td><a class="ulink" href="http://www.tru64.org/" target="_top">OSF/1</a></td> | | 661 | <td><a class="ulink" href="http://www.tru64.org/" target="_top">OSF/1</a></td> |
665 | <td align="center">Nov 2004</td> | | 662 | <td align="center">Nov 2004</td> |
666 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OSF1" target="_top">README.OSF1</a></td> | | 663 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OSF1" target="_top">README.OSF1</a></td> |
667 | </tr> | | 664 | </tr> |
668 | <tr> | | 665 | <tr> |
669 | <td><a class="ulink" href="https://www.hp.com/products1/unix/" target="_top">HP-UX</a></td> | | 666 | <td><a class="ulink" href="https://www.hp.com/products1/unix/" target="_top">HP-UX</a></td> |
670 | <td align="center">Apr 2007</td> | | 667 | <td align="center">Apr 2007</td> |
671 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.HPUX" target="_top">README.HPUX</a></td> | | 668 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.HPUX" target="_top">README.HPUX</a></td> |
672 | </tr> | | 669 | </tr> |
673 | <tr> | | 670 | <tr> |
674 | <td><a class="ulink" href="https://www.haiku-os.org/" target="_top">Haiku</a></td> | | 671 | <td><a class="ulink" href="https://www.haiku-os.org/" target="_top">Haiku</a></td> |
675 | <td align="center">Sep 2010</td> | | 672 | <td align="center">Sep 2010</td> |
676 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Haiku" target="_top">README.Haiku</a></td> | | 673 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Haiku" target="_top">README.Haiku</a></td> |
677 | </tr> | | 674 | </tr> |
678 | <tr> | | 675 | <tr> |
679 | <td><a class="ulink" href="https://www.mirbsd.org/" target="_top">MirBSD</a></td> | | 676 | <td><a class="ulink" href="https://www.mirbsd.org/" target="_top">MirBSD</a></td> |
680 | <td align="center">Jan 2011</td> | | 677 | <td align="center">Jan 2011</td> |
681 | <td class="auto-generated"> </td> | | 678 | <td class="auto-generated"> </td> |
682 | </tr> | | 679 | </tr> |
683 | <tr> | | 680 | <tr> |
684 | <td><a class="ulink" href="https://www.minix3.org/" target="_top">Minix3</a></td> | | 681 | <td><a class="ulink" href="https://www.minix3.org/" target="_top">Minix3</a></td> |
685 | <td align="center">Nov 2011</td> | | 682 | <td align="center">Nov 2011</td> |
686 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Minix3" target="_top">README.Minix3</a></td> | | 683 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Minix3" target="_top">README.Minix3</a></td> |
687 | </tr> | | 684 | </tr> |
688 | <tr> | | 685 | <tr> |
689 | <td><a class="ulink" href="https://cygwin.com/" target="_top">Cygwin</a></td> | | 686 | <td><a class="ulink" href="https://cygwin.com/" target="_top">Cygwin</a></td> |
690 | <td align="center">Mar 2013</td> | | 687 | <td align="center">Mar 2013</td> |
691 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Cygwin" target="_top">README.Cygwin</a></td> | | 688 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Cygwin" target="_top">README.Cygwin</a></td> |
692 | </tr> | | 689 | </tr> |
693 | <tr> | | 690 | <tr> |
694 | <td><a class="ulink" href="https://www.debian.org/ports/kfreebsd-gnu/" target="_top">GNU/kFreeBSD</a></td> | | 691 | <td><a class="ulink" href="https://www.debian.org/ports/kfreebsd-gnu/" target="_top">GNU/kFreeBSD</a></td> |
695 | <td align="center">Jul 2013</td> | | 692 | <td align="center">Jul 2013</td> |
696 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.GNUkFreeBSD" target="_top">README.GNUkFreeBSD</a></td> | | 693 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.GNUkFreeBSD" target="_top">README.GNUkFreeBSD</a></td> |
697 | </tr> | | 694 | </tr> |
698 | <tr> | | 695 | <tr> |
699 | <td><a class="ulink" href="https://www.bitrig.org/" target="_top">Bitrig</a></td> | | 696 | <td><a class="ulink" href="https://www.bitrig.org/" target="_top">Bitrig</a></td> |
700 | <td align="center">Jun 2014</td> | | 697 | <td align="center">Jun 2014</td> |
701 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Bitrig" target="_top">README.Bitrig</a></td> | | 698 | <td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Bitrig" target="_top">README.Bitrig</a></td> |
702 | </tr> | | 699 | </tr> |
703 | </tbody> | | 700 | </tbody> |
704 | </table></div> | | 701 | </table></div> |
705 | </div> | | 702 | </div> |
706 | <br class="table-break"> | | 703 | <br class="table-break"> |
707 | </div> | | 704 | </div> |
708 | </div> | | 705 | </div> |
709 | <div class="sect1"> | | 706 | <div class="sect1"> |
710 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 707 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
711 | <a name="overview"></a>1.2. Overview</h2></div></div></div> | | 708 | <a name="overview"></a>1.2. Overview</h2></div></div></div> |
712 | <p>This document is divided into three parts. The first, | | 709 | <p>This document is divided into three parts. The first, |
713 | <a class="link" href="#users-guide" title="Part I. The pkgsrc user's guide">The pkgsrc user's guide</a>, | | 710 | <a class="link" href="#users-guide" title="Part I. The pkgsrc user's guide">The pkgsrc user's guide</a>, |
714 | describes how one can use one of the packages in the Package | | 711 | describes how one can use one of the packages in the Package |
715 | Collection, either by installing a precompiled binary package, | | 712 | Collection, either by installing a precompiled binary package, |
716 | or by building one's own copy using the NetBSD package system. | | 713 | or by building one's own copy using the NetBSD package system. |
717 | The second part, <a class="link" href="#developers-guide" title="Part II. The pkgsrc developer's guide">The pkgsrc developer's guide</a>, explains how to prepare a | | 714 | The second part, <a class="link" href="#developers-guide" title="Part II. The pkgsrc developer's guide">The pkgsrc developer's guide</a>, explains how to prepare a |
718 | package so it can be easily built by other NetBSD users without | | 715 | package so it can be easily built by other NetBSD users without |
719 | knowing about the package's building details. The third part, | | 716 | knowing about the package's building details. The third part, |
720 | <a class="link" href="#infrastructure" title="Part III. The pkgsrc infrastructure internals">The pkgsrc infrastructure internals</a> | | 717 | <a class="link" href="#infrastructure" title="Part III. The pkgsrc infrastructure internals">The pkgsrc infrastructure internals</a> |
721 | is intended for those who want to understand how pkgsrc is | | 718 | is intended for those who want to understand how pkgsrc is |
722 | implemented.</p> | | 719 | implemented.</p> |
723 | <p>This document is available in various formats: | | 720 | <p>This document is available in various formats: |
724 | <span class="simplelist"><a class="ulink" href="index.html" target="_top">HTML</a>, <a class="ulink" href="pkgsrc.pdf" target="_top">PDF</a>, <a class="ulink" href="pkgsrc.ps" target="_top">PS</a>, <a class="ulink" href="pkgsrc.txt" target="_top">TXT</a></span>.</p> | | 721 | <span class="simplelist"><a class="ulink" href="index.html" target="_top">HTML</a>, <a class="ulink" href="pkgsrc.pdf" target="_top">PDF</a>, <a class="ulink" href="pkgsrc.ps" target="_top">PS</a>, <a class="ulink" href="pkgsrc.txt" target="_top">TXT</a></span>.</p> |
725 | </div> | | 722 | </div> |
726 | <div class="sect1"> | | 723 | <div class="sect1"> |
727 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 724 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
728 | <a name="terminology"></a>1.3. Terminology</h2></div></div></div> | | 725 | <a name="terminology"></a>1.3. Terminology</h2></div></div></div> |
729 | <p>There has been a lot of talk about <span class="quote">“<span class="quote">ports</span>”</span>, | | 726 | <p>There has been a lot of talk about <span class="quote">“<span class="quote">ports</span>”</span>, |
730 | <span class="quote">“<span class="quote">packages</span>”</span>, etc. so far. Here is a description of all the | | 727 | <span class="quote">“<span class="quote">packages</span>”</span>, etc. so far. Here is a description of all the |
731 | terminology used within this document.</p> | | 728 | terminology used within this document.</p> |
732 | <div class="variablelist"><dl class="variablelist"> | | 729 | <div class="variablelist"><dl class="variablelist"> |
733 | <dt><span class="term">Package</span></dt> | | 730 | <dt><span class="term">Package</span></dt> |
734 | <dd><p>A set of files and building instructions | | 731 | <dd><p>A set of files and building instructions |
735 | that describe what's necessary | | 732 | that describe what's necessary |
736 | to build a certain piece of software using | | 733 | to build a certain piece of software using |
737 | pkgsrc. Packages are traditionally stored under | | 734 | pkgsrc. Packages are traditionally stored under |
738 | <code class="filename">/usr/pkgsrc</code>, | | 735 | <code class="filename">/usr/pkgsrc</code>, |
739 | but may be stored in any location, | | 736 | but may be stored in any location, |
740 | referred to as <code class="varname">PKGSRCDIR</code>.</p></dd> | | 737 | referred to as <code class="varname">PKGSRCDIR</code>.</p></dd> |
741 | <dt><span class="term">The NetBSD package system</span></dt> | | 738 | <dt><span class="term">The NetBSD package system</span></dt> |
742 | <dd><p>This is the former name of <span class="quote">“<span class="quote">pkgsrc</span>”</span>. It | | 739 | <dd><p>This is the former name of <span class="quote">“<span class="quote">pkgsrc</span>”</span>. It |
743 | is part of the NetBSD operating system and can be bootstrapped | | 740 | is part of the NetBSD operating system and can be bootstrapped |
744 | to run on non-NetBSD operating systems as well. It handles | | 741 | to run on non-NetBSD operating systems as well. It handles |
745 | building (compiling), installing, and removing of | | 742 | building (compiling), installing, and removing of |
746 | packages.</p></dd> | | 743 | packages.</p></dd> |
747 | <dt><span class="term">Distfile</span></dt> | | 744 | <dt><span class="term">Distfile</span></dt> |
748 | <dd><p>This term describes the file or files that are | | 745 | <dd><p>This term describes the file or files that are |
749 | provided by the author of the piece of software to | | 746 | provided by the author of the piece of software to |
750 | distribute his work. All the changes necessary to build on | | 747 | distribute his work. All the changes necessary to build on |
751 | NetBSD are reflected in the corresponding package. Usually | | 748 | NetBSD are reflected in the corresponding package. Usually |
752 | the distfile is in the form of a compressed tar-archive, | | 749 | the distfile is in the form of a compressed tar-archive, |
753 | but other types are possible, too. Distfiles are usually | | 750 | but other types are possible, too. Distfiles are usually |
754 | stored below | | 751 | stored below |
755 | <code class="filename">/usr/pkgsrc/distfiles</code>.</p></dd> | | 752 | <code class="filename">/usr/pkgsrc/distfiles</code>.</p></dd> |
756 | <dt><span class="term">Port</span></dt> | | 753 | <dt><span class="term">Port</span></dt> |
757 | <dd><p>This is the term used by FreeBSD and OpenBSD people | | 754 | <dd><p>This is the term used by FreeBSD and OpenBSD people |
758 | for what we call a package. | | 755 | for what we call a package. |
759 | In NetBSD terminology, <span class="quote">“<span class="quote">port</span>”</span> refers to a different | | 756 | In NetBSD terminology, <span class="quote">“<span class="quote">port</span>”</span> refers to a different |
760 | architecture.</p></dd> | | 757 | architecture.</p></dd> |
761 | <dt><span class="term">Precompiled/binary package</span></dt> | | 758 | <dt><span class="term">Precompiled/binary package</span></dt> |
762 | <dd> | | 759 | <dd> |
763 | <p>A set of binaries built with pkgsrc from a distfile | | 760 | <p>A set of binaries built with pkgsrc from a distfile |
764 | and stuffed together in a single <code class="filename">.tgz</code> | | 761 | and stuffed together in a single <code class="filename">.tgz</code> |
765 | file so it can be installed on machines of the same | | 762 | file so it can be installed on machines of the same |
766 | machine architecture without the need to | | 763 | machine architecture without the need to |
767 | recompile. Packages are usually generated in | | 764 | recompile. Packages are usually generated in |
768 | <code class="filename">/usr/pkgsrc/packages</code>; there is also | | 765 | <code class="filename">/usr/pkgsrc/packages</code>; there is also |
769 | an archive on <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/" target="_top">ftp.NetBSD.org</a>.</p> | | 766 | an archive on <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/" target="_top">ftp.NetBSD.org</a>.</p> |
770 | <p>Sometimes, this is referred to by the term <span class="quote">“<span class="quote">package</span>”</span> too, | | 767 | <p>Sometimes, this is referred to by the term <span class="quote">“<span class="quote">package</span>”</span> too, |
771 | especially in the context of precompiled packages.</p> | | 768 | especially in the context of precompiled packages.</p> |
772 | </dd> | | 769 | </dd> |
773 | <dt><span class="term">Program</span></dt> | | 770 | <dt><span class="term">Program</span></dt> |
774 | <dd><p>The piece of software to be installed which will be | | 771 | <dd><p>The piece of software to be installed which will be |
775 | constructed from all the files in the distfile by the | | 772 | constructed from all the files in the distfile by the |
776 | actions defined in the corresponding package.</p></dd> | | 773 | actions defined in the corresponding package.</p></dd> |
777 | </dl></div> | | 774 | </dl></div> |
778 | <div class="sect2"> | | 775 | <div class="sect2"> |
779 | <div class="titlepage"><div><div><h3 class="title"> | | 776 | <div class="titlepage"><div><div><h3 class="title"> |
780 | <a name="term.roles"></a>1.3.1. Roles involved in pkgsrc</h3></div></div></div> | | 777 | <a name="term.roles"></a>1.3.1. Roles involved in pkgsrc</h3></div></div></div> |
781 | <div class="variablelist"><dl class="variablelist"> | | 778 | <div class="variablelist"><dl class="variablelist"> |
782 | <dt><span class="term">pkgsrc users</span></dt> | | 779 | <dt><span class="term">pkgsrc users</span></dt> |
783 | <dd> | | 780 | <dd> |
784 | <p>The | | 781 | <p>The |
785 | pkgsrc users are people who use the packages provided by pkgsrc. | | 782 | pkgsrc users are people who use the packages provided by pkgsrc. |
786 | Typically they are system administrators. The people using the | | 783 | Typically they are system administrators. The people using the |
787 | software that is inside the packages (maybe called <span class="quote">“<span class="quote">end | | 784 | software that is inside the packages (maybe called <span class="quote">“<span class="quote">end |
788 | users</span>”</span>) are not covered by the pkgsrc guide.</p> | | 785 | users</span>”</span>) are not covered by the pkgsrc guide.</p> |
789 | <p>There are two kinds of pkgsrc users: Some only want to | | 786 | <p>There are two kinds of pkgsrc users: Some only want to |
790 | install pre-built binary packages. Others build the pkgsrc | | 787 | install pre-built binary packages. Others build the pkgsrc |
791 | packages from source, either for installing them directly or for | | 788 | packages from source, either for installing them directly or for |
792 | building binary packages themselves. For pkgsrc users <a class="xref" href="#users-guide" title="Part I. The pkgsrc user's guide">Part I, “The pkgsrc user's guide”</a> should provide all necessary | | 789 | building binary packages themselves. For pkgsrc users <a class="xref" href="#users-guide" title="Part I. The pkgsrc user's guide">Part I, “The pkgsrc user's guide”</a> should provide all necessary |
793 | documentation.</p> | | 790 | documentation.</p> |
794 | </dd> | | 791 | </dd> |
795 | <dt><span class="term">package maintainers</span></dt> | | 792 | <dt><span class="term">package maintainers</span></dt> |
796 | <dd><p>A | | 793 | <dd><p>A |
797 | package maintainer creates packages as described in <a class="xref" href="#developers-guide" title="Part II. The pkgsrc developer's guide">Part II, “The pkgsrc developer's guide”</a>.</p></dd> | | 794 | package maintainer creates packages as described in <a class="xref" href="#developers-guide" title="Part II. The pkgsrc developer's guide">Part II, “The pkgsrc developer's guide”</a>.</p></dd> |
798 | <dt><span class="term">infrastructure developers</span></dt> | | 795 | <dt><span class="term">infrastructure developers</span></dt> |
799 | <dd><p>These people are involved in all those files | | 796 | <dd><p>These people are involved in all those files |
800 | that live in the <code class="filename">mk/</code> directory and below. | | 797 | that live in the <code class="filename">mk/</code> directory and below. |
801 | Only these people should need to read through <a class="xref" href="#infrastructure" title="Part III. The pkgsrc infrastructure internals">Part III, “The pkgsrc infrastructure internals”</a>, though others might be curious, | | 798 | Only these people should need to read through <a class="xref" href="#infrastructure" title="Part III. The pkgsrc infrastructure internals">Part III, “The pkgsrc infrastructure internals”</a>, though others might be curious, |
802 | too.</p></dd> | | 799 | too.</p></dd> |
803 | </dl></div> | | 800 | </dl></div> |
804 | </div> | | 801 | </div> |
805 | </div> | | 802 | </div> |
806 | <div class="sect1"> | | 803 | <div class="sect1"> |
807 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 804 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
808 | <a name="typography"></a>1.4. Typography</h2></div></div></div> | | 805 | <a name="typography"></a>1.4. Typography</h2></div></div></div> |
809 | <p>When giving examples for commands, shell prompts are used to | | 806 | <p>When giving examples for commands, shell prompts are used to |
810 | show if the command should/can be issued as root, or if | | 807 | show if the command should/can be issued as root, or if |
811 | <span class="quote">“<span class="quote">normal</span>”</span> user privileges are sufficient. We use a | | 808 | <span class="quote">“<span class="quote">normal</span>”</span> user privileges are sufficient. We use a |
812 | <code class="prompt">#</code> for root's shell prompt, a <code class="prompt">%</code> for users' | | 809 | <code class="prompt">#</code> for root's shell prompt, a <code class="prompt">%</code> for users' |
813 | shell prompt, assuming they use the C-shell or tcsh and a <code class="prompt">$</code> for | | 810 | shell prompt, assuming they use the C-shell or tcsh and a <code class="prompt">$</code> for |
814 | bourne shell and derivatives.</p> | | 811 | bourne shell and derivatives.</p> |
815 | </div> | | 812 | </div> |
816 | </div> | | 813 | </div> |
817 | <div class="part"> | | 814 | <div class="part"> |
818 | <div class="titlepage"><div><div><h1 class="title"> | | 815 | <div class="titlepage"><div><div><h1 class="title"> |
819 | <a name="users-guide"></a>Part I. The pkgsrc user's guide</h1></div></div></div> | | 816 | <a name="users-guide"></a>Part I. The pkgsrc user's guide</h1></div></div></div> |
820 | <div class="toc"> | | 817 | <div class="toc"> |
821 | <p><b>Table of Contents</b></p> | | 818 | <p><b>Table of Contents</b></p> |
822 | <dl class="toc"> | | 819 | <dl class="toc"> |
823 | <dt><span class="chapter"><a href="#help-user">2. Getting help</a></span></dt> | | 820 | <dt><span class="chapter"><a href="#help-user">2. Getting help</a></span></dt> |
824 | <dt><span class="chapter"><a href="#getting">3. Where to get pkgsrc and how to keep it up-to-date</a></span></dt> | | 821 | <dt><span class="chapter"><a href="#getting">3. Where to get pkgsrc and how to keep it up-to-date</a></span></dt> |
825 | <dd><dl> | | 822 | <dd><dl> |
826 | <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt> | | 823 | <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt> |
827 | <dd><dl> | | 824 | <dd><dl> |
828 | <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt> | | 825 | <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt> |
829 | <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt> | | 826 | <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt> |
830 | </dl></dd> | | 827 | </dl></dd> |
831 | <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt> | | 828 | <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt> |
832 | <dd><dl> | | 829 | <dd><dl> |
833 | <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt> | | 830 | <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt> |
834 | <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt> | | 831 | <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt> |
835 | </dl></dd> | | 832 | </dl></dd> |
836 | </dl></dd> | | 833 | </dl></dd> |
837 | <dt><span class="chapter"><a href="#platforms">4. Using pkgsrc on systems other than NetBSD</a></span></dt> | | 834 | <dt><span class="chapter"><a href="#platforms">4. Using pkgsrc on systems other than NetBSD</a></span></dt> |
838 | <dd><dl> | | 835 | <dd><dl> |
839 | <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt> | | 836 | <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt> |
840 | <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt> | | 837 | <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt> |
841 | </dl></dd> | | 838 | </dl></dd> |
842 | <dt><span class="chapter"><a href="#using">5. Using pkgsrc</a></span></dt> | | 839 | <dt><span class="chapter"><a href="#using">5. Using pkgsrc</a></span></dt> |
843 | <dd><dl> | | 840 | <dd><dl> |
844 | <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt> | | 841 | <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt> |
845 | <dd><dl> | | 842 | <dd><dl> |
846 | <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt> | | 843 | <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt> |
847 | <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt> | | 844 | <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt> |
848 | <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt> | | 845 | <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt> |
849 | <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt> | | 846 | <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt> |
850 | <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> | | 847 | <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> |
851 | <dt><span class="sect2"><a href="#pkg_versions">5.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> | | 848 | <dt><span class="sect2"><a href="#pkg_versions">5.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> |
852 | <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt> | | 849 | <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt> |
853 | </dl></dd> | | 850 | </dl></dd> |
854 | <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt> | | 851 | <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt> |
855 | <dd><dl> | | 852 | <dd><dl> |
856 | <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt> | | 853 | <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt> |
857 | <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt> | | 854 | <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt> |
858 | <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt> | | 855 | <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt> |
859 | </dl></dd> | | 856 | </dl></dd> |
860 | </dl></dd> | | 857 | </dl></dd> |
861 | <dt><span class="chapter"><a href="#configuring">6. Configuring pkgsrc</a></span></dt> | | 858 | <dt><span class="chapter"><a href="#configuring">6. Configuring pkgsrc</a></span></dt> |
862 | <dd><dl> | | 859 | <dd><dl> |
863 | <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt> | | 860 | <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt> |
864 | <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt> | | 861 | <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt> |
865 | <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt> | | 862 | <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt> |
866 | <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt> | | 863 | <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt> |
867 | <dd><dl> | | 864 | <dd><dl> |
868 | <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt> | | 865 | <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt> |
869 | <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt> | | 866 | <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt> |
870 | <dt><span class="sect2"><a href="#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt> | | 867 | <dt><span class="sect2"><a href="#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt> |
871 | </dl></dd> | | 868 | </dl></dd> |
872 | <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt> | | 869 | <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt> |
873 | <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt> | | 870 | <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt> |
874 | </dl></dd> | | 871 | </dl></dd> |
875 | <dt><span class="chapter"><a href="#binary">7. Creating binary packages</a></span></dt> | | 872 | <dt><span class="chapter"><a href="#binary">7. Creating binary packages</a></span></dt> |
876 | <dd><dl> | | 873 | <dd><dl> |
877 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> | | 874 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> |
878 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> | | 875 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> |
879 | </dl></dd> | | 876 | </dl></dd> |
880 | <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk | | 877 | <dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk |
881 | builds)</a></span></dt> | | 878 | builds)</a></span></dt> |
882 | <dd><dl> | | 879 | <dd><dl> |
883 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> | | 880 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> |
884 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> | | 881 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> |
885 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> | | 882 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> |
886 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> | | 883 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> |
887 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> | | 884 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> |
888 | <dd><dl> | | 885 | <dd><dl> |
889 | <dt><span class="sect2"><a href="#bulk.var.subst_noop">8.4.1. Strict SUBST blocks</a></span></dt> | | 886 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt> |
890 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.2. Detect unknown configure options</a></span></dt> | | 887 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt> |
891 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.3. Detect classes of bugs by forcing compiler warnings</a></span></dt> | | 888 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.3. Use custom directories</a></span></dt> |
892 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt> | | 889 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.4. Turn warnings into errors</a></span></dt> |
893 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt> | | 890 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.5. Reject packages for which pkglint reports errors</a></span></dt> |
894 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt> | | 891 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.6. Reject packages that contain forbidden strings</a></span></dt> |
895 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt> | | 892 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.7. Reject packages whose self-test fails</a></span></dt> |
896 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt> | | 893 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.8. Reject packages that use undefined shell variables</a></span></dt> |
897 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt> | | 894 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.9. Turn off verbose logging</a></span></dt> |
898 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt> | | | |
899 | <dt><span class="sect2"><a href="#bulk.var.options">8.4.11. Select random sets of options</a></span></dt> | | | |
900 | <dt><span class="sect2"><a href="#bulk.var.build_defs">8.4.12. Select random configurations of BUILD_DEFS</a></span></dt> | | | |
901 | </dl></dd> | | 895 | </dl></dd> |
902 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> | | 896 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> |
903 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> | | 897 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> |
904 | </dl></dd> | | 898 | </dl></dd> |
905 | <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt> | | 899 | <dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt> |
906 | <dd><dl> | | 900 | <dd><dl> |
907 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> | | 901 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> |
908 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> | | 902 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> |
909 | </dl></dd> | | 903 | </dl></dd> |
910 | <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt> | | 904 | <dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt> |
911 | <dd><dl> | | 905 | <dd><dl> |
912 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> | | 906 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> |
913 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> | | 907 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> |
914 | <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt> | | 908 | <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt> |
915 | <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt> | | 909 | <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt> |
916 | <dt><span class="sect1"><a href="#x.org-from-pkgsrc">10.5. How can I install/use modular X.org from pkgsrc?</a></span></dt> | | 910 | <dt><span class="sect1"><a href="#x.org-from-pkgsrc">10.5. How can I install/use modular X.org from pkgsrc?</a></span></dt> |
917 | <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt> | | 911 | <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt> |
918 | <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt> | | 912 | <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt> |
919 | <dt><span class="sect1"><a href="#passive-ftp">10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</a></span></dt> | | 913 | <dt><span class="sect1"><a href="#passive-ftp">10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</a></span></dt> |
920 | <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt> | | 914 | <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt> |
921 | <dt><span class="sect1"><a href="#tmac.andoc-missing">10.10. What does <span class="quote">“<span class="quote">Don't know how to make | | 915 | <dt><span class="sect1"><a href="#tmac.andoc-missing">10.10. What does <span class="quote">“<span class="quote">Don't know how to make |
922 | /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt> | | 916 | /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt> |
923 | <dt><span class="sect1"><a href="#bsd.own.mk-missing">10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</a></span></dt> | | 917 | <dt><span class="sect1"><a href="#bsd.own.mk-missing">10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</a></span></dt> |
924 | <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt> | | 918 | <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt> |
925 | <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt> | | 919 | <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt> |
926 | <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt> | | 920 | <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt> |
927 | <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt> | | 921 | <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt> |
928 | <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt> | | 922 | <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt> |
929 | <dt><span class="sect1"><a href="#faq.rcs-conflicts">10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</a></span></dt> | | 923 | <dt><span class="sect1"><a href="#faq.rcs-conflicts">10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</a></span></dt> |
930 | </dl></dd> | | 924 | </dl></dd> |
931 | </dl> | | 925 | </dl> |
932 | </div> | | 926 | </div> |
933 | <div class="chapter"> | | 927 | <div class="chapter"> |
934 | <div class="titlepage"><div><div><h2 class="title"> | | 928 | <div class="titlepage"><div><div><h2 class="title"> |
935 | <a name="help-user"></a>Chapter 2. Getting help</h2></div></div></div> | | 929 | <a name="help-user"></a>Chapter 2. Getting help</h2></div></div></div> |
936 | <p> | | 930 | <p> |
937 | To get help when using pkgsrc, the definitive source is this | | 931 | To get help when using pkgsrc, the definitive source is this |
938 | document, the pkgsrc guide. If you don't find anything here, | | 932 | document, the pkgsrc guide. If you don't find anything here, |
939 | there are alternatives: | | 933 | there are alternatives: |
940 | </p> | | 934 | </p> |
941 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 935 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
942 | <li class="listitem"> | | 936 | <li class="listitem"> |
943 | <p> | | 937 | <p> |
944 | The built-in pkgsrc help, which is available after bootstrapping | | 938 | The built-in pkgsrc help, which is available after bootstrapping |
945 | pkgsrc. Run <span class="command"><strong>bmake help topic=…</strong></span> to get | | 939 | pkgsrc. Run <span class="command"><strong>bmake help topic=…</strong></span> to get |
946 | help for any topic, such as a variable name like | | 940 | help for any topic, such as a variable name like |
947 | <code class="varname">BUILD_DEFS</code>, a make target like | | 941 | <code class="varname">BUILD_DEFS</code>, a make target like |
948 | <span class="command"><strong>do-build</strong></span>, a missing C or C++ function like | | 942 | <span class="command"><strong>do-build</strong></span>, a missing C or C++ function like |
949 | <span class="command"><strong>strcasecmp</strong></span> or any other topic.</p> | | 943 | <span class="command"><strong>strcasecmp</strong></span> or any other topic.</p> |
950 | <p>The available help topics are listed in <a class="xref" href="#help-topics" title="Appendix D. Help topics">Appendix D, <i>Help topics</i></a>.</p> | | 944 | <p>The available help topics are listed in <a class="xref" href="#help-topics" title="Appendix D. Help topics">Appendix D, <i>Help topics</i></a>.</p> |
951 | </li> | | 945 | </li> |
952 | <li class="listitem"><p> | | 946 | <li class="listitem"><p> |
953 | To see the value of a single variable, run <span class="command"><strong>bmake | | 947 | To see the value of a single variable, run <span class="command"><strong>bmake |
954 | show-var VARNAME=<em class="replaceable"><code>X</code></em></strong></span>. | | 948 | show-var VARNAME=<em class="replaceable"><code>X</code></em></strong></span>. |
955 | </p></li> | | 949 | </p></li> |
956 | <li class="listitem"><p> | | 950 | <li class="listitem"><p> |
957 | To see the values of the most common variables, run | | 951 | To see the values of the most common variables, run |
958 | <span class="command"><strong>bmake show-all</strong></span>. These variables are grouped by | | 952 | <span class="command"><strong>bmake show-all</strong></span>. These variables are grouped by |
959 | topic. To see the variables for a single topic, run | | 953 | topic. To see the variables for a single topic, run |
960 | <span class="command"><strong>bmake | | 954 | <span class="command"><strong>bmake |
961 | show-all-<em class="replaceable"><code>topic</code></em></strong></span>, for example | | 955 | show-all-<em class="replaceable"><code>topic</code></em></strong></span>, for example |
962 | <span class="command"><strong>bmake show-all-fetch</strong></span>. | | 956 | <span class="command"><strong>bmake show-all-fetch</strong></span>. |
963 | </p></li> | | 957 | </p></li> |
964 | <li class="listitem"><p> | | 958 | <li class="listitem"><p> |
965 | The pkgsrc-users mailing list, to which | | 959 | The pkgsrc-users mailing list, to which |
966 | <a class="ulink" href="https://www.NetBSD.org/mailinglists/#pkgsrc-users" target="_top">you | | 960 | <a class="ulink" href="https://www.NetBSD.org/mailinglists/#pkgsrc-users" target="_top">you |
967 | can subscribe</a> and then <a class="ulink" href="mailto:pkgsrc-users@NetBSD.org" target="_top">ask your | | 961 | can subscribe</a> and then <a class="ulink" href="mailto:pkgsrc-users@NetBSD.org" target="_top">ask your |
968 | questions</a>.</p></li> | | 962 | questions</a>.</p></li> |
969 | <li class="listitem"><p>The #pkgsrc IRC channel, which is accessible | | 963 | <li class="listitem"><p>The #pkgsrc IRC channel, which is accessible |
970 | <a class="ulink" href="https://webchat.freenode.net/" target="_top">via a web browser</a> | | 964 | <a class="ulink" href="https://webchat.freenode.net/" target="_top">via a web browser</a> |
971 | or by using a specialized chat program such as | | 965 | or by using a specialized chat program such as |
972 | <a class="ulink" href="http://xchat.org/" target="_top">XChat</a>. | | 966 | <a class="ulink" href="http://xchat.org/" target="_top">XChat</a>. |
973 | Pick any user name and join the channel #pkgsrc.</p></li> | | 967 | Pick any user name and join the channel #pkgsrc.</p></li> |
974 | </ul></div> | | 968 | </ul></div> |
975 | </div> | | 969 | </div> |
976 | <div class="chapter"> | | 970 | <div class="chapter"> |
977 | <div class="titlepage"><div><div><h2 class="title"> | | 971 | <div class="titlepage"><div><div><h2 class="title"> |
978 | <a name="getting"></a>Chapter 3. Where to get pkgsrc and how to keep it up-to-date</h2></div></div></div> | | 972 | <a name="getting"></a>Chapter 3. Where to get pkgsrc and how to keep it up-to-date</h2></div></div></div> |
979 | <div class="toc"> | | 973 | <div class="toc"> |
980 | <p><b>Table of Contents</b></p> | | 974 | <p><b>Table of Contents</b></p> |
981 | <dl class="toc"> | | 975 | <dl class="toc"> |
982 | <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt> | | 976 | <dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt> |
983 | <dd><dl> | | 977 | <dd><dl> |
984 | <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt> | | 978 | <dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt> |
985 | <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt> | | 979 | <dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt> |
986 | </dl></dd> | | 980 | </dl></dd> |
987 | <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt> | | 981 | <dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt> |
988 | <dd><dl> | | 982 | <dd><dl> |
989 | <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt> | | 983 | <dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt> |
990 | <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt> | | 984 | <dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt> |
991 | </dl></dd> | | 985 | </dl></dd> |
992 | </dl> | | 986 | </dl> |
993 | </div> | | 987 | </div> |
994 | <p>Before you download and extract the files, you need to decide | | 988 | <p>Before you download and extract the files, you need to decide |
995 | where you want to extract them. When using pkgsrc as root user, pkgsrc | | 989 | where you want to extract them. When using pkgsrc as root user, pkgsrc |
996 | is usually installed in <code class="filename">/usr/pkgsrc</code>. You are though | | 990 | is usually installed in <code class="filename">/usr/pkgsrc</code>. You are though |
997 | free to install the sources and binary packages wherever you want in | | 991 | free to install the sources and binary packages wherever you want in |
998 | your filesystem, provided that the pathname does not contain white-space | | 992 | your filesystem, provided that the pathname does not contain white-space |
999 | or other characters that are interpreted specially by the shell and some | | 993 | or other characters that are interpreted specially by the shell and some |
1000 | other programs. A safe bet is to use only letters, digits, underscores | | 994 | other programs. A safe bet is to use only letters, digits, underscores |
1001 | and dashes.</p> | | 995 | and dashes.</p> |
1002 | <div class="sect1"> | | 996 | <div class="sect1"> |
1003 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 997 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1004 | <a name="getting-first"></a>3.1. Getting pkgsrc for the first time</h2></div></div></div> | | 998 | <a name="getting-first"></a>3.1. Getting pkgsrc for the first time</h2></div></div></div> |
1005 | <p>Before you download any pkgsrc files, you should decide | | 999 | <p>Before you download any pkgsrc files, you should decide |
1006 | whether you want the <span class="emphasis"><em>current</em></span> branch or the | | 1000 | whether you want the <span class="emphasis"><em>current</em></span> branch or the |
1007 | <span class="emphasis"><em>stable</em></span> branch. The latter is forked on a | | 1001 | <span class="emphasis"><em>stable</em></span> branch. The latter is forked on a |
1008 | quarterly basis from the current branch and only gets modified | | 1002 | quarterly basis from the current branch and only gets modified |
1009 | for security updates. The names of the stable branches are built | | 1003 | for security updates. The names of the stable branches are built |
1010 | from the year and the quarter, for example | | 1004 | from the year and the quarter, for example |
1011 | <code class="literal">2020Q1</code>.</p> | | 1005 | <code class="literal">2020Q1</code>.</p> |
1012 | <p>The second step is to decide <span class="emphasis"><em>how</em></span> you | | 1006 | <p>The second step is to decide <span class="emphasis"><em>how</em></span> you |
1013 | want to download pkgsrc. You can get it as a tar file or via CVS. | | 1007 | want to download pkgsrc. You can get it as a tar file or via CVS. |
1014 | Both ways are described here.</p> | | 1008 | Both ways are described here.</p> |
1015 | <p>Note that tar archive contains CVS working copy. | | 1009 | <p>Note that tar archive contains CVS working copy. |
1016 | Thus you can switch to using CVS at any later time.</p> | | 1010 | Thus you can switch to using CVS at any later time.</p> |
1017 | <div class="sect2"> | | 1011 | <div class="sect2"> |
1018 | <div class="titlepage"><div><div><h3 class="title"> | | 1012 | <div class="titlepage"><div><div><h3 class="title"> |
1019 | <a name="getting-via-tar"></a>3.1.1. As tar archive</h3></div></div></div> | | 1013 | <a name="getting-via-tar"></a>3.1.1. As tar archive</h3></div></div></div> |
1020 | <p>The primary download location for all pkgsrc files is | | 1014 | <p>The primary download location for all pkgsrc files is |
1021 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/" target="_top">https://cdn.NetBSD.org/pub/pkgsrc/</a> or | | 1015 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/" target="_top">https://cdn.NetBSD.org/pub/pkgsrc/</a> or |
1022 | <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/" target="_top">ftp://ftp.NetBSD.org/pub/pkgsrc/</a> | | 1016 | <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/" target="_top">ftp://ftp.NetBSD.org/pub/pkgsrc/</a> |
1023 | (it points to the same location). | | 1017 | (it points to the same location). |
1024 | There are a number of subdirectories for different purposes, | | 1018 | There are a number of subdirectories for different purposes, |
1025 | which are described in detail in <a class="xref" href="#ftp-layout" title="Appendix C. Directory layout of the pkgsrc FTP server">Appendix C, <i>Directory layout of the pkgsrc FTP server</i></a>.</p> | | 1019 | which are described in detail in <a class="xref" href="#ftp-layout" title="Appendix C. Directory layout of the pkgsrc FTP server">Appendix C, <i>Directory layout of the pkgsrc FTP server</i></a>.</p> |
1026 | <p>The tar archive for the current branch is in the directory | | 1020 | <p>The tar archive for the current branch is in the directory |
1027 | <code class="filename">current</code> and is called <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz" target="_top"><code class="filename">pkgsrc.tar.gz</code></a>. | | 1021 | <code class="filename">current</code> and is called <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz" target="_top"><code class="filename">pkgsrc.tar.gz</code></a>. |
1028 | It is autogenerated weekly.</p> | | 1022 | It is autogenerated weekly.</p> |
1029 | <p>To save download time we provide bzip2- and | | 1023 | <p>To save download time we provide bzip2- and |
1030 | xz-compressed archives which are published at | | 1024 | xz-compressed archives which are published at |
1031 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.bz2" target="_top"><code class="filename">pkgsrc.tar.bz2</code></a> | | 1025 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.bz2" target="_top"><code class="filename">pkgsrc.tar.bz2</code></a> |
1032 | and | | 1026 | and |
1033 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.xz" target="_top"><code class="filename">pkgsrc.tar.xz</code></a> | | 1027 | <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.xz" target="_top"><code class="filename">pkgsrc.tar.xz</code></a> |
1034 | respectively. | | 1028 | respectively. |
1035 | </p> | | 1029 | </p> |
1036 | <p>You can fetch the same files using FTP.</p> | | 1030 | <p>You can fetch the same files using FTP.</p> |
1037 | <p>The tar file for the stable branch 2020Q1 is in the | | 1031 | <p>The tar file for the stable branch 2020Q1 is in the |
1038 | directory <code class="filename">pkgsrc-2020Q1</code> and is also called <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/pkgsrc-2020Q1/pkgsrc.tar.gz" target="_top"><code class="filename">pkgsrc.tar.gz</code></a>.</p> | | 1032 | directory <code class="filename">pkgsrc-2020Q1</code> and is also called <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/pkgsrc-2020Q1/pkgsrc.tar.gz" target="_top"><code class="filename">pkgsrc.tar.gz</code></a>.</p> |
1039 | <p>To download the latest pkgsrc stable tarball, run:</p> | | 1033 | <p>To download the latest pkgsrc stable tarball, run:</p> |
1040 | <pre class="screen"> | | 1034 | <pre class="screen"> |
1041 | <code class="prompt">$</code> <strong class="userinput"><code>ftp ftp://ftp.NetBSD.org/pub/pkgsrc/pkgsrc-2020Q1/pkgsrc.tar.gz</code></strong></pre> | | 1035 | <code class="prompt">$</code> <strong class="userinput"><code>ftp ftp://ftp.NetBSD.org/pub/pkgsrc/pkgsrc-2020Q1/pkgsrc.tar.gz</code></strong></pre> |
1042 | <p>If you prefer, you can also fetch it using "wget", "curl", | | 1036 | <p>If you prefer, you can also fetch it using "wget", "curl", |
1043 | or your web browser.</p> | | 1037 | or your web browser.</p> |
1044 | <p>Then, extract it with:</p> | | 1038 | <p>Then, extract it with:</p> |
1045 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>tar -xzf pkgsrc.tar.gz -C /usr</code></strong></pre> | | 1039 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>tar -xzf pkgsrc.tar.gz -C /usr</code></strong></pre> |
1046 | <p>This will create the directory <code class="filename">pkgsrc/</code> | | 1040 | <p>This will create the directory <code class="filename">pkgsrc/</code> |
1047 | in <code class="filename">/usr/</code> and all the package source will be | | 1041 | in <code class="filename">/usr/</code> and all the package source will be |
1048 | stored under <code class="filename">/usr/pkgsrc/</code>.</p> | | 1042 | stored under <code class="filename">/usr/pkgsrc/</code>.</p> |
1049 | <p>To download pkgsrc-current, run:</p> | | 1043 | <p>To download pkgsrc-current, run:</p> |
1050 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>ftp ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz</code></strong></pre> | | 1044 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>ftp ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz</code></strong></pre> |
1051 | </div> | | 1045 | </div> |
1052 | <div class="sect2"> | | 1046 | <div class="sect2"> |
1053 | <div class="titlepage"><div><div><h3 class="title"> | | 1047 | <div class="titlepage"><div><div><h3 class="title"> |
1054 | <a name="getting-via-cvs"></a>3.1.2. Via anonymous CVS</h3></div></div></div> | | 1048 | <a name="getting-via-cvs"></a>3.1.2. Via anonymous CVS</h3></div></div></div> |
1055 | <p>To fetch a specific pkgsrc stable branch, run:</p> | | 1049 | <p>To fetch a specific pkgsrc stable branch, run:</p> |
1056 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr && cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -r pkgsrc-2020Q1 -P pkgsrc</code></strong> | | 1050 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr && cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -r pkgsrc-2020Q1 -P pkgsrc</code></strong> |
1057 | </pre> | | 1051 | </pre> |
1058 | <p>This will create the directory <code class="filename">pkgsrc/</code> | | 1052 | <p>This will create the directory <code class="filename">pkgsrc/</code> |
1059 | in your <code class="filename">/usr/</code> directory and all the package source | | 1053 | in your <code class="filename">/usr/</code> directory and all the package source |
1060 | will be stored under <code class="filename">/usr/pkgsrc/</code>.</p> | | 1054 | will be stored under <code class="filename">/usr/pkgsrc/</code>.</p> |
1061 | <p>To fetch the pkgsrc current branch, run:</p> | | 1055 | <p>To fetch the pkgsrc current branch, run:</p> |
1062 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr && cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc</code></strong> | | 1056 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr && cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc</code></strong> |
1063 | </pre> | | 1057 | </pre> |
1064 | <p>Refer to the <a class="ulink" href="https://www.NetBSD.org/mirrors/#anoncvs" target="_top">list of available mirrors</a> to choose a faster CVS mirror, if needed.</p> | | 1058 | <p>Refer to the <a class="ulink" href="https://www.NetBSD.org/mirrors/#anoncvs" target="_top">list of available mirrors</a> to choose a faster CVS mirror, if needed.</p> |
1065 | <p>If you get error messages from <code class="literal">rsh</code>, you need to set CVS_RSH variable. E.g.:</p> | | 1059 | <p>If you get error messages from <code class="literal">rsh</code>, you need to set CVS_RSH variable. E.g.:</p> |
1066 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr && env CVS_RSH=ssh cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc</code></strong> | | 1060 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr && env CVS_RSH=ssh cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc</code></strong> |
1067 | </pre> | | 1061 | </pre> |
1068 | <p>Refer to documentation on your command shell how to set CVS_RSH=ssh permanently. | | 1062 | <p>Refer to documentation on your command shell how to set CVS_RSH=ssh permanently. |
1069 | For Bourne shells, you can set it in your <code class="filename">.profile</code> | | 1063 | For Bourne shells, you can set it in your <code class="filename">.profile</code> |
1070 | or better globally in <code class="filename">/etc/profile</code>:</p> | | 1064 | or better globally in <code class="filename">/etc/profile</code>:</p> |
1071 | <pre class="programlisting"> | | 1065 | <pre class="programlisting"> |
1072 | # set CVS remote shell command | | 1066 | # set CVS remote shell command |
1073 | CVS_RSH=ssh | | 1067 | CVS_RSH=ssh |
1074 | export CVS_RSH | | 1068 | export CVS_RSH |
1075 | </pre> | | 1069 | </pre> |
1076 | <p>By default, CVS doesn't do things like most people would expect it to do. | | 1070 | <p>By default, CVS doesn't do things like most people would expect it to do. |
1077 | But there is a way to convince CVS, by creating a file called <code class="filename">.cvsrc</code> | | 1071 | But there is a way to convince CVS, by creating a file called <code class="filename">.cvsrc</code> |
1078 | in your home directory and saving the following lines to it. | | 1072 | in your home directory and saving the following lines to it. |
1079 | This file will save you lots of headache and some bug reports, so we strongly recommend it. | | 1073 | This file will save you lots of headache and some bug reports, so we strongly recommend it. |
1080 | You can find an explanation of this file in the CVS documentation.</p> | | 1074 | You can find an explanation of this file in the CVS documentation.</p> |
1081 | <pre class="programlisting"> | | 1075 | <pre class="programlisting"> |
1082 | # recommended CVS configuration file from the pkgsrc guide | | 1076 | # recommended CVS configuration file from the pkgsrc guide |
1083 | cvs -q | | 1077 | cvs -q |
1084 | checkout -P | | 1078 | checkout -P |
1085 | update -dP | | 1079 | update -dP |
1086 | diff -upN | | 1080 | diff -upN |
1087 | rdiff -u | | 1081 | rdiff -u |
1088 | release -d | | 1082 | release -d |
1089 | </pre> | | 1083 | </pre> |
1090 | </div> | | 1084 | </div> |
1091 | </div> | | 1085 | </div> |
1092 | <div class="sect1"> | | 1086 | <div class="sect1"> |
1093 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1087 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1094 | <a name="uptodate"></a>3.2. Keeping pkgsrc up-to-date</h2></div></div></div> | | 1088 | <a name="uptodate"></a>3.2. Keeping pkgsrc up-to-date</h2></div></div></div> |
1095 | <p>The preferred way to keep pkgsrc up-to-date is via CVS | | 1089 | <p>The preferred way to keep pkgsrc up-to-date is via CVS |
1096 | (which also works if you have first installed it via a tar | | 1090 | (which also works if you have first installed it via a tar |
1097 | file). It saves bandwidth and hard disk activity, compared to | | 1091 | file). It saves bandwidth and hard disk activity, compared to |
1098 | downloading the tar file again.</p> | | 1092 | downloading the tar file again.</p> |
1099 | <div class="sect2"> | | 1093 | <div class="sect2"> |
1100 | <div class="titlepage"><div><div><h3 class="title"> | | 1094 | <div class="titlepage"><div><div><h3 class="title"> |
1101 | <a name="uptodate-tar"></a>3.2.1. Via tar files</h3></div></div></div> | | 1095 | <a name="uptodate-tar"></a>3.2.1. Via tar files</h3></div></div></div> |
1102 | <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 1096 | <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> |
1103 | <h3 class="title">Warning</h3> | | 1097 | <h3 class="title">Warning</h3> |
1104 | <p>When updating from a tar file, you first need to | | 1098 | <p>When updating from a tar file, you first need to |
1105 | completely remove the old pkgsrc directory. Otherwise those | | 1099 | completely remove the old pkgsrc directory. Otherwise those |
1106 | files that have been removed from pkgsrc in the mean time will | | 1100 | files that have been removed from pkgsrc in the mean time will |
1107 | not be removed on your local disk, resulting in inconsistencies. | | 1101 | not be removed on your local disk, resulting in inconsistencies. |
1108 | When removing the old files, any changes that you have done to | | 1102 | When removing the old files, any changes that you have done to |
1109 | the pkgsrc files will be lost after updating. Therefore updating | | 1103 | the pkgsrc files will be lost after updating. Therefore updating |
1110 | via CVS is strongly recommended.</p> | | 1104 | via CVS is strongly recommended.</p> |
1111 | </div> | | 1105 | </div> |
1112 | <p>Note that by default the distfiles and the binary packages | | 1106 | <p>Note that by default the distfiles and the binary packages |
1113 | are saved in the pkgsrc tree, so don't forget to rescue them | | 1107 | are saved in the pkgsrc tree, so don't forget to rescue them |
1114 | before updating. You can also configure pkgsrc to store distfiles | | 1108 | before updating. You can also configure pkgsrc to store distfiles |
1115 | and packages in directories outside the pkgsrc tree by setting the | | 1109 | and packages in directories outside the pkgsrc tree by setting the |
1116 | <code class="varname">DISTDIR</code> and <code class="varname">PACKAGES</code> | | 1110 | <code class="varname">DISTDIR</code> and <code class="varname">PACKAGES</code> |
1117 | variables. See <a class="xref" href="#configuring" title="Chapter 6. Configuring pkgsrc">Chapter 6, <i>Configuring pkgsrc</i></a> for the details.</p> | | 1111 | variables. See <a class="xref" href="#configuring" title="Chapter 6. Configuring pkgsrc">Chapter 6, <i>Configuring pkgsrc</i></a> for the details.</p> |
1118 | <p>To update pkgsrc from a tar file, download the tar file as | | 1112 | <p>To update pkgsrc from a tar file, download the tar file as |
1119 | explained above. Then, make sure that you have not made any | | 1113 | explained above. Then, make sure that you have not made any |
1120 | changes to the files in the pkgsrc directory. Remove the pkgsrc | | 1114 | changes to the files in the pkgsrc directory. Remove the pkgsrc |
1121 | directory and extract the new tar file. Done.</p> | | 1115 | directory and extract the new tar file. Done.</p> |
1122 | </div> | | 1116 | </div> |
1123 | <div class="sect2"> | | 1117 | <div class="sect2"> |
1124 | <div class="titlepage"><div><div><h3 class="title"> | | 1118 | <div class="titlepage"><div><div><h3 class="title"> |
1125 | <a name="uptodate-cvs"></a>3.2.2. Via CVS</h3></div></div></div> | | 1119 | <a name="uptodate-cvs"></a>3.2.2. Via CVS</h3></div></div></div> |
1126 | <p>To update pkgsrc via CVS, change to the <code class="filename">pkgsrc</code> directory and run cvs:</p> | | 1120 | <p>To update pkgsrc via CVS, change to the <code class="filename">pkgsrc</code> directory and run cvs:</p> |
1127 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr/pkgsrc && cvs update -dP</code></strong> | | 1121 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr/pkgsrc && cvs update -dP</code></strong> |
1128 | </pre> | | 1122 | </pre> |
1129 | <p>If you get error messages from <code class="literal">rsh</code>, you need to set CVS_RSH variable as described above. E.g.:</p> | | 1123 | <p>If you get error messages from <code class="literal">rsh</code>, you need to set CVS_RSH variable as described above. E.g.:</p> |
1130 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr/pkgsrc && env CVS_RSH=ssh cvs up -dP</code></strong> | | 1124 | <pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd /usr/pkgsrc && env CVS_RSH=ssh cvs up -dP</code></strong> |
1131 | </pre> | | 1125 | </pre> |
1132 | <div class="sect3"> | | 1126 | <div class="sect3"> |
1133 | <div class="titlepage"><div><div><h4 class="title"> | | 1127 | <div class="titlepage"><div><div><h4 class="title"> |
1134 | <a name="uptodate-cvs-switch"></a>3.2.2.1. Switching between different pkgsrc branches</h4></div></div></div> | | 1128 | <a name="uptodate-cvs-switch"></a>3.2.2.1. Switching between different pkgsrc branches</h4></div></div></div> |
1135 | <p>When updating pkgsrc, the CVS program keeps track of the | | 1129 | <p>When updating pkgsrc, the CVS program keeps track of the |
1136 | branch you selected. But if you, for whatever reason, want to | | 1130 | branch you selected. But if you, for whatever reason, want to |
1137 | switch from the stable branch to the current one, you can do it | | 1131 | switch from the stable branch to the current one, you can do it |
1138 | by adding the option <span class="quote">“<span class="quote">-A</span>”</span> after the | | 1132 | by adding the option <span class="quote">“<span class="quote">-A</span>”</span> after the |
1139 | <span class="quote">“<span class="quote">update</span>”</span> keyword. To switch from the current branch | | 1133 | <span class="quote">“<span class="quote">update</span>”</span> keyword. To switch from the current branch |
1140 | back to the stable branch, add the | | 1134 | back to the stable branch, add the |
1141 | <span class="quote">“<span class="quote">-rpkgsrc-2020Q1</span>”</span> option.</p> | | 1135 | <span class="quote">“<span class="quote">-rpkgsrc-2020Q1</span>”</span> option.</p> |
1142 | </div> | | 1136 | </div> |
1143 | <div class="sect3"> | | 1137 | <div class="sect3"> |
1144 | <div class="titlepage"><div><div><h4 class="title"> | | 1138 | <div class="titlepage"><div><div><h4 class="title"> |
1145 | <a name="uptodate-cvs-changes"></a>3.2.2.2. What happens to my changes when updating?</h4></div></div></div> | | 1139 | <a name="uptodate-cvs-changes"></a>3.2.2.2. What happens to my changes when updating?</h4></div></div></div> |
1146 | <p>When you update pkgsrc, the CVS program will only touch | | 1140 | <p>When you update pkgsrc, the CVS program will only touch |
1147 | those files that are registered in the CVS repository. That | | 1141 | those files that are registered in the CVS repository. That |
1148 | means that any packages that you created on your own will stay | | 1142 | means that any packages that you created on your own will stay |
1149 | unmodified. If you change files that are managed by CVS, later | | 1143 | unmodified. If you change files that are managed by CVS, later |
1150 | updates will try to merge your changes with those that have been | | 1144 | updates will try to merge your changes with those that have been |
1151 | done by others. See the CVS manual, chapter | | 1145 | done by others. See the CVS manual, chapter |
1152 | <span class="quote">“<span class="quote">update</span>”</span> for details.</p> | | 1146 | <span class="quote">“<span class="quote">update</span>”</span> for details.</p> |
1153 | </div> | | 1147 | </div> |
1154 | </div> | | 1148 | </div> |
1155 | </div> | | 1149 | </div> |
1156 | </div> | | 1150 | </div> |
1157 | <div class="chapter"> | | 1151 | <div class="chapter"> |
1158 | <div class="titlepage"><div><div><h2 class="title"> | | 1152 | <div class="titlepage"><div><div><h2 class="title"> |
1159 | <a name="platforms"></a>Chapter 4. Using pkgsrc on systems other than NetBSD</h2></div></div></div> | | 1153 | <a name="platforms"></a>Chapter 4. Using pkgsrc on systems other than NetBSD</h2></div></div></div> |
1160 | <div class="toc"> | | 1154 | <div class="toc"> |
1161 | <p><b>Table of Contents</b></p> | | 1155 | <p><b>Table of Contents</b></p> |
1162 | <dl class="toc"> | | 1156 | <dl class="toc"> |
1163 | <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt> | | 1157 | <dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt> |
1164 | <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt> | | 1158 | <dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt> |
1165 | </dl> | | 1159 | </dl> |
1166 | </div> | | 1160 | </div> |
1167 | <div class="sect1"> | | 1161 | <div class="sect1"> |
1168 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1162 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1169 | <a name="binarydist"></a>4.1. Binary distribution</h2></div></div></div> | | 1163 | <a name="binarydist"></a>4.1. Binary distribution</h2></div></div></div> |
1170 | <p>See <a class="xref" href="#using-pkg" title="5.1. Using binary packages">Section 5.1, “Using binary packages”</a>.</p> | | 1164 | <p>See <a class="xref" href="#using-pkg" title="5.1. Using binary packages">Section 5.1, “Using binary packages”</a>.</p> |
1171 | </div> | | 1165 | </div> |
1172 | <div class="sect1"> | | 1166 | <div class="sect1"> |
1173 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1167 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1174 | <a name="bootstrapping-pkgsrc"></a>4.2. Bootstrapping pkgsrc</h2></div></div></div> | | 1168 | <a name="bootstrapping-pkgsrc"></a>4.2. Bootstrapping pkgsrc</h2></div></div></div> |
1175 | <p>pkgsrc can be bootstrapped for use in two different modes: | | 1169 | <p>pkgsrc can be bootstrapped for use in two different modes: |
1176 | privileged and unprivileged one. In unprivileged mode in contrast | | 1170 | privileged and unprivileged one. In unprivileged mode in contrast |
1177 | to privileged one all programs are installed under one particular user | | 1171 | to privileged one all programs are installed under one particular user |
1178 | and cannot utilise privileged operations (packages don't create | | 1172 | and cannot utilise privileged operations (packages don't create |
1179 | special users and all special file permissions like setuid are ignored). | | 1173 | special users and all special file permissions like setuid are ignored). |
1180 | </p> | | 1174 | </p> |
1181 | <p>Installing the bootstrap kit from source should be as simple as:</p> | | 1175 | <p>Installing the bootstrap kit from source should be as simple as:</p> |
1182 | <pre class="screen"> | | 1176 | <pre class="screen"> |
1183 | <code class="prompt">#</code> <strong class="userinput"><code>env CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc</code></strong> | | 1177 | <code class="prompt">#</code> <strong class="userinput"><code>env CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc</code></strong> |
1184 | <code class="prompt">#</code> <strong class="userinput"><code>cd pkgsrc/bootstrap</code></strong> | | 1178 | <code class="prompt">#</code> <strong class="userinput"><code>cd pkgsrc/bootstrap</code></strong> |
1185 | <code class="prompt">#</code> <strong class="userinput"><code>./bootstrap</code></strong> | | 1179 | <code class="prompt">#</code> <strong class="userinput"><code>./bootstrap</code></strong> |
1186 | </pre> | | 1180 | </pre> |
1187 | <p>To bootstrap in unprivileged mode pass <span class="quote">“<span class="quote">--unprivileged</span>”</span> flag to <span class="command"><strong>bootstrap</strong></span></p> | | 1181 | <p>To bootstrap in unprivileged mode pass <span class="quote">“<span class="quote">--unprivileged</span>”</span> flag to <span class="command"><strong>bootstrap</strong></span></p> |
1188 | <p>By default, in privileged mode pkgsrc uses | | 1182 | <p>By default, in privileged mode pkgsrc uses |
1189 | <code class="filename">/usr/pkg</code> for <span class="emphasis"><em>prefix</em></span> | | 1183 | <code class="filename">/usr/pkg</code> for <span class="emphasis"><em>prefix</em></span> |
1190 | where programs will be installed in, | | 1184 | where programs will be installed in, |
1191 | and <code class="filename">/usr/pkg/pkgdb</code> for the package database | | 1185 | and <code class="filename">/usr/pkg/pkgdb</code> for the package database |
1192 | directory where pkgsrc will do its internal bookkeeping, | | 1186 | directory where pkgsrc will do its internal bookkeeping, |
1193 | <code class="filename">/var</code> is used as <span class="emphasis"><em>varbase</em></span>, | | 1187 | <code class="filename">/var</code> is used as <span class="emphasis"><em>varbase</em></span>, |
1194 | where packages install their persistent data. | | 1188 | where packages install their persistent data. |
1195 | In unprivileged mode pkgsrc uses | | 1189 | In unprivileged mode pkgsrc uses |
1196 | <code class="filename">~/pkg</code> for <span class="emphasis"><em>prefix</em></span>, | | 1190 | <code class="filename">~/pkg</code> for <span class="emphasis"><em>prefix</em></span>, |
1197 | <code class="filename">~/pkg/pkgdb</code> for the package database, | | 1191 | <code class="filename">~/pkg/pkgdb</code> for the package database, |
1198 | and <code class="filename">~/pkg/var</code> for <span class="emphasis"><em>varbase</em></span>. | | 1192 | and <code class="filename">~/pkg/var</code> for <span class="emphasis"><em>varbase</em></span>. |
1199 | </p> | | 1193 | </p> |
1200 | <p>You can change default layout using command-line arguments. | | 1194 | <p>You can change default layout using command-line arguments. |
1201 | Run <span class="quote">“<span class="quote">./bootstrap --help</span>”</span> to get details. | | 1195 | Run <span class="quote">“<span class="quote">./bootstrap --help</span>”</span> to get details. |
1202 | </p> | | 1196 | </p> |
1203 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 1197 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
1204 | <h3 class="title">Note</h3> | | 1198 | <h3 class="title">Note</h3> |
1205 | <p>The bootstrap installs a <span class="command"><strong>bmake</strong></span> tool. | | 1199 | <p>The bootstrap installs a <span class="command"><strong>bmake</strong></span> tool. |
1206 | Use this <span class="command"><strong>bmake</strong></span> when building via pkgsrc. | | 1200 | Use this <span class="command"><strong>bmake</strong></span> when building via pkgsrc. |
1207 | For examples in this guide, use <span class="command"><strong>bmake</strong></span> | | 1201 | For examples in this guide, use <span class="command"><strong>bmake</strong></span> |
1208 | instead of <span class="quote">“<span class="quote">make</span>”</span>.</p> | | 1202 | instead of <span class="quote">“<span class="quote">make</span>”</span>.</p> |
1209 | </div> | | 1203 | </div> |
1210 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 1204 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
1211 | <h3 class="title">Note</h3> | | 1205 | <h3 class="title">Note</h3> |
1212 | <p>It is possible to bootstrap multiple instances of pkgsrc | | 1206 | <p>It is possible to bootstrap multiple instances of pkgsrc |
1213 | using non-intersecting directories. Use <span class="command"><strong>bmake</strong></span> | | 1207 | using non-intersecting directories. Use <span class="command"><strong>bmake</strong></span> |
1214 | corresponding to the installation you're working with to build | | 1208 | corresponding to the installation you're working with to build |
1215 | and install packages. | | 1209 | and install packages. |
1216 | </p> | | 1210 | </p> |
1217 | </div> | | 1211 | </div> |
1218 | </div> | | 1212 | </div> |
1219 | </div> | | 1213 | </div> |
1220 | <div class="chapter"> | | 1214 | <div class="chapter"> |
1221 | <div class="titlepage"><div><div><h2 class="title"> | | 1215 | <div class="titlepage"><div><div><h2 class="title"> |
1222 | <a name="using"></a>Chapter 5. Using pkgsrc</h2></div></div></div> | | 1216 | <a name="using"></a>Chapter 5. Using pkgsrc</h2></div></div></div> |
1223 | <div class="toc"> | | 1217 | <div class="toc"> |
1224 | <p><b>Table of Contents</b></p> | | 1218 | <p><b>Table of Contents</b></p> |
1225 | <dl class="toc"> | | 1219 | <dl class="toc"> |
1226 | <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt> | | 1220 | <dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt> |
1227 | <dd><dl> | | 1221 | <dd><dl> |
1228 | <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt> | | 1222 | <dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt> |
1229 | <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt> | | 1223 | <dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt> |
1230 | <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt> | | 1224 | <dt><span class="sect2"><a href="#using.pkg_delete">5.1.3. Deinstalling packages</a></span></dt> |
1231 | <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt> | | 1225 | <dt><span class="sect2"><a href="#using.pkg_info">5.1.4. Getting information about installed packages</a></span></dt> |
1232 | <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> | | 1226 | <dt><span class="sect2"><a href="#vulnerabilities">5.1.5. Checking for security vulnerabilities in installed packages</a></span></dt> |
1233 | <dt><span class="sect2"><a href="#pkg_versions">5.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> | | 1227 | <dt><span class="sect2"><a href="#pkg_versions">5.1.6. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt> |
1234 | <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt> | | 1228 | <dt><span class="sect2"><a href="#using.pkg_admin">5.1.7. Other administrative functions</a></span></dt> |
1235 | </dl></dd> | | 1229 | </dl></dd> |
1236 | <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt> | | 1230 | <dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt> |
1237 | <dd><dl> | | 1231 | <dd><dl> |
1238 | <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt> | | 1232 | <dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt> |
1239 | <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt> | | 1233 | <dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt> |
1240 | <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt> | | 1234 | <dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt> |
1241 | </dl></dd> | | 1235 | </dl></dd> |
1242 | </dl> | | 1236 | </dl> |
1243 | </div> | | 1237 | </div> |
1244 | <p>Basically, there are two ways of using pkgsrc. The first | | 1238 | <p>Basically, there are two ways of using pkgsrc. The first |
1245 | is to only install the package tools and to use binary packages | | 1239 | is to only install the package tools and to use binary packages |
1246 | that someone else has prepared. This is the <span class="quote">“<span class="quote">pkg</span>”</span> | | 1240 | that someone else has prepared. This is the <span class="quote">“<span class="quote">pkg</span>”</span> |
1247 | in pkgsrc. The second way is to install the <span class="quote">“<span class="quote">src</span>”</span> | | 1241 | in pkgsrc. The second way is to install the <span class="quote">“<span class="quote">src</span>”</span> |
1248 | of pkgsrc, too. Then you are able to build your own packages, | | 1242 | of pkgsrc, too. Then you are able to build your own packages, |
1249 | and you can still use binary packages from someone else.</p> | | 1243 | and you can still use binary packages from someone else.</p> |
1250 | <div class="sect1"> | | 1244 | <div class="sect1"> |
1251 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1245 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1252 | <a name="using-pkg"></a>5.1. Using binary packages</h2></div></div></div> | | 1246 | <a name="using-pkg"></a>5.1. Using binary packages</h2></div></div></div> |
1253 | <p>On the <a class="ulink" href="https://cdn.NetBSD.org/" target="_top">cdn.NetBSD.org</a> | | 1247 | <p>On the <a class="ulink" href="http://cdn.NetBSD.org/" target="_top">cdn.NetBSD.org</a> |
1254 | site and mirrors, there are collections of binary packages, | | 1248 | site and mirrors, there are collections of binary packages, |
1255 | ready to be installed. These binary packages have been built using the | | 1249 | ready to be installed. These binary packages have been built using the |
1256 | default settings for the directories, that is:</p> | | 1250 | default settings for the directories, that is:</p> |
1257 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 1251 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
1258 | <li class="listitem"><p><code class="filename">/usr/pkg</code> for <code class="varname">LOCALBASE</code>, where most of the files are installed,</p></li> | | 1252 | <li class="listitem"><p><code class="filename">/usr/pkg</code> for <code class="varname">LOCALBASE</code>, where most of the files are installed,</p></li> |
1259 | <li class="listitem"><p><code class="filename">/usr/pkg/etc</code> for configuration files,</p></li> | | 1253 | <li class="listitem"><p><code class="filename">/usr/pkg/etc</code> for configuration files,</p></li> |
1260 | <li class="listitem"><p><code class="filename">/var</code> for <code class="varname">VARBASE</code>, where those files are installed that may change after installation.</p></li> | | 1254 | <li class="listitem"><p><code class="filename">/var</code> for <code class="varname">VARBASE</code>, where those files are installed that may change after installation.</p></li> |
1261 | </ul></div> | | 1255 | </ul></div> |
1262 | <p>If you cannot use these directories for whatever reasons (maybe | | 1256 | <p>If you cannot use these directories for whatever reasons (maybe |
1263 | because you're not root), you cannot use these binary packages, but | | 1257 | because you're not root), you cannot use these binary packages, but |
1264 | have to build the packages yourself, which is explained in <a class="xref" href="#bootstrapping-pkgsrc" title="4.2. Bootstrapping pkgsrc">Section 4.2, “Bootstrapping pkgsrc”</a>.</p> | | 1258 | have to build the packages yourself, which is explained in <a class="xref" href="#bootstrapping-pkgsrc" title="4.2. Bootstrapping pkgsrc">Section 4.2, “Bootstrapping pkgsrc”</a>.</p> |
1265 | <div class="sect2"> | | 1259 | <div class="sect2"> |
1266 | <div class="titlepage"><div><div><h3 class="title"> | | 1260 | <div class="titlepage"><div><div><h3 class="title"> |
1267 | <a name="finding-binary-packages"></a>5.1.1. Finding binary packages</h3></div></div></div> | | 1261 | <a name="finding-binary-packages"></a>5.1.1. Finding binary packages</h3></div></div></div> |
1268 | <p>To install binary packages, you first need to know from where | | 1262 | <p>To install binary packages, you first need to know from where |
1269 | to get them. The first place where you should look is on the main | | 1263 | to get them. The first place where you should look is on the main |
1270 | pkgsrc FTP server in the directory <a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/packages/" target="_top"><code class="filename">/pub/pkgsrc/packages</code></a>.</p> | | 1264 | |
| | | 1265 | pkgsrc FTP server in the directory <a class="ulink" href="http://cdn.NetBSD.org/pub/pkgsrc/packages/" target="_top"><code class="filename">/pub/pkgsrc/packages</code></a>.</p> |
1271 | <p>This directory contains binary packages for multiple | | 1266 | <p>This directory contains binary packages for multiple |
1272 | platforms. First, select your operating system. (Ignore the | | 1267 | platforms. First, select your operating system. (Ignore the |
1273 | directories with version numbers attached to it, they just exist for | | 1268 | directories with version numbers attached to it, they just exist for |
1274 | legacy reasons.) Then, select your hardware architecture, and in the | | 1269 | legacy reasons.) Then, select your hardware architecture, and in the |
1275 | third step, the OS version and the <span class="quote">“<span class="quote">version</span>”</span> of pkgsrc.</p> | | 1270 | third step, the OS version and the <span class="quote">“<span class="quote">version</span>”</span> of pkgsrc.</p> |
1276 | <p>In this directory, you often find a file called | | 1271 | <p>In this directory, you often find a file called |
1277 | <code class="filename">bootstrap.tar.gz</code> which contains the package | | 1272 | <code class="filename">bootstrap.tar.gz</code> which contains the package |
1278 | management tools. If the file is missing, it is likely that your | | 1273 | management tools. If the file is missing, it is likely that your |
1279 | operating system already provides those tools. Download the file and | | 1274 | operating system already provides those tools. Download the file and |
1280 | extract it in the <code class="filename">/</code> directory. It will create | | 1275 | extract it in the <code class="filename">/</code> directory. It will create |
1281 | the directories <code class="filename">/usr/pkg</code> (containing the tools | | 1276 | the directories <code class="filename">/usr/pkg</code> (containing the tools |
1282 | for managing binary packages and the database of installed packages).</p> | | 1277 | for managing binary packages and the database of installed packages).</p> |
1283 | </div> | | 1278 | </div> |
1284 | <div class="sect2"> | | 1279 | <div class="sect2"> |
1285 | <div class="titlepage"><div><div><h3 class="title"> | | 1280 | <div class="titlepage"><div><div><h3 class="title"> |
1286 | <a name="installing-binary-packages"></a>5.1.2. Installing binary packages</h3></div></div></div> | | 1281 | <a name="installing-binary-packages"></a>5.1.2. Installing binary packages</h3></div></div></div> |
1287 | <p>In the directory from the last section, there is a | | 1282 | <p>In the directory from the last section, there is a |
1288 | subdirectory called <code class="filename">All/</code>, which contains all the | | 1283 | subdirectory called <code class="filename">All/</code>, which contains all the |
1289 | binary packages that are available for the platform, excluding those | | 1284 | binary packages that are available for the platform, excluding those |
1290 | that may not be distributed via FTP or CDROM (depending on which | | 1285 | that may not be distributed via FTP or CDROM (depending on which |
1291 | medium you are using).</p> | | 1286 | medium you are using).</p> |
1292 | <p>To install packages directly from an FTP or HTTP server, run | | 1287 | <p>To install packages directly from an FTP or HTTP server, run |
1293 | the following commands in a Bourne-compatible shell (be sure to | | 1288 | the following commands in a Bourne-compatible shell (be sure to |
1294 | <span class="command"><strong>su</strong></span> to root first):</p> | | 1289 | <span class="command"><strong>su</strong></span> to root first):</p> |
1295 | <pre class="screen"> | | 1290 | <pre class="screen"> |
1296 | <code class="prompt">#</code> <strong class="userinput"><code>PATH="/usr/pkg/sbin:$PATH"</code></strong> | | 1291 | <code class="prompt">#</code> <strong class="userinput"><code>PATH="/usr/pkg/sbin:$PATH"</code></strong> |
1297 | <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages"</code></strong> | | 1292 | |
| | | 1293 | <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="http://cdn.NetBSD.org/pub/pkgsrc/packages"</code></strong> |
1298 | <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="$PKG_PATH/<em class="replaceable"><code>OPSYS</code></em>/<em class="replaceable"><code>ARCH</code></em>/<em class="replaceable"><code>VERSIONS</code></em>/All/"</code></strong> | | 1294 | <code class="prompt">#</code> <strong class="userinput"><code>PKG_PATH="$PKG_PATH/<em class="replaceable"><code>OPSYS</code></em>/<em class="replaceable"><code>ARCH</code></em>/<em class="replaceable"><code>VERSIONS</code></em>/All/"</code></strong> |
1299 | <code class="prompt">#</code> <strong class="userinput"><code>export PATH PKG_PATH</code></strong> | | 1295 | <code class="prompt">#</code> <strong class="userinput"><code>export PATH PKG_PATH</code></strong> |
1300 | </pre> | | 1296 | </pre> |
1301 | <p>Instead of URLs, you can also use local paths, for example if | | 1297 | <p>Instead of URLs, you can also use local paths, for example if |
1302 | you are installing from a set of CDROMs, DVDs or an NFS-mounted | | 1298 | you are installing from a set of CDROMs, DVDs or an NFS-mounted |
1303 | repository. If you want to install packages from multiple sources, | | 1299 | repository. If you want to install packages from multiple sources, |
1304 | you can separate them by a semicolon in | | 1300 | you can separate them by a semicolon in |
1305 | <code class="varname">PKG_PATH</code>.</p> | | 1301 | <code class="varname">PKG_PATH</code>.</p> |
1306 | <p>After these preparations, installing a package is very | | 1302 | <p>After these preparations, installing a package is very |
1307 | easy:</p> | | 1303 | easy:</p> |
1308 | <pre class="screen"> | | 1304 | <pre class="screen"> |
1309 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add libreoffice</code></strong> | | 1305 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add libreoffice</code></strong> |
1310 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add ap24-php71-*</code></strong> | | 1306 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add ap24-php71-*</code></strong> |
1311 | </pre> | | 1307 | </pre> |
1312 | <p>Note that any prerequisite packages needed to run the | | 1308 | <p>Note that any prerequisite packages needed to run the |
1313 | package in question will be installed, too, assuming they are | | 1309 | package in question will be installed, too, assuming they are |
1314 | present where you install from.</p> | | 1310 | present where you install from.</p> |
1315 | <p>Adding packages might install vulnerable packages. | | 1311 | <p>Adding packages might install vulnerable packages. |
1316 | Thus you should run <span class="command"><strong>pkg_admin audit</strong></span> | | 1312 | Thus you should run <span class="command"><strong>pkg_admin audit</strong></span> |
1317 | regularly, especially after installing new packages, and verify | | 1313 | regularly, especially after installing new packages, and verify |
1318 | that the vulnerabilities are acceptable for your configuration.</p> | | 1314 | that the vulnerabilities are acceptable for your configuration.</p> |
1319 | <p>After you've installed packages, be sure to have | | 1315 | <p>After you've installed packages, be sure to have |
1320 | <code class="filename">/usr/pkg/bin</code> and <code class="filename">/usr/pkg/sbin</code> in your | | 1316 | <code class="filename">/usr/pkg/bin</code> and <code class="filename">/usr/pkg/sbin</code> in your |
1321 | <code class="varname">PATH</code> so you can actually start the just | | 1317 | <code class="varname">PATH</code> so you can actually start the just |
1322 | installed program.</p> | | 1318 | installed program.</p> |
1323 | </div> | | 1319 | </div> |
1324 | <div class="sect2"> | | 1320 | <div class="sect2"> |
1325 | <div class="titlepage"><div><div><h3 class="title"> | | 1321 | <div class="titlepage"><div><div><h3 class="title"> |
1326 | <a name="using.pkg_delete"></a>5.1.3. Deinstalling packages</h3></div></div></div> | | 1322 | <a name="using.pkg_delete"></a>5.1.3. Deinstalling packages</h3></div></div></div> |
1327 | <p>To deinstall a package, it does not matter whether it was | | 1323 | <p>To deinstall a package, it does not matter whether it was |
1328 | installed from source code or from a binary package. The | | 1324 | installed from source code or from a binary package. The |
1329 | <span class="command"><strong>pkg_delete</strong></span> command does not know it anyway. | | 1325 | <span class="command"><strong>pkg_delete</strong></span> command does not know it anyway. |
1330 | To delete a package, you can just run <span class="command"><strong>pkg_delete | | 1326 | To delete a package, you can just run <span class="command"><strong>pkg_delete |
1331 | <em class="replaceable"><code>package-name</code></em></strong></span>. The package | | 1327 | <em class="replaceable"><code>package-name</code></em></strong></span>. The package |
1332 | name can be given with or without version number. Wildcards can | | 1328 | name can be given with or without version number. Wildcards can |
1333 | also be used to deinstall a set of packages, for example | | 1329 | also be used to deinstall a set of packages, for example |
1334 | <code class="literal">*emacs*</code>. Be sure to include them in quotes, | | 1330 | <code class="literal">*emacs*</code>. Be sure to include them in quotes, |
1335 | so that the shell does not expand them before | | 1331 | so that the shell does not expand them before |
1336 | <code class="literal">pkg_delete</code> sees them.</p> | | 1332 | <code class="literal">pkg_delete</code> sees them.</p> |
1337 | <p>The <code class="option">-r</code> option is very powerful: it | | 1333 | <p>The <code class="option">-r</code> option is very powerful: it |
1338 | removes all the packages that require the package in question | | 1334 | removes all the packages that require the package in question |
1339 | and then removes the package itself. For example: | | 1335 | and then removes the package itself. For example: |
1340 | | | 1336 | |
1341 | </p> | | 1337 | </p> |
1342 | <pre class="screen"> | | 1338 | <pre class="screen"> |
1343 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_delete -r jpeg</code></strong> | | 1339 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_delete -r jpeg</code></strong> |
1344 | </pre> | | 1340 | </pre> |
1345 | <p> | | 1341 | <p> |
1346 | | | 1342 | |
1347 | will remove jpeg and all the packages that used it; this allows | | 1343 | will remove jpeg and all the packages that used it; this allows |
1348 | upgrading the jpeg package.</p> | | 1344 | upgrading the jpeg package.</p> |
1349 | </div> | | 1345 | </div> |
1350 | <div class="sect2"> | | 1346 | <div class="sect2"> |
1351 | <div class="titlepage"><div><div><h3 class="title"> | | 1347 | <div class="titlepage"><div><div><h3 class="title"> |
1352 | <a name="using.pkg_info"></a>5.1.4. Getting information about installed packages</h3></div></div></div> | | 1348 | <a name="using.pkg_info"></a>5.1.4. Getting information about installed packages</h3></div></div></div> |
1353 | <p>The <span class="command"><strong>pkg_info</strong></span> shows information about | | 1349 | <p>The <span class="command"><strong>pkg_info</strong></span> shows information about |
1354 | installed packages or binary package files.</p> | | 1350 | installed packages or binary package files.</p> |
1355 | </div> | | 1351 | </div> |
1356 | <div class="sect2"> | | 1352 | <div class="sect2"> |
1357 | <div class="titlepage"><div><div><h3 class="title"> | | 1353 | <div class="titlepage"><div><div><h3 class="title"> |
1358 | <a name="vulnerabilities"></a>5.1.5. Checking for security vulnerabilities in installed packages</h3></div></div></div> | | 1354 | <a name="vulnerabilities"></a>5.1.5. Checking for security vulnerabilities in installed packages</h3></div></div></div> |
1359 | <p> | | 1355 | <p> |
1360 | The pkgsrc Security Team and Packages Groups maintain a list of | | 1356 | The pkgsrc Security Team and Packages Groups maintain a list of |
1361 | known security vulnerabilities to packages which are (or have been) | | 1357 | known security vulnerabilities to packages which are (or have been) |
1362 | included in pkgsrc. The list is available from the NetBSD | | 1358 | included in pkgsrc. The list is available from the NetBSD |
1363 | FTP site at <a class="ulink" href="https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities" target="_top">https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities</a>. | | 1359 | |
| | | 1360 | FTP site at <a class="ulink" href="http://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities" target="_top">http://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities</a>. |
1364 | </p> | | 1361 | </p> |
1365 | <p> | | 1362 | <p> |
1366 | Through <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, | | 1363 | Through <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, |
1367 | this list can be downloaded | | 1364 | this list can be downloaded |
1368 | automatically, and a security audit of all packages installed on a system | | 1365 | automatically, and a security audit of all packages installed on a system |
1369 | can take place. | | 1366 | can take place. |
1370 | </p> | | 1367 | </p> |
1371 | <p> | | 1368 | <p> |
1372 | There are two components to auditing. The first | | 1369 | There are two components to auditing. The first |
1373 | step, <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, | | 1370 | step, <span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, |
1374 | is for downloading | | 1371 | is for downloading |
1375 | the list of vulnerabilities from the NetBSD FTP site. The second | | 1372 | the list of vulnerabilities from the NetBSD FTP site. The second |
1376 | step, <span class="command"><strong>pkg_admin audit</strong></span>, checks to see if any of your | | 1373 | step, <span class="command"><strong>pkg_admin audit</strong></span>, checks to see if any of your |
1377 | installed packages are vulnerable. If a package is vulnerable, you | | 1374 | installed packages are vulnerable. If a package is vulnerable, you |
1378 | will see output similar to the following: | | 1375 | will see output similar to the following: |
1379 | </p> | | 1376 | </p> |
1380 | <pre class="screen">Package samba-2.0.9 has a local-root-shell vulnerability, see | | 1377 | <pre class="screen">Package samba-2.0.9 has a local-root-shell vulnerability, see |
1381 | https://www.samba.org/samba/whatsnew/macroexploit.html</pre> | | 1378 | https://www.samba.org/samba/whatsnew/macroexploit.html</pre> |
1382 | <p> | | 1379 | <p> |
1383 | You may wish to have the | | 1380 | You may wish to have the |
1384 | <a class="ulink" href="https://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities" target="_top">vulnerabilities</a> | | 1381 | |
| | | 1382 | <a class="ulink" href="http://ftp.NetBSD.org/pub/pkgsrc/distfiles/vulnerabilities" target="_top">vulnerabilities</a> |
1385 | file downloaded daily so that | | 1383 | file downloaded daily so that |
1386 | it remains current. This may be done by adding an appropriate entry | | 1384 | it remains current. This may be done by adding an appropriate entry |
1387 | to the root users <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?crontab+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">crontab</span>(5)</span></a> entry. For example the entry | | 1385 | to the root users <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?crontab+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">crontab</span>(5)</span></a> entry. For example the entry |
1388 | </p> | | 1386 | </p> |
1389 | <pre class="screen"> | | 1387 | <pre class="screen"> |
1390 | # Download vulnerabilities file | | 1388 | # Download vulnerabilities file |
1391 | 0 3 * * * /usr/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities >/dev/null 2>&1 | | 1389 | 0 3 * * * /usr/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities >/dev/null 2>&1 |
1392 | # Audit the installed packages and email results to root | | 1390 | # Audit the installed packages and email results to root |
1393 | 9 3 * * * /usr/pkg/sbin/pkg_admin audit |mail -s "Installed package audit result" \ | | 1391 | 9 3 * * * /usr/pkg/sbin/pkg_admin audit |mail -s "Installed package audit result" \ |
1394 | root >/dev/null 2>&1 | | 1392 | root >/dev/null 2>&1 |
1395 | </pre> | | 1393 | </pre> |
1396 | <p> | | 1394 | <p> |
1397 | will update the vulnerability list every day at 3AM, followed by an audit | | 1395 | will update the vulnerability list every day at 3AM, followed by an audit |
1398 | at 3:09AM. The result of the audit are then emailed to root. | | 1396 | at 3:09AM. The result of the audit are then emailed to root. |
1399 | | | 1397 | |
1400 | On NetBSD this may be accomplished instead by adding the following | | 1398 | On NetBSD this may be accomplished instead by adding the following |
1401 | line to <code class="filename">/etc/daily.conf</code>: | | 1399 | line to <code class="filename">/etc/daily.conf</code>: |
1402 | </p> | | 1400 | </p> |
1403 | <pre class="screen"> | | 1401 | <pre class="screen"> |
1404 | fetch_pkg_vulnerabilities=YES | | 1402 | fetch_pkg_vulnerabilities=YES |
1405 | </pre> | | 1403 | </pre> |
1406 | <p> | | 1404 | <p> |
1407 | to fetch the vulnerability list from the daily security script. The system | | 1405 | to fetch the vulnerability list from the daily security script. The system |
1408 | is set to audit the packages by default but can be set explicitly, if | | 1406 | is set to audit the packages by default but can be set explicitly, if |
1409 | desired (not required), by adding the following line to | | 1407 | desired (not required), by adding the following line to |
1410 | <code class="filename">/etc/security.conf</code>: | | 1408 | <code class="filename">/etc/security.conf</code>: |
1411 | </p> | | 1409 | </p> |
1412 | <pre class="screen"> | | 1410 | <pre class="screen"> |
1413 | check_pkg_vulnerabilities=YES | | 1411 | check_pkg_vulnerabilities=YES |
1414 | </pre> | | 1412 | </pre> |
1415 | <p> | | 1413 | <p> |
1416 | see <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?daily.conf+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">daily.conf</span>(5)</span></a> and <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?security.conf+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">security.conf</span>(5)</span></a> for more details. | | 1414 | see <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?daily.conf+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">daily.conf</span>(5)</span></a> and <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?security.conf+5.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">security.conf</span>(5)</span></a> for more details. |
1417 | </p> | | 1415 | </p> |
1418 | </div> | | 1416 | </div> |
1419 | <div class="sect2"> | | 1417 | <div class="sect2"> |
1420 | <div class="titlepage"><div><div><h3 class="title"> | | 1418 | <div class="titlepage"><div><div><h3 class="title"> |
1421 | <a name="pkg_versions"></a>5.1.6. Finding if newer versions of your installed packages are in pkgsrc</h3></div></div></div> | | 1419 | <a name="pkg_versions"></a>5.1.6. Finding if newer versions of your installed packages are in pkgsrc</h3></div></div></div> |
1422 | <p> | | 1420 | <p> |
1423 | Install <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/lintpkgsrc/README.html" target="_top"><code class="filename">pkgtools/lintpkgsrc</code></a> and run | | 1421 | Install <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/lintpkgsrc/README.html" target="_top"><code class="filename">pkgtools/lintpkgsrc</code></a> and run |
1424 | <span class="command"><strong>lintpkgsrc</strong></span> with the <span class="quote">“<span class="quote">-i</span>”</span> | | 1422 | <span class="command"><strong>lintpkgsrc</strong></span> with the <span class="quote">“<span class="quote">-i</span>”</span> |
1425 | argument to check if your packages are up-to-date, e.g. | | 1423 | argument to check if your packages are up-to-date, e.g. |
1426 | </p> | | 1424 | </p> |
1427 | <pre class="screen"> | | 1425 | <pre class="screen"> |
1428 | <code class="prompt">%</code> <strong class="userinput"><code>lintpkgsrc -i</code></strong> | | 1426 | <code class="prompt">%</code> <strong class="userinput"><code>lintpkgsrc -i</code></strong> |
1429 | ... | | 1427 | ... |
1430 | Version mismatch: 'tcsh' 6.09.00 vs 6.10.00 | | 1428 | Version mismatch: 'tcsh' 6.09.00 vs 6.10.00 |
1431 | </pre> | | 1429 | </pre> |
1432 | <p>You can then use <span class="command"><strong>make update</strong></span> to update the | | 1430 | <p>You can then use <span class="command"><strong>make update</strong></span> to update the |
1433 | package on your system and rebuild any dependencies. | | 1431 | package on your system and rebuild any dependencies. |
1434 | </p> | | 1432 | </p> |
1435 | </div> | | 1433 | </div> |
1436 | <div class="sect2"> | | 1434 | <div class="sect2"> |
1437 | <div class="titlepage"><div><div><h3 class="title"> | | 1435 | <div class="titlepage"><div><div><h3 class="title"> |
1438 | <a name="using.pkg_admin"></a>5.1.7. Other administrative functions</h3></div></div></div> | | 1436 | <a name="using.pkg_admin"></a>5.1.7. Other administrative functions</h3></div></div></div> |
1439 | <p>The <span class="command"><strong>pkg_admin</strong></span> executes various | | 1437 | <p>The <span class="command"><strong>pkg_admin</strong></span> executes various |
1440 | administrative functions on the package system.</p> | | 1438 | administrative functions on the package system.</p> |
1441 | </div> | | 1439 | </div> |
1442 | </div> | | 1440 | </div> |
1443 | <div class="sect1"> | | 1441 | <div class="sect1"> |
1444 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1442 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1445 | <a name="building-packages-from-source"></a>5.2. Building packages from source</h2></div></div></div> | | 1443 | <a name="building-packages-from-source"></a>5.2. Building packages from source</h2></div></div></div> |
1446 | <p>After obtaining pkgsrc, the <code class="filename">pkgsrc</code> | | 1444 | <p>After obtaining pkgsrc, the <code class="filename">pkgsrc</code> |
1447 | directory now contains a set of packages, organized into | | 1445 | directory now contains a set of packages, organized into |
1448 | categories. You can browse the online index of packages, or run | | 1446 | categories. You can browse the online index of packages, or run |
1449 | <span class="command"><strong>make readme</strong></span> from the <code class="filename">pkgsrc</code> | | 1447 | <span class="command"><strong>make readme</strong></span> from the <code class="filename">pkgsrc</code> |
1450 | directory to build local <code class="filename">README.html</code> files for | | 1448 | directory to build local <code class="filename">README.html</code> files for |
1451 | all packages, viewable with any web browser such as <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/lynx/README.html" target="_top"><code class="filename">www/lynx</code></a> or <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a>.</p> | | 1449 | all packages, viewable with any web browser such as <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/lynx/README.html" target="_top"><code class="filename">www/lynx</code></a> or <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/README.html" target="_top"><code class="filename">www/firefox</code></a>.</p> |
1452 | <p>The default <span class="emphasis"><em>prefix</em></span> for installed packages | | 1450 | <p>The default <span class="emphasis"><em>prefix</em></span> for installed packages |
1453 | is <code class="filename">/usr/pkg</code>. If you wish to change this, you | | 1451 | is <code class="filename">/usr/pkg</code>. If you wish to change this, you |
1454 | should do so by setting <code class="varname">LOCALBASE</code> in | | 1452 | should do so by setting <code class="varname">LOCALBASE</code> in |
1455 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. You should not try to use multiple | | 1453 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. You should not try to use multiple |
1456 | different <code class="varname">LOCALBASE</code> definitions on the same | | 1454 | different <code class="varname">LOCALBASE</code> definitions on the same |
1457 | system (inside a chroot is an exception). </p> | | 1455 | system (inside a chroot is an exception). </p> |
1458 | <p>The rest of this chapter assumes that the package is already | | 1456 | <p>The rest of this chapter assumes that the package is already |
1459 | in pkgsrc. If it is not, see <a class="xref" href="#developers-guide" title="Part II. The pkgsrc developer's guide">Part II, “The pkgsrc developer's guide”</a> for | | 1457 | in pkgsrc. If it is not, see <a class="xref" href="#developers-guide" title="Part II. The pkgsrc developer's guide">Part II, “The pkgsrc developer's guide”</a> for |
1460 | instructions how to create your own packages.</p> | | 1458 | instructions how to create your own packages.</p> |
1461 | <div class="sect2"> | | 1459 | <div class="sect2"> |
1462 | <div class="titlepage"><div><div><h3 class="title"> | | 1460 | <div class="titlepage"><div><div><h3 class="title"> |
1463 | <a name="requirements"></a>5.2.1. Requirements</h3></div></div></div> | | 1461 | <a name="requirements"></a>5.2.1. Requirements</h3></div></div></div> |
1464 | <p>To build packages from source, you need a working C | | 1462 | <p>To build packages from source, you need a working C |
1465 | compiler. On NetBSD, you need to install the | | 1463 | compiler. On NetBSD, you need to install the |
1466 | <span class="quote">“<span class="quote">comp</span>”</span> and the <span class="quote">“<span class="quote">text</span>”</span> distribution | | 1464 | <span class="quote">“<span class="quote">comp</span>”</span> and the <span class="quote">“<span class="quote">text</span>”</span> distribution |
1467 | sets. If you want to build X11-related packages, the | | 1465 | sets. If you want to build X11-related packages, the |
1468 | <span class="quote">“<span class="quote">xbase</span>”</span> and <span class="quote">“<span class="quote">xcomp</span>”</span> distribution | | 1466 | <span class="quote">“<span class="quote">xbase</span>”</span> and <span class="quote">“<span class="quote">xcomp</span>”</span> distribution |
1469 | sets are required, too.</p> | | 1467 | sets are required, too.</p> |
1470 | </div> | | 1468 | </div> |
1471 | <div class="sect2"> | | 1469 | <div class="sect2"> |
1472 | <div class="titlepage"><div><div><h3 class="title"> | | 1470 | <div class="titlepage"><div><div><h3 class="title"> |
1473 | <a name="fetching-distfiles"></a>5.2.2. Fetching distfiles</h3></div></div></div> | | 1471 | <a name="fetching-distfiles"></a>5.2.2. Fetching distfiles</h3></div></div></div> |
1474 | <p>The first step for building a package is downloading the | | 1472 | <p>The first step for building a package is downloading the |
1475 | distfiles (i.e. the unmodified source). If they have not yet been | | 1473 | distfiles (i.e. the unmodified source). If they have not yet been |
1476 | downloaded, pkgsrc will fetch them automatically.</p> | | 1474 | downloaded, pkgsrc will fetch them automatically.</p> |
1477 | <p>If you have all files that you need in the | | 1475 | <p>If you have all files that you need in the |
1478 | <code class="filename">distfiles</code> directory, | | 1476 | <code class="filename">distfiles</code> directory, |
1479 | you don't need to connect. If the distfiles are on CD-ROM, you can | | 1477 | you don't need to connect. If the distfiles are on CD-ROM, you can |
1480 | mount the CD-ROM on <code class="filename">/cdrom</code> and add: | | 1478 | mount the CD-ROM on <code class="filename">/cdrom</code> and add: |
1481 | </p> | | 1479 | </p> |
1482 | <pre class="screen">DISTDIR=/cdrom/pkgsrc/distfiles</pre> | | 1480 | <pre class="screen">DISTDIR=/cdrom/pkgsrc/distfiles</pre> |
1483 | <p> | | 1481 | <p> |
1484 | to your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 1482 | to your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
1485 | <p>By default a list of distribution sites will be randomly | | 1483 | <p>By default a list of distribution sites will be randomly |
1486 | intermixed to prevent huge load on servers which holding popular | | 1484 | intermixed to prevent huge load on servers which holding popular |
1487 | packages (for example, SourceForge.net mirrors). Thus, every | | 1485 | packages (for example, SourceForge.net mirrors). Thus, every |
1488 | time when you need to fetch yet another distfile all the mirrors | | 1486 | time when you need to fetch yet another distfile all the mirrors |
1489 | will be tried in new (random) order. You can turn this feature | | 1487 | will be tried in new (random) order. You can turn this feature |
1490 | off by setting <code class="varname">MASTER_SORT_RANDOM=NO</code> (for | | 1488 | off by setting <code class="varname">MASTER_SORT_RANDOM=NO</code> (for |
1491 | <code class="varname">PKG_DEVELOPER</code>s it's already disabled).</p> | | 1489 | <code class="varname">PKG_DEVELOPER</code>s it's already disabled).</p> |
1492 | <p>You can overwrite some of the major distribution sites to | | 1490 | <p>You can overwrite some of the major distribution sites to |
1493 | fit to sites that are close to your own. By setting one or two | | 1491 | fit to sites that are close to your own. By setting one or two |
1494 | variables you can modify the order in which the master sites are | | 1492 | variables you can modify the order in which the master sites are |
1495 | accessed. <code class="varname">MASTER_SORT</code> contains a whitespace | | 1493 | accessed. <code class="varname">MASTER_SORT</code> contains a whitespace |
1496 | delimited list of domain suffixes. | | 1494 | delimited list of domain suffixes. |
1497 | <code class="varname">MASTER_SORT_REGEX</code> is even more flexible, it | | 1495 | <code class="varname">MASTER_SORT_REGEX</code> is even more flexible, it |
1498 | contains a whitespace delimited list of regular expressions. It | | 1496 | contains a whitespace delimited list of regular expressions. It |
1499 | has higher priority than <code class="varname">MASTER_SORT</code>. Have a | | 1497 | has higher priority than <code class="varname">MASTER_SORT</code>. Have a |
1500 | look at <code class="filename">pkgsrc/mk/defaults/mk.conf</code> to find | | 1498 | look at <code class="filename">pkgsrc/mk/defaults/mk.conf</code> to find |
1501 | some examples. This may save some of your bandwidth and | | 1499 | some examples. This may save some of your bandwidth and |
1502 | time.</p> | | 1500 | time.</p> |
1503 | <p>You can change these settings either in your shell's environment, or, | | 1501 | <p>You can change these settings either in your shell's environment, or, |
1504 | if you want to keep the settings, by editing the | | 1502 | if you want to keep the settings, by editing the |
1505 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file, | | 1503 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file, |
1506 | and adding the definitions there.</p> | | 1504 | and adding the definitions there.</p> |
1507 | <p> | | 1505 | <p> |
1508 | If a package depends on many other packages (such as | | 1506 | If a package depends on many other packages (such as |
1509 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/kde4/README.html" target="_top"><code class="filename">meta-pkgs/kde4</code></a>), the build process may | | 1507 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/kde4/README.html" target="_top"><code class="filename">meta-pkgs/kde4</code></a>), the build process may |
1510 | alternate between periods of | | 1508 | alternate between periods of |
1511 | downloading source, and compiling. To ensure you have all the source | | 1509 | downloading source, and compiling. To ensure you have all the source |
1512 | downloaded initially you can run the command: | | 1510 | downloaded initially you can run the command: |
1513 | </p> | | 1511 | </p> |
1514 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make fetch-list | sh</code></strong></pre> | | 1512 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make fetch-list | sh</code></strong></pre> |
1515 | <p> | | 1513 | <p> |
1516 | which will output and run a set of shell commands to fetch the | | 1514 | which will output and run a set of shell commands to fetch the |
1517 | necessary files into the <code class="filename">distfiles</code> directory. You can | | 1515 | necessary files into the <code class="filename">distfiles</code> directory. You can |
1518 | also choose to download the files manually. | | 1516 | also choose to download the files manually. |
1519 | </p> | | 1517 | </p> |
1520 | </div> | | 1518 | </div> |
1521 | <div class="sect2"> | | 1519 | <div class="sect2"> |
1522 | <div class="titlepage"><div><div><h3 class="title"> | | 1520 | <div class="titlepage"><div><div><h3 class="title"> |
1523 | <a name="how-to-build-and-install"></a>5.2.3. How to build and install</h3></div></div></div> | | 1521 | <a name="how-to-build-and-install"></a>5.2.3. How to build and install</h3></div></div></div> |
1524 | <p> | | 1522 | <p> |
1525 | Once the software has downloaded, any patches will be applied, then it | | 1523 | Once the software has downloaded, any patches will be applied, then it |
1526 | will be compiled for you. This may take some time depending on your | | 1524 | will be compiled for you. This may take some time depending on your |
1527 | computer, and how many other packages the software depends on and their | | 1525 | computer, and how many other packages the software depends on and their |
1528 | compile time. | | 1526 | compile time. |
1529 | </p> | | 1527 | </p> |
1530 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 1528 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
1531 | <h3 class="title">Note</h3> | | 1529 | <h3 class="title">Note</h3> |
1532 | <p>If using bootstrap or pkgsrc on a non-NetBSD system, | | 1530 | <p>If using bootstrap or pkgsrc on a non-NetBSD system, |
1533 | use the pkgsrc <span class="command"><strong>bmake</strong></span> command instead of | | 1531 | use the pkgsrc <span class="command"><strong>bmake</strong></span> command instead of |
1534 | <span class="quote">“<span class="quote">make</span>”</span> in the examples in this guide.</p> | | 1532 | <span class="quote">“<span class="quote">make</span>”</span> in the examples in this guide.</p> |
1535 | </div> | | 1533 | </div> |
1536 | <p>For example, type</p> | | 1534 | <p>For example, type</p> |
1537 | <pre class="screen"> | | 1535 | <pre class="screen"> |
1538 | <code class="prompt">%</code> <strong class="userinput"><code>cd misc/figlet</code></strong> | | 1536 | <code class="prompt">%</code> <strong class="userinput"><code>cd misc/figlet</code></strong> |
1539 | <code class="prompt">%</code> <strong class="userinput"><code>make</code></strong> | | 1537 | <code class="prompt">%</code> <strong class="userinput"><code>make</code></strong> |
1540 | </pre> | | 1538 | </pre> |
1541 | <p>at the shell prompt to build the various components of the | | 1539 | <p>at the shell prompt to build the various components of the |
1542 | package.</p> | | 1540 | package.</p> |
1543 | <p>The next stage is to actually install the newly compiled | | 1541 | <p>The next stage is to actually install the newly compiled |
1544 | program onto your system. Do this by entering: | | 1542 | program onto your system. Do this by entering: |
1545 | | | 1543 | |
1546 | </p> | | 1544 | </p> |
1547 | <pre class="screen"> | | 1545 | <pre class="screen"> |
1548 | <code class="prompt">%</code> <strong class="userinput"><code>make install</code></strong> | | 1546 | <code class="prompt">%</code> <strong class="userinput"><code>make install</code></strong> |
1549 | </pre> | | 1547 | </pre> |
1550 | <p> | | 1548 | <p> |
1551 | | | 1549 | |
1552 | while you are still in the directory for whatever package you | | 1550 | while you are still in the directory for whatever package you |
1553 | are installing.</p> | | 1551 | are installing.</p> |
1554 | <p>Installing the package on your system may require you to | | 1552 | <p>Installing the package on your system may require you to |
1555 | be root. However, pkgsrc has a | | 1553 | be root. However, pkgsrc has a |
1556 | <span class="emphasis"><em>just-in-time-su</em></span> feature, which allows you | | 1554 | <span class="emphasis"><em>just-in-time-su</em></span> feature, which allows you |
1557 | to only become root for the actual installation step.</p> | | 1555 | to only become root for the actual installation step.</p> |
1558 | <p>That's it, the software should now be installed and setup for use. | | 1556 | <p>That's it, the software should now be installed and setup for use. |
1559 | You can now enter: | | 1557 | You can now enter: |
1560 | | | 1558 | |
1561 | </p> | | 1559 | </p> |
1562 | <pre class="screen"> | | 1560 | <pre class="screen"> |
1563 | <code class="prompt">%</code> <strong class="userinput"><code>make clean</code></strong> | | 1561 | <code class="prompt">%</code> <strong class="userinput"><code>make clean</code></strong> |
1564 | </pre> | | 1562 | </pre> |
1565 | <p> | | 1563 | <p> |
1566 | | | 1564 | |
1567 | to remove the compiled files in the work directory, as you shouldn't need | | 1565 | to remove the compiled files in the work directory, as you shouldn't need |
1568 | them any more. If other packages were also added to your system | | 1566 | them any more. If other packages were also added to your system |
1569 | (dependencies) to allow your program to compile, you can tidy these up | | 1567 | (dependencies) to allow your program to compile, you can tidy these up |
1570 | also with the command:</p> | | 1568 | also with the command:</p> |
1571 | <pre class="screen"> | | 1569 | <pre class="screen"> |
1572 | <code class="prompt">%</code> <strong class="userinput"><code>make clean-depends</code></strong> | | 1570 | <code class="prompt">%</code> <strong class="userinput"><code>make clean-depends</code></strong> |
1573 | </pre> | | 1571 | </pre> |
1574 | <p>Taking the figlet utility as an example, we can install it on our | | 1572 | <p>Taking the figlet utility as an example, we can install it on our |
1575 | system by building as shown in <a class="xref" href="#logs" title="Appendix B. Build logs">Appendix B, <i>Build logs</i></a>.</p> | | 1573 | system by building as shown in <a class="xref" href="#logs" title="Appendix B. Build logs">Appendix B, <i>Build logs</i></a>.</p> |
1576 | <p>The program is installed under the default root of the | | 1574 | <p>The program is installed under the default root of the |
1577 | packages tree - <code class="filename">/usr/pkg</code>. Should this not | | 1575 | packages tree - <code class="filename">/usr/pkg</code>. Should this not |
1578 | conform to your tastes, set the <code class="varname">LOCALBASE</code> | | 1576 | conform to your tastes, set the <code class="varname">LOCALBASE</code> |
1579 | variable in your environment, and it will use that value as the | | 1577 | variable in your environment, and it will use that value as the |
1580 | root of your packages tree. So, to use | | 1578 | root of your packages tree. So, to use |
1581 | <code class="filename">/usr/local</code>, set | | 1579 | <code class="filename">/usr/local</code>, set |
1582 | <code class="varname">LOCALBASE=/usr/local</code> in your environment. | | 1580 | <code class="varname">LOCALBASE=/usr/local</code> in your environment. |
1583 | Please note that you should use a directory which is dedicated to | | 1581 | Please note that you should use a directory which is dedicated to |
1584 | packages and not shared with other programs (i.e., do not try and | | 1582 | packages and not shared with other programs (i.e., do not try and |
1585 | use <code class="varname">LOCALBASE=/usr</code>). Also, you should not try | | 1583 | use <code class="varname">LOCALBASE=/usr</code>). Also, you should not try |
1586 | to add any of your own files or directories (such as | | 1584 | to add any of your own files or directories (such as |
1587 | <code class="filename">src/</code>, <code class="filename">obj/</code>, or | | 1585 | <code class="filename">src/</code>, <code class="filename">obj/</code>, or |
1588 | <code class="filename">pkgsrc/</code>) below the | | 1586 | <code class="filename">pkgsrc/</code>) below the |
1589 | <code class="varname">LOCALBASE</code> tree. This is to prevent possible | | 1587 | <code class="varname">LOCALBASE</code> tree. This is to prevent possible |
1590 | conflicts between programs and other files installed by the | | 1588 | conflicts between programs and other files installed by the |
1591 | package system and whatever else may have been installed | | 1589 | package system and whatever else may have been installed |
1592 | there.</p> | | 1590 | there.</p> |
1593 | <p>Some packages look in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to | | 1591 | <p>Some packages look in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to |
1594 | alter some configuration options at build time. Have a look at | | 1592 | alter some configuration options at build time. Have a look at |
1595 | <code class="filename">pkgsrc/mk/defaults/mk.conf</code> to get an overview | | 1593 | <code class="filename">pkgsrc/mk/defaults/mk.conf</code> to get an overview |
1596 | of what will be set there by default. Environment variables such | | 1594 | of what will be set there by default. Environment variables such |
1597 | as <code class="varname">LOCALBASE</code> can be set in | | 1595 | as <code class="varname">LOCALBASE</code> can be set in |
1598 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to save having to remember to | | 1596 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to save having to remember to |
1599 | set them each time you want to use pkgsrc.</p> | | 1597 | set them each time you want to use pkgsrc.</p> |
1600 | <p>Occasionally, people want to <span class="quote">“<span class="quote">look under the | | 1598 | <p>Occasionally, people want to <span class="quote">“<span class="quote">look under the |
1601 | covers</span>”</span> to see what is going on when a package is building | | 1599 | covers</span>”</span> to see what is going on when a package is building |
1602 | or being installed. This may be for debugging purposes, or out of | | 1600 | or being installed. This may be for debugging purposes, or out of |
1603 | simple curiosity. A number of utility values have been added to | | 1601 | simple curiosity. A number of utility values have been added to |
1604 | help with this.</p> | | 1602 | help with this.</p> |
1605 | <div class="orderedlist"><ol class="orderedlist" type="1"> | | 1603 | <div class="orderedlist"><ol class="orderedlist" type="1"> |
1606 | <li class="listitem"> | | 1604 | <li class="listitem"> |
1607 | <p>If you invoke the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> command with | | 1605 | <p>If you invoke the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> command with |
1608 | <code class="varname">PKG_DEBUG_LEVEL=2</code>, then a huge amount of | | 1606 | <code class="varname">PKG_DEBUG_LEVEL=2</code>, then a huge amount of |
1609 | information will be displayed. For example,</p> | | 1607 | information will be displayed. For example,</p> |
1610 | <pre class="screen"><strong class="userinput"><code>make patch PKG_DEBUG_LEVEL=2</code></strong></pre> | | 1608 | <pre class="screen"><strong class="userinput"><code>make patch PKG_DEBUG_LEVEL=2</code></strong></pre> |
1611 | <p>will show all the commands that are invoked, up to and | | 1609 | <p>will show all the commands that are invoked, up to and |
1612 | including the <span class="quote">“<span class="quote">patch</span>”</span> stage.</p> | | 1610 | including the <span class="quote">“<span class="quote">patch</span>”</span> stage.</p> |
1613 | </li> | | 1611 | </li> |
1614 | <li class="listitem"> | | 1612 | <li class="listitem"> |
1615 | <p>If you want to know the value of a certain <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> | | 1613 | <p>If you want to know the value of a certain <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> |
1616 | definition, then the <code class="varname">VARNAME</code> definition | | 1614 | definition, then the <code class="varname">VARNAME</code> definition |
1617 | should be used, in conjunction with the show-var | | 1615 | should be used, in conjunction with the show-var |
1618 | target. e.g. to show the expansion of the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> | | 1616 | target. e.g. to show the expansion of the <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> |
1619 | variable <code class="varname">LOCALBASE</code>:</p> | | 1617 | variable <code class="varname">LOCALBASE</code>:</p> |
1620 | <pre class="screen"> | | 1618 | <pre class="screen"> |
1621 | <code class="prompt">%</code> <strong class="userinput"><code>make show-var VARNAME=LOCALBASE</code></strong> | | 1619 | <code class="prompt">%</code> <strong class="userinput"><code>make show-var VARNAME=LOCALBASE</code></strong> |
1622 | /usr/pkg | | 1620 | /usr/pkg |
1623 | <code class="prompt">%</code> | | 1621 | <code class="prompt">%</code> |
1624 | </pre> | | 1622 | </pre> |
1625 | </li> | | 1623 | </li> |
1626 | </ol></div> | | 1624 | </ol></div> |
1627 | <p>If you want to install a binary package that you've either | | 1625 | <p>If you want to install a binary package that you've either |
1628 | created yourself (see next section), that you put into | | 1626 | created yourself (see next section), that you put into |
1629 | pkgsrc/packages manually or that is located on a remote FTP | | 1627 | pkgsrc/packages manually or that is located on a remote FTP |
1630 | server, you can use the "bin-install" target. This target will | | 1628 | server, you can use the "bin-install" target. This target will |
1631 | install a binary package - if available - via <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a>, | | 1629 | install a binary package - if available - via <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a>, |
1632 | else do a <span class="command"><strong>make package</strong></span>. The list of remote FTP | | 1630 | else do a <span class="command"><strong>make package</strong></span>. The list of remote FTP |
1633 | sites searched is kept in the variable | | 1631 | sites searched is kept in the variable |
1634 | <code class="varname">BINPKG_SITES</code>, which defaults to | | 1632 | <code class="varname">BINPKG_SITES</code>, which defaults to |
1635 | ftp.NetBSD.org. Any flags that should be added to <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a> | | 1633 | ftp.NetBSD.org. Any flags that should be added to <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a> |
1636 | can be put into <code class="varname">BIN_INSTALL_FLAGS</code>. See | | 1634 | can be put into <code class="varname">BIN_INSTALL_FLAGS</code>. See |
1637 | <code class="filename">pkgsrc/mk/defaults/mk.conf</code> for more | | 1635 | <code class="filename">pkgsrc/mk/defaults/mk.conf</code> for more |
1638 | details.</p> | | 1636 | details.</p> |
1639 | <p>A final word of warning: If you set up a system that has a | | 1637 | <p>A final word of warning: If you set up a system that has a |
1640 | non-standard setting for <code class="varname">LOCALBASE</code>, be sure to | | 1638 | non-standard setting for <code class="varname">LOCALBASE</code>, be sure to |
1641 | set that before any packages are installed, as you cannot use | | 1639 | set that before any packages are installed, as you cannot use |
1642 | several directories for the same purpose. Doing so will result in | | 1640 | several directories for the same purpose. Doing so will result in |
1643 | pkgsrc not being able to properly detect your installed packages, | | 1641 | pkgsrc not being able to properly detect your installed packages, |
1644 | and fail miserably. Note also that precompiled binary packages are | | 1642 | and fail miserably. Note also that precompiled binary packages are |
1645 | usually built with the default <code class="varname">LOCALBASE</code> of | | 1643 | usually built with the default <code class="varname">LOCALBASE</code> of |
1646 | <code class="filename">/usr/pkg</code>, and that you should | | 1644 | <code class="filename">/usr/pkg</code>, and that you should |
1647 | <span class="emphasis"><em>not</em></span> install any if you use a non-standard | | 1645 | <span class="emphasis"><em>not</em></span> install any if you use a non-standard |
1648 | <code class="varname">LOCALBASE</code>.</p> | | 1646 | <code class="varname">LOCALBASE</code>.</p> |
1649 | </div> | | 1647 | </div> |
1650 | </div> | | 1648 | </div> |
1651 | </div> | | 1649 | </div> |
1652 | <div class="chapter"> | | 1650 | <div class="chapter"> |
1653 | <div class="titlepage"><div><div><h2 class="title"> | | 1651 | <div class="titlepage"><div><div><h2 class="title"> |
1654 | <a name="configuring"></a>Chapter 6. Configuring pkgsrc</h2></div></div></div> | | 1652 | <a name="configuring"></a>Chapter 6. Configuring pkgsrc</h2></div></div></div> |
1655 | <div class="toc"> | | 1653 | <div class="toc"> |
1656 | <p><b>Table of Contents</b></p> | | 1654 | <p><b>Table of Contents</b></p> |
1657 | <dl class="toc"> | | 1655 | <dl class="toc"> |
1658 | <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt> | | 1656 | <dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt> |
1659 | <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt> | | 1657 | <dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt> |
1660 | <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt> | | 1658 | <dt><span class="sect1"><a href="#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt> |
1661 | <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt> | | 1659 | <dt><span class="sect1"><a href="#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt> |
1662 | <dd><dl> | | 1660 | <dd><dl> |
1663 | <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt> | | 1661 | <dt><span class="sect2"><a href="#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt> |
1664 | <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt> | | 1662 | <dt><span class="sect2"><a href="#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt> |
1665 | <dt><span class="sect2"><a href="#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt> | | 1663 | <dt><span class="sect2"><a href="#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt> |
1666 | </dl></dd> | | 1664 | </dl></dd> |
1667 | <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt> | | 1665 | <dt><span class="sect1"><a href="#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt> |
1668 | <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt> | | 1666 | <dt><span class="sect1"><a href="#selecting-build-options">6.6. Selecting Build Options</a></span></dt> |
1669 | </dl> | | 1667 | </dl> |
1670 | </div> | | 1668 | </div> |
1671 | <a name="mk.conf"></a><p>The whole pkgsrc system is configured in a single file, usually | | 1669 | <a name="mk.conf"></a><p>The whole pkgsrc system is configured in a single file, usually |
1672 | called <code class="filename">mk.conf</code>. In which directory pkgsrc looks for | | 1670 | called <code class="filename">mk.conf</code>. In which directory pkgsrc looks for |
1673 | that file depends on the installation. On NetBSD, when you use | | 1671 | that file depends on the installation. On NetBSD, when you use |
1674 | <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> from the base system, it is in the directory | | 1672 | <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> from the base system, it is in the directory |
1675 | <code class="filename">/etc/</code>. In all other cases the default location is | | 1673 | <code class="filename">/etc/</code>. In all other cases the default location is |
1676 | <code class="literal">${PREFIX}/etc/</code>, depending on where you told the | | 1674 | <code class="literal">${PREFIX}/etc/</code>, depending on where you told the |
1677 | bootstrap program to install the binary packages.</p> | | 1675 | bootstrap program to install the binary packages.</p> |
1678 | <p>The format of the configuration file is that of the usual | | 1676 | <p>The format of the configuration file is that of the usual |
1679 | BSD-style <code class="filename">Makefile</code>s. The whole pkgsrc configuration | | 1677 | BSD-style <code class="filename">Makefile</code>s. The whole pkgsrc configuration |
1680 | is done by setting variables in this file. Note that you can define all | | 1678 | is done by setting variables in this file. Note that you can define all |
1681 | kinds of variables, and no special error checking (for example for | | 1679 | kinds of variables, and no special error checking (for example for |
1682 | spelling mistakes) takes place.</p> | | 1680 | spelling mistakes) takes place.</p> |
1683 | <div class="sect1"> | | 1681 | <div class="sect1"> |
1684 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1682 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1685 | <a name="general-configuration"></a>6.1. General configuration</h2></div></div></div> | | 1683 | <a name="general-configuration"></a>6.1. General configuration</h2></div></div></div> |
1686 | <p>The following variables apply to all | | 1684 | <p>The following variables apply to all |
1687 | pkgsrc packages. A complete list of the variables that can be | | 1685 | pkgsrc packages. A complete list of the variables that can be |
1688 | configured by the user is available in | | 1686 | configured by the user is available in |
1689 | <code class="filename">mk/defaults/mk.conf</code>, together with some | | 1687 | <code class="filename">mk/defaults/mk.conf</code>, together with some |
1690 | comments that describe each variable's intent.</p> | | 1688 | comments that describe each variable's intent.</p> |
1691 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 1689 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
1692 | <li class="listitem"><p><code class="varname">LOCALBASE</code>: Where | | 1690 | <li class="listitem"><p><code class="varname">LOCALBASE</code>: Where |
1693 | packages will be installed. The default is | | 1691 | packages will be installed. The default is |
1694 | <code class="filename">/usr/pkg</code>. Do not mix binary packages | | 1692 | <code class="filename">/usr/pkg</code>. Do not mix binary packages |
1695 | with different <code class="varname">LOCALBASE</code>s!</p></li> | | 1693 | with different <code class="varname">LOCALBASE</code>s!</p></li> |
1696 | <li class="listitem"><p><code class="varname">CROSSBASE</code>: Where | | 1694 | <li class="listitem"><p><code class="varname">CROSSBASE</code>: Where |
1697 | <span class="quote">“<span class="quote">cross</span>”</span> category packages will be | | 1695 | <span class="quote">“<span class="quote">cross</span>”</span> category packages will be |
1698 | installed. The default is | | 1696 | installed. The default is |
1699 | <code class="filename">${LOCALBASE}/cross</code>.</p></li> | | 1697 | <code class="filename">${LOCALBASE}/cross</code>.</p></li> |
1700 | <li class="listitem"><p><code class="varname">X11BASE</code>: Where | | 1698 | <li class="listitem"><p><code class="varname">X11BASE</code>: Where |
1701 | X11 is installed on the system. The default is | | 1699 | X11 is installed on the system. The default is |
1702 | <code class="filename">/usr/X11R7</code>.</p></li> | | 1700 | <code class="filename">/usr/X11R7</code>.</p></li> |
1703 | <li class="listitem"><p><code class="varname">DISTDIR</code>: Where to store the | | 1701 | <li class="listitem"><p><code class="varname">DISTDIR</code>: Where to store the |
1704 | downloaded copies of the original source distributions used | | 1702 | downloaded copies of the original source distributions used |
1705 | for building pkgsrc packages. The default is | | 1703 | for building pkgsrc packages. The default is |
1706 | <code class="filename">${PKGSRCDIR}/distfiles</code>.</p></li> | | 1704 | <code class="filename">${PKGSRCDIR}/distfiles</code>.</p></li> |
1707 | <li class="listitem"><p><code class="varname">PKG_DBDIR</code>: Where the | | 1705 | <li class="listitem"><p><code class="varname">PKG_DBDIR</code>: Where the |
1708 | database about installed packages is stored. The default is | | 1706 | database about installed packages is stored. The default is |
1709 | <code class="filename">/usr/pkg/pkgdb</code>.</p></li> | | 1707 | <code class="filename">/usr/pkg/pkgdb</code>.</p></li> |
1710 | <li class="listitem"><p><code class="varname">MASTER_SITE_OVERRIDE</code>: | | 1708 | <li class="listitem"><p><code class="varname">MASTER_SITE_OVERRIDE</code>: |
1711 | If set, override the packages' | | 1709 | If set, override the packages' |
1712 | <code class="varname">MASTER_SITES</code> with this value.</p></li> | | 1710 | <code class="varname">MASTER_SITES</code> with this value.</p></li> |
1713 | <li class="listitem"><p><code class="varname">MASTER_SITE_BACKUP</code>: | | 1711 | <li class="listitem"><p><code class="varname">MASTER_SITE_BACKUP</code>: |
1714 | Backup location(s) for distribution files and patch files | | 1712 | Backup location(s) for distribution files and patch files |
1715 | if not found locally or in | | 1713 | if not found locally or in |
1716 | <code class="filename">${MASTER_SITES}</code> or | | 1714 | <code class="filename">${MASTER_SITES}</code> or |
1717 | <code class="filename">${PATCH_SITES}</code> respectively. | | 1715 | <code class="filename">${PATCH_SITES}</code> respectively. |
1718 | The defaults is | | 1716 | The defaults is |
1719 | <code class="filename">ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/${DIST_SUBDIR}/</code>.</p></li> | | 1717 | <code class="filename">ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/${DIST_SUBDIR}/</code>.</p></li> |
1720 | <li class="listitem"><p><code class="varname">BINPKG_SITES</code>: | | 1718 | <li class="listitem"><p><code class="varname">BINPKG_SITES</code>: |
1721 | List of sites carrying binary pkgs. <em class="replaceable"><code>rel</code></em> and | | 1719 | List of sites carrying binary pkgs. <em class="replaceable"><code>rel</code></em> and |
1722 | <em class="replaceable"><code>arch</code></em> are replaced with OS | | 1720 | <em class="replaceable"><code>arch</code></em> are replaced with OS |
1723 | release (<span class="quote">“<span class="quote">2.0</span>”</span>, etc.) and architecture | | 1721 | release (<span class="quote">“<span class="quote">2.0</span>”</span>, etc.) and architecture |
1724 | (<span class="quote">“<span class="quote">mipsel</span>”</span>, etc.).</p></li> | | 1722 | (<span class="quote">“<span class="quote">mipsel</span>”</span>, etc.).</p></li> |
1725 | <li class="listitem"><p><code class="varname">ACCEPTABLE_LICENSES</code>: | | 1723 | <li class="listitem"><p><code class="varname">ACCEPTABLE_LICENSES</code>: |
1726 | List of acceptable licenses. License names are case-sensitive. | | 1724 | List of acceptable licenses. License names are case-sensitive. |
1727 | Whenever you try to build a package whose license is not in this | | 1725 | Whenever you try to build a package whose license is not in this |
1728 | list, you will get an error message. If the license condition is | | 1726 | list, you will get an error message. If the license condition is |
1729 | simple enough, the error message will include specific | | 1727 | simple enough, the error message will include specific |
1730 | instructions on how to change this variable.</p></li> | | 1728 | instructions on how to change this variable.</p></li> |
1731 | </ul></div> | | 1729 | </ul></div> |
1732 | </div> | | 1730 | </div> |
1733 | <div class="sect1"> | | 1731 | <div class="sect1"> |
1734 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1732 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1735 | <a name="variables-affecting-build"></a>6.2. Variables affecting the build process</h2></div></div></div> | | 1733 | <a name="variables-affecting-build"></a>6.2. Variables affecting the build process</h2></div></div></div> |
1736 | <p> | | 1734 | <p> |
1737 | </p> | | 1735 | </p> |
1738 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 1736 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
1739 | <li class="listitem"><p><code class="varname">PACKAGES</code>: The top level | | 1737 | <li class="listitem"><p><code class="varname">PACKAGES</code>: The top level |
1740 | directory for the binary packages. The default is | | 1738 | directory for the binary packages. The default is |
1741 | <code class="filename">${PKGSRCDIR}/packages</code>.</p></li> | | 1739 | <code class="filename">${PKGSRCDIR}/packages</code>.</p></li> |
1742 | <li class="listitem"><p><code class="varname">WRKOBJDIR</code>: | | 1740 | <li class="listitem"><p><code class="varname">WRKOBJDIR</code>: |
1743 | The top level directory where, if defined, the separate | | 1741 | The top level directory where, if defined, the separate |
1744 | working directories will get created, and symbolically | | 1742 | working directories will get created, and symbolically |
1745 | linked to from <code class="filename">${WRKDIR}</code> (see below). | | 1743 | linked to from <code class="filename">${WRKDIR}</code> (see below). |
1746 | This is useful for building packages on several | | 1744 | This is useful for building packages on several |
1747 | architectures, then <code class="filename">${PKGSRCDIR}</code> | | 1745 | architectures, then <code class="filename">${PKGSRCDIR}</code> |
1748 | can be NFS-mounted while <code class="filename">${WRKOBJDIR}</code> | | 1746 | can be NFS-mounted while <code class="filename">${WRKOBJDIR}</code> |
1749 | is local to every architecture. (It should be noted that | | 1747 | is local to every architecture. (It should be noted that |
1750 | <code class="varname">PKGSRCDIR</code> should not be set by the user | | 1748 | <code class="varname">PKGSRCDIR</code> should not be set by the user |
1751 | — it is an internal definition which refers to the | | 1749 | — it is an internal definition which refers to the |
1752 | root of the pkgsrc tree. It is possible to have many | | 1750 | root of the pkgsrc tree. It is possible to have many |
1753 | pkgsrc tree instances.)</p></li> | | 1751 | pkgsrc tree instances.)</p></li> |
1754 | <li class="listitem"><p><code class="varname">LOCALPATCHES</code>: | | 1752 | <li class="listitem"><p><code class="varname">LOCALPATCHES</code>: |
1755 | Directory for local patches that aren't part of pkgsrc. | | 1753 | Directory for local patches that aren't part of pkgsrc. |
1756 | See <a class="xref" href="#components.patches" title="13.3. patches/*">Section 13.3, “<code class="filename">patches/*</code>”</a> for more | | 1754 | See <a class="xref" href="#components.patches" title="13.3. patches/*">Section 13.3, “<code class="filename">patches/*</code>”</a> for more |
1757 | information.</p></li> | | 1755 | information.</p></li> |
1758 | <li class="listitem"><p><code class="varname">PKGMAKECONF</code>: Location of | | 1756 | <li class="listitem"><p><code class="varname">PKGMAKECONF</code>: Location of |
1759 | the <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file used by a package's | | 1757 | the <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file used by a package's |
1760 | BSD-style Makefile. If this is not set, | | 1758 | BSD-style Makefile. If this is not set, |
1761 | <code class="varname">MAKECONF</code> is set to | | 1759 | <code class="varname">MAKECONF</code> is set to |
1762 | <code class="filename">/dev/null</code> to avoid picking up | | 1760 | <code class="filename">/dev/null</code> to avoid picking up |
1763 | settings used by builds in <code class="filename">/usr/src</code>.</p></li> | | 1761 | settings used by builds in <code class="filename">/usr/src</code>.</p></li> |
1764 | </ul></div> | | 1762 | </ul></div> |
1765 | </div> | | 1763 | </div> |
1766 | <div class="sect1"> | | 1764 | <div class="sect1"> |
1767 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1765 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1768 | <a name="variables-affecting-installation"></a>6.3. Variables affecting the installation process</h2></div></div></div> | | 1766 | <a name="variables-affecting-installation"></a>6.3. Variables affecting the installation process</h2></div></div></div> |
1769 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="varname">PKGSRC_KEEP_BIN_PKGSRC</code>: | | 1767 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="varname">PKGSRC_KEEP_BIN_PKGSRC</code>: |
1770 | By default, binary packages of built packages are | | 1768 | By default, binary packages of built packages are |
1771 | preserved in <code class="filename">${PACKAGES}/All</code>. Setting | | 1769 | preserved in <code class="filename">${PACKAGES}/All</code>. Setting |
1772 | this variable to "no" prevents this.</p></li></ul></div> | | 1770 | this variable to "no" prevents this.</p></li></ul></div> |
1773 | <p>Packages have to support installation into a | | 1771 | <p>Packages have to support installation into a |
1774 | subdirectory of <code class="varname">WRKDIR</code>. This allows a package | | 1772 | subdirectory of <code class="varname">WRKDIR</code>. This allows a package |
1775 | to be built, before the actual filesystem is touched. DESTDIR | | 1773 | to be built, before the actual filesystem is touched. DESTDIR |
1776 | support exists in two variations:</p> | | 1774 | support exists in two variations:</p> |
1777 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 1775 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
1778 | <li class="listitem"><p>Basic DESTDIR support means that the package | | 1776 | <li class="listitem"><p>Basic DESTDIR support means that the package |
1779 | installation and packaging is still run as root.</p></li> | | 1777 | installation and packaging is still run as root.</p></li> |
1780 | <li class="listitem"><p>Full DESTDIR support can run the complete | | 1778 | <li class="listitem"><p>Full DESTDIR support can run the complete |
1781 | build, installation and packaging as normal user. Root | | 1779 | build, installation and packaging as normal user. Root |
1782 | privileges are only needed to add packages.</p></li> | | 1780 | privileges are only needed to add packages.</p></li> |
1783 | </ul></div> | | 1781 | </ul></div> |
1784 | <p>With basic DESTDIR support, <strong class="userinput"><code>make | | 1782 | <p>With basic DESTDIR support, <strong class="userinput"><code>make |
1785 | clean</code></strong> needs to be run as root.</p> | | 1783 | clean</code></strong> needs to be run as root.</p> |
1786 | <p>Considering the <code class="filename">foo/bar</code> package, | | 1784 | <p>Considering the <code class="filename">foo/bar</code> package, |
1787 | DESTDIR full support can be tested using the following commands | | 1785 | DESTDIR full support can be tested using the following commands |
1788 | | | 1786 | |
1789 | </p> | | 1787 | </p> |
1790 | <pre class="programlisting"> | | 1788 | <pre class="programlisting"> |
1791 | <code class="prompt">$</code> id | | 1789 | <code class="prompt">$</code> id |
1792 | uid=1000(myusername) gid=100(users) groups=100(users),0(wheel) | | 1790 | uid=1000(myusername) gid=100(users) groups=100(users),0(wheel) |
1793 | <code class="prompt">$</code> mkdir $HOME/packages | | 1791 | <code class="prompt">$</code> mkdir $HOME/packages |
1794 | <code class="prompt">$</code> cd $PKGSRCDIR/foo/bar | | 1792 | <code class="prompt">$</code> cd $PKGSRCDIR/foo/bar |
1795 | </pre> | | 1793 | </pre> |
1796 | <p> | | 1794 | <p> |
1797 | | | 1795 | |
1798 | Verify <code class="varname">DESTDIR</code> full support, no root privileges | | 1796 | Verify <code class="varname">DESTDIR</code> full support, no root privileges |
1799 | should be needed | | 1797 | should be needed |
1800 | | | 1798 | |
1801 | </p> | | 1799 | </p> |
1802 | <pre class="programlisting"> | | 1800 | <pre class="programlisting"> |
1803 | <code class="prompt">$</code> make stage-install | | 1801 | <code class="prompt">$</code> make stage-install |
1804 | </pre> | | 1802 | </pre> |
1805 | <p> | | 1803 | <p> |
1806 | | | 1804 | |
1807 | Create a package without root privileges | | 1805 | Create a package without root privileges |
1808 | | | 1806 | |
1809 | </p> | | 1807 | </p> |
1810 | <pre class="programlisting"> | | 1808 | <pre class="programlisting"> |
1811 | <code class="prompt">$</code> make PACKAGES=$HOME/packages package | | 1809 | <code class="prompt">$</code> make PACKAGES=$HOME/packages package |
1812 | </pre> | | 1810 | </pre> |
1813 | <p> | | 1811 | <p> |
1814 | | | 1812 | |
1815 | For the following command, you must be able to gain root | | 1813 | For the following command, you must be able to gain root |
1816 | privileges using <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?su+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">su</span>(1)</span></a> | | 1814 | privileges using <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?su+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">su</span>(1)</span></a> |
1817 | | | 1815 | |
1818 | </p> | | 1816 | </p> |
1819 | <pre class="programlisting"> | | 1817 | <pre class="programlisting"> |
1820 | <code class="prompt">$</code> make PACKAGES=$HOME/packages install | | 1818 | <code class="prompt">$</code> make PACKAGES=$HOME/packages install |
1821 | </pre> | | 1819 | </pre> |
1822 | <p> | | 1820 | <p> |
1823 | | | 1821 | |
1824 | Then, as a simple user | | 1822 | Then, as a simple user |
1825 | | | 1823 | |
1826 | </p> | | 1824 | </p> |
1827 | <pre class="programlisting"> | | 1825 | <pre class="programlisting"> |
1828 | <code class="prompt">$</code> make clean | | 1826 | <code class="prompt">$</code> make clean |
1829 | </pre> | | 1827 | </pre> |
1830 | <p> | | 1828 | <p> |
1831 | | | 1829 | |
1832 | </p> | | 1830 | </p> |
1833 | </div> | | 1831 | </div> |
1834 | <div class="sect1"> | | 1832 | <div class="sect1"> |
1835 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1833 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1836 | <a name="conf.compiler"></a>6.4. Selecting and configuring the compiler</h2></div></div></div> | | 1834 | <a name="conf.compiler"></a>6.4. Selecting and configuring the compiler</h2></div></div></div> |
1837 | <div class="sect2"> | | 1835 | <div class="sect2"> |
1838 | <div class="titlepage"><div><div><h3 class="title"> | | 1836 | <div class="titlepage"><div><div><h3 class="title"> |
1839 | <a name="selecting-the-compiler"></a>6.4.1. Selecting the compiler</h3></div></div></div> | | 1837 | <a name="selecting-the-compiler"></a>6.4.1. Selecting the compiler</h3></div></div></div> |
1840 | <p>By default, pkgsrc will use GCC to build packages. This may be | | 1838 | <p>By default, pkgsrc will use GCC to build packages. This may be |
1841 | overridden by setting the following variables in /etc/mk.conf:</p> | | 1839 | overridden by setting the following variables in /etc/mk.conf:</p> |
1842 | <div class="variablelist"><dl class="variablelist"> | | 1840 | <div class="variablelist"><dl class="variablelist"> |
1843 | <dt><span class="term"><code class="varname">PKGSRC_COMPILER</code>:</span></dt> | | 1841 | <dt><span class="term"><code class="varname">PKGSRC_COMPILER</code>:</span></dt> |
1844 | <dd> | | 1842 | <dd> |
1845 | <p>This is a list of values specifying the chain of | | 1843 | <p>This is a list of values specifying the chain of |
1846 | compilers to invoke when building packages. Valid values | | 1844 | compilers to invoke when building packages. Valid values |
1847 | are:</p> | | 1845 | are:</p> |
1848 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 1846 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
1849 | <li class="listitem"><p><code class="varname">ccc</code>: | | 1847 | <li class="listitem"><p><code class="varname">ccc</code>: |
1850 | Compaq C Compilers (Tru64)</p></li> | | 1848 | Compaq C Compilers (Tru64)</p></li> |
1851 | <li class="listitem"><p><code class="varname">ccache</code>: | | 1849 | <li class="listitem"><p><code class="varname">ccache</code>: |
1852 | compiler cache (chainable)</p></li> | | 1850 | compiler cache (chainable)</p></li> |
1853 | <li class="listitem"><p><code class="varname">clang</code>: | | 1851 | <li class="listitem"><p><code class="varname">clang</code>: |
1854 | Clang C and Objective-C compiler</p></li> | | 1852 | Clang C and Objective-C compiler</p></li> |
1855 | <li class="listitem"><p><code class="varname">distcc</code>: | | 1853 | <li class="listitem"><p><code class="varname">distcc</code>: |
1856 | distributed C/C++ (chainable)</p></li> | | 1854 | distributed C/C++ (chainable)</p></li> |
1857 | <li class="listitem"><p><code class="varname">f2c</code>: | | 1855 | <li class="listitem"><p><code class="varname">f2c</code>: |
1858 | Fortran 77 to C compiler (chainable)</p></li> | | 1856 | Fortran 77 to C compiler (chainable)</p></li> |
1859 | <li class="listitem"><p><code class="varname">icc</code>: | | 1857 | <li class="listitem"><p><code class="varname">icc</code>: |
1860 | Intel C++ Compiler (Linux)</p></li> | | 1858 | Intel C++ Compiler (Linux)</p></li> |
1861 | <li class="listitem"><p><code class="varname">ido</code>: | | 1859 | <li class="listitem"><p><code class="varname">ido</code>: |
1862 | SGI IRIS Development Option cc (IRIX 5)</p></li> | | 1860 | SGI IRIS Development Option cc (IRIX 5)</p></li> |
1863 | <li class="listitem"><p><code class="varname">gcc</code>: | | 1861 | <li class="listitem"><p><code class="varname">gcc</code>: |
1864 | GNU C/C++ Compiler</p></li> | | 1862 | GNU C/C++ Compiler</p></li> |
1865 | <li class="listitem"><p><code class="varname">hp</code>: | | 1863 | <li class="listitem"><p><code class="varname">hp</code>: |
1866 | HP-UX C/aC++ compilers</p></li> | | 1864 | HP-UX C/aC++ compilers</p></li> |
1867 | <li class="listitem"><p><code class="varname">mipspro</code>: | | 1865 | <li class="listitem"><p><code class="varname">mipspro</code>: |
1868 | Silicon Graphics, Inc. MIPSpro (n32/n64)</p></li> | | 1866 | Silicon Graphics, Inc. MIPSpro (n32/n64)</p></li> |
1869 | <li class="listitem"><p><code class="varname">mipspro-ucode</code>: | | 1867 | <li class="listitem"><p><code class="varname">mipspro-ucode</code>: |
1870 | Silicon Graphics, Inc. MIPSpro (o32)</p></li> | | 1868 | Silicon Graphics, Inc. MIPSpro (o32)</p></li> |
1871 | <li class="listitem"><p><code class="varname">sunpro</code>: | | 1869 | <li class="listitem"><p><code class="varname">sunpro</code>: |
1872 | Sun Microsystems, Inc. WorkShip/Forte/Sun ONE Studio</p></li> | | 1870 | Sun Microsystems, Inc. WorkShip/Forte/Sun ONE Studio</p></li> |
1873 | <li class="listitem"><p><code class="varname">xlc</code>: | | 1871 | <li class="listitem"><p><code class="varname">xlc</code>: |
1874 | IBM's XL C/C++ compiler suite</p></li> | | 1872 | IBM's XL C/C++ compiler suite</p></li> |
1875 | </ul></div> | | 1873 | </ul></div> |
1876 | <p>The default is | | 1874 | <p>The default is |
1877 | <span class="quote">“<span class="quote"><code class="varname">gcc</code></span>”</span>. You can use | | 1875 | <span class="quote">“<span class="quote"><code class="varname">gcc</code></span>”</span>. You can use |
1878 | <code class="varname">ccache</code> and/or | | 1876 | <code class="varname">ccache</code> and/or |
1879 | <code class="varname">distcc</code> with an appropriate | | 1877 | <code class="varname">distcc</code> with an appropriate |
1880 | <code class="varname">PKGSRC_COMPILER</code> setting, | | 1878 | <code class="varname">PKGSRC_COMPILER</code> setting, |
1881 | e.g. <span class="quote">“<span class="quote"><code class="varname">ccache gcc</code></span>”</span>. This | | 1879 | e.g. <span class="quote">“<span class="quote"><code class="varname">ccache gcc</code></span>”</span>. This |
1882 | variable should always be terminated with a value for | | 1880 | variable should always be terminated with a value for |
1883 | a real compiler. Note that only one real compiler | | 1881 | a real compiler. Note that only one real compiler |
1884 | should be listed (e.g. <span class="quote">“<span class="quote"><code class="varname">sunpro gcc</code></span>”</span> | | 1882 | should be listed (e.g. <span class="quote">“<span class="quote"><code class="varname">sunpro gcc</code></span>”</span> |
1885 | is not allowed).</p> | | 1883 | is not allowed).</p> |
1886 | </dd> | | 1884 | </dd> |
1887 | <dt><span class="term"><code class="varname">GCC_REQD</code>:</span></dt> | | 1885 | <dt><span class="term"><code class="varname">GCC_REQD</code>:</span></dt> |
1888 | <dd><p>This specifies the minimum version of GCC to use | | 1886 | <dd><p>This specifies the minimum version of GCC to use |
1889 | when building packages. If the system GCC doesn't | | 1887 | when building packages. If the system GCC doesn't |
1890 | satisfy this requirement, then pkgsrc will build and | | 1888 | satisfy this requirement, then pkgsrc will build and |
1891 | install one of the GCC packages to use instead.</p></dd> | | 1889 | install one of the GCC packages to use instead.</p></dd> |
1892 | <dt><span class="term"><code class="varname">PYTHON_VERSION_DEFAULT</code>:</span></dt> | | 1890 | <dt><span class="term"><code class="varname">PYTHON_VERSION_DEFAULT</code>:</span></dt> |
1893 | <dd><p>Specifies which version of python to use when several | | 1891 | <dd><p>Specifies which version of python to use when several |
1894 | options are available.</p></dd> | | 1892 | options are available.</p></dd> |
1895 | <dt><span class="term"><code class="varname">PKGSRC_FORTRAN</code>:</span></dt> | | 1893 | <dt><span class="term"><code class="varname">PKGSRC_FORTRAN</code>:</span></dt> |
1896 | <dd><p>Specifies the Fortran compiler to use. | | 1894 | <dd><p>Specifies the Fortran compiler to use. |
1897 | The default is <code class="varname">gfortran</code>.</p></dd> | | 1895 | The default is <code class="varname">gfortran</code>.</p></dd> |
1898 | <dt><span class="term"><code class="varname">GFORTRAN_VERSION</code>:</span></dt> | | 1896 | <dt><span class="term"><code class="varname">GFORTRAN_VERSION</code>:</span></dt> |
1899 | <dd><p>If <code class="varname">PKGSRC_FORTRAN</code><code class="literal">=</code> | | 1897 | <dd><p>If <code class="varname">PKGSRC_FORTRAN</code><code class="literal">=</code> |
1900 | <code class="varname">gfortran</code> is used, this option specifies which | | 1898 | <code class="varname">gfortran</code> is used, this option specifies which |
1901 | version to use.</p></dd> | | 1899 | version to use.</p></dd> |
1902 | </dl></div> | | 1900 | </dl></div> |
1903 | </div> | | 1901 | </div> |
1904 | <div class="sect2"> | | 1902 | <div class="sect2"> |
1905 | <div class="titlepage"><div><div><h3 class="title"> | | 1903 | <div class="titlepage"><div><div><h3 class="title"> |
1906 | <a name="conf.cflags"></a>6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</h3></div></div></div> | | 1904 | <a name="conf.cflags"></a>6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</h3></div></div></div> |
1907 | <p>If you wish to set the <code class="varname">CFLAGS</code> variable, | | 1905 | <p>If you wish to set the <code class="varname">CFLAGS</code> variable, |
1908 | please make sure to use the <code class="literal">+=</code> operator | | 1906 | please make sure to use the <code class="literal">+=</code> operator |
1909 | instead of the <code class="literal">=</code> operator:</p> | | 1907 | instead of the <code class="literal">=</code> operator:</p> |
1910 | <pre class="programlisting"> | | 1908 | <pre class="programlisting"> |
1911 | CFLAGS+= -your -flags | | 1909 | CFLAGS+= -your -flags |
1912 | </pre> | | 1910 | </pre> |
1913 | <p>Using <code class="varname">CFLAGS=</code> (i.e. without the | | 1911 | <p>Using <code class="varname">CFLAGS=</code> (i.e. without the |
1914 | <span class="quote">“<span class="quote">+</span>”</span>) may lead to problems with packages that | | 1912 | <span class="quote">“<span class="quote">+</span>”</span>) may lead to problems with packages that |
1915 | need to add their own flags. You may want to take a look | | 1913 | need to add their own flags. You may want to take a look |
1916 | at the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/cpuflags/README.html" target="_top"><code class="filename">devel/cpuflags</code></a> | | 1914 | at the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/cpuflags/README.html" target="_top"><code class="filename">devel/cpuflags</code></a> |
1917 | package if you're interested in optimization specifically | | 1915 | package if you're interested in optimization specifically |
1918 | for the current CPU. </p> | | 1916 | for the current CPU. </p> |
1919 | </div> | | 1917 | </div> |
1920 | <div class="sect2"> | | 1918 | <div class="sect2"> |
1921 | <div class="titlepage"><div><div><h3 class="title"> | | 1919 | <div class="titlepage"><div><div><h3 class="title"> |
1922 | <a name="conf.ldflags"></a>6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</h3></div></div></div> | | 1920 | <a name="conf.ldflags"></a>6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</h3></div></div></div> |
1923 | <p>If you want to pass flags to the linker, both in the configure | | 1921 | <p>If you want to pass flags to the linker, both in the configure |
1924 | step and the build step, you can do this in two ways. Either set | | 1922 | step and the build step, you can do this in two ways. Either set |
1925 | <code class="varname">LDFLAGS</code> or <code class="varname">LIBS</code>. The difference | | 1923 | <code class="varname">LDFLAGS</code> or <code class="varname">LIBS</code>. The difference |
1926 | between the two is that <code class="varname">LIBS</code> will be appended to | | 1924 | between the two is that <code class="varname">LIBS</code> will be appended to |
1927 | the command line, while <code class="varname">LDFLAGS</code> come earlier. | | 1925 | the command line, while <code class="varname">LDFLAGS</code> come earlier. |
1928 | <code class="varname">LDFLAGS</code> is pre-loaded with rpath settings for ELF | | 1926 | <code class="varname">LDFLAGS</code> is pre-loaded with rpath settings for ELF |
1929 | machines depending on the setting of <code class="varname">USE_IMAKE</code> or | | 1927 | machines depending on the setting of <code class="varname">USE_IMAKE</code> or |
1930 | the inclusion of <code class="filename">mk/x11.buildlink3.mk</code>. As with | | 1928 | the inclusion of <code class="filename">mk/x11.buildlink3.mk</code>. As with |
1931 | <code class="varname">CFLAGS</code>, if you do not wish to override these | | 1929 | <code class="varname">CFLAGS</code>, if you do not wish to override these |
1932 | settings, use the <code class="literal">+=</code> operator:</p> | | 1930 | settings, use the <code class="literal">+=</code> operator:</p> |
1933 | <pre class="programlisting"> | | 1931 | <pre class="programlisting"> |
1934 | LDFLAGS+= -your -linkerflags | | 1932 | LDFLAGS+= -your -linkerflags |
1935 | </pre> | | 1933 | </pre> |
1936 | </div> | | 1934 | </div> |
1937 | </div> | | 1935 | </div> |
1938 | <div class="sect1"> | | 1936 | <div class="sect1"> |
1939 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1937 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1940 | <a name="developer-advanced-settings"></a>6.5. Developer/advanced settings</h2></div></div></div> | | 1938 | <a name="developer-advanced-settings"></a>6.5. Developer/advanced settings</h2></div></div></div> |
1941 | <p> | | 1939 | <p> |
1942 | </p> | | 1940 | </p> |
1943 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 1941 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
1944 | <li class="listitem"> | | 1942 | <li class="listitem"> |
1945 | <p><code class="varname">PKG_DEVELOPER</code>: | | 1943 | <p><code class="varname">PKG_DEVELOPER</code>: |
1946 | Run some sanity checks that package developers want: | | 1944 | Run some sanity checks that package developers want: |
1947 | </p> | | 1945 | </p> |
1948 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> | | 1946 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> |
1949 | <li class="listitem"><p>make sure patches apply with zero | | 1947 | <li class="listitem"><p>make sure patches apply with zero |
1950 | fuzz</p></li> | | 1948 | fuzz</p></li> |
1951 | <li class="listitem"><p>run check-shlibs to see that all | | 1949 | <li class="listitem"><p>run check-shlibs to see that all |
1952 | binaries will find their shared libs.</p></li> | | 1950 | binaries will find their shared libs.</p></li> |
1953 | </ul></div> | | 1951 | </ul></div> |
1954 | <p> | | 1952 | <p> |
1955 | </p> | | 1953 | </p> |
1956 | </li> | | 1954 | </li> |
1957 | <li class="listitem"><p><code class="varname">PKG_DEBUG_LEVEL</code>: The level | | 1955 | <li class="listitem"><p><code class="varname">PKG_DEBUG_LEVEL</code>: The level |
1958 | of debugging output which is displayed whilst making and | | 1956 | of debugging output which is displayed whilst making and |
1959 | installing the package. The default value for this is 0, | | 1957 | installing the package. The default value for this is 0, |
1960 | which will not display the commands as they are executed | | 1958 | which will not display the commands as they are executed |
1961 | (normal, default, quiet operation); the value 1 will display | | 1959 | (normal, default, quiet operation); the value 1 will display |
1962 | all shell commands before their invocation, and the value 2 | | 1960 | all shell commands before their invocation, and the value 2 |
1963 | will display both the shell commands before their invocation, | | 1961 | will display both the shell commands before their invocation, |
1964 | as well as their actual execution progress with <span class="command"><strong>set | | 1962 | as well as their actual execution progress with <span class="command"><strong>set |
1965 | -x</strong></span>.</p></li> | | 1963 | -x</strong></span>.</p></li> |
1966 | </ul></div> | | 1964 | </ul></div> |
1967 | <p> | | 1965 | <p> |
1968 | </p> | | 1966 | </p> |
1969 | </div> | | 1967 | </div> |
1970 | <div class="sect1"> | | 1968 | <div class="sect1"> |
1971 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 1969 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
1972 | <a name="selecting-build-options"></a>6.6. Selecting Build Options</h2></div></div></div> | | 1970 | <a name="selecting-build-options"></a>6.6. Selecting Build Options</h2></div></div></div> |
1973 | <p>Some packages have build time options, usually to select | | 1971 | <p>Some packages have build time options, usually to select |
1974 | between different dependencies, enable optional support for big | | 1972 | between different dependencies, enable optional support for big |
1975 | dependencies or enable experimental features.</p> | | 1973 | dependencies or enable experimental features.</p> |
1976 | <p>To see which options, if any, a package supports, and which | | 1974 | <p>To see which options, if any, a package supports, and which |
1977 | options are mutually exclusive, run <span class="command"><strong>make | | 1975 | options are mutually exclusive, run <span class="command"><strong>make |
1978 | show-options</strong></span>, for example:</p> | | 1976 | show-options</strong></span>, for example:</p> |
1979 | <pre class="programlisting"> | | 1977 | <pre class="programlisting"> |
1980 | The following options are supported by this package: | | 1978 | The following options are supported by this package: |
1981 | ssl Enable SSL support. | | 1979 | ssl Enable SSL support. |
1982 | Exactly one of the following gecko options is required: | | 1980 | Exactly one of the following gecko options is required: |
1983 | firefox Use firefox as gecko rendering engine. | | 1981 | firefox Use firefox as gecko rendering engine. |
1984 | mozilla Use mozilla as gecko rendering engine. | | 1982 | mozilla Use mozilla as gecko rendering engine. |
1985 | At most one of the following database options may be selected: | | 1983 | At most one of the following database options may be selected: |
1986 | mysql Enable support for MySQL database. | | 1984 | mysql Enable support for MySQL database. |
1987 | pgsql Enable support for PostgreSQL database. | | 1985 | pgsql Enable support for PostgreSQL database. |
1988 | | | 1986 | |
1989 | These options are enabled by default: firefox | | 1987 | These options are enabled by default: firefox |
1990 | These options are currently enabled: mozilla ssl | | 1988 | These options are currently enabled: mozilla ssl |
1991 | </pre> | | 1989 | </pre> |
1992 | <p>The following variables can be defined in | | 1990 | <p>The following variables can be defined in |
1993 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to select which options to | | 1991 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to select which options to |
1994 | enable for a package: <code class="varname">PKG_DEFAULT_OPTIONS</code>, | | 1992 | enable for a package: <code class="varname">PKG_DEFAULT_OPTIONS</code>, |
1995 | which can be used to select or disable options for all packages | | 1993 | which can be used to select or disable options for all packages |
1996 | that support them, and | | 1994 | that support them, and |
1997 | <code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code>, | | 1995 | <code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code>, |
1998 | which can be used to select or disable options specifically for | | 1996 | which can be used to select or disable options specifically for |
1999 | package <em class="replaceable"><code>pkgbase</code></em>. Options listed in | | 1997 | package <em class="replaceable"><code>pkgbase</code></em>. Options listed in |
2000 | these variables are selected, options preceded by <span class="quote">“<span class="quote">-</span>”</span> | | 1998 | these variables are selected, options preceded by <span class="quote">“<span class="quote">-</span>”</span> |
2001 | are disabled. A few examples:</p> | | 1999 | are disabled. A few examples:</p> |
2002 | <pre class="screen"> | | 2000 | <pre class="screen"> |
2003 | <code class="prompt">$</code> <span class="command"><strong>grep "PKG.*OPTION" <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a></strong></span> | | 2001 | <code class="prompt">$</code> <span class="command"><strong>grep "PKG.*OPTION" <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a></strong></span> |
2004 | PKG_DEFAULT_OPTIONS= -arts -dvdread -esound | | 2002 | PKG_DEFAULT_OPTIONS= -arts -dvdread -esound |
2005 | PKG_OPTIONS.kdebase= debug -sasl | | 2003 | PKG_OPTIONS.kdebase= debug -sasl |
2006 | PKG_OPTIONS.apache= suexec </pre> | | 2004 | PKG_OPTIONS.apache= suexec </pre> |
2007 | <p>It is important to note that options that were specifically | | 2005 | <p>It is important to note that options that were specifically |
2008 | suggested by the package maintainer must be explicitly removed if | | 2006 | suggested by the package maintainer must be explicitly removed if |
2009 | you do not wish to include the option. If you are unsure you can view | | 2007 | you do not wish to include the option. If you are unsure you can view |
2010 | the current state with <span class="command"><strong>make show-options</strong></span>.</p> | | 2008 | the current state with <span class="command"><strong>make show-options</strong></span>.</p> |
2011 | <p>The following settings are consulted in the order given, and | | 2009 | <p>The following settings are consulted in the order given, and |
2012 | the last setting that selects or disables an option is | | 2010 | the last setting that selects or disables an option is |
2013 | used:</p> | | 2011 | used:</p> |
2014 | <div class="orderedlist"><ol class="orderedlist" type="1"> | | 2012 | <div class="orderedlist"><ol class="orderedlist" type="1"> |
2015 | <li class="listitem"><p>the default options as suggested by the package | | 2013 | <li class="listitem"><p>the default options as suggested by the package |
2016 | maintainer</p></li> | | 2014 | maintainer</p></li> |
2017 | <li class="listitem"><p>the options implied by the settings of legacy | | 2015 | <li class="listitem"><p>the options implied by the settings of legacy |
2018 | variables (see below)</p></li> | | 2016 | variables (see below)</p></li> |
2019 | <li class="listitem"><p><code class="varname">PKG_DEFAULT_OPTIONS</code></p></li> | | 2017 | <li class="listitem"><p><code class="varname">PKG_DEFAULT_OPTIONS</code></p></li> |
2020 | <li class="listitem"><p><code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code></p></li> | | 2018 | <li class="listitem"><p><code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code></p></li> |
2021 | </ol></div> | | 2019 | </ol></div> |
2022 | <p>For groups of mutually exclusive options, the last option | | 2020 | <p>For groups of mutually exclusive options, the last option |
2023 | selected is used, all others are automatically disabled. If an | | 2021 | selected is used, all others are automatically disabled. If an |
2024 | option of the group is explicitly disabled, the previously | | 2022 | option of the group is explicitly disabled, the previously |
2025 | selected option, if any, is used. It is an error if no option | | 2023 | selected option, if any, is used. It is an error if no option |
2026 | from a required group of options is selected, and building the | | 2024 | from a required group of options is selected, and building the |
2027 | package will fail.</p> | | 2025 | package will fail.</p> |
2028 | <p>Before the options framework was introduced, build options | | 2026 | <p>Before the options framework was introduced, build options |
2029 | were selected by setting a variable (often named | | 2027 | were selected by setting a variable (often named |
2030 | <code class="varname">USE_<em class="replaceable"><code>FOO</code></em></code>) in | | 2028 | <code class="varname">USE_<em class="replaceable"><code>FOO</code></em></code>) in |
2031 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> for each option. To ease | | 2029 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> for each option. To ease |
2032 | transition to the options framework for the user, these legacy | | 2030 | transition to the options framework for the user, these legacy |
2033 | variables are converted to the appropriate options setting | | 2031 | variables are converted to the appropriate options setting |
2034 | (<code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code>) | | 2032 | (<code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code>) |
2035 | automatically. A warning is issued to prompt the user to update | | 2033 | automatically. A warning is issued to prompt the user to update |
2036 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to use the options framework | | 2034 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> to use the options framework |
2037 | directly. Support for the legacy variables will be removed | | 2035 | directly. Support for the legacy variables will be removed |
2038 | eventually.</p> | | 2036 | eventually.</p> |
2039 | </div> | | 2037 | </div> |
2040 | </div> | | 2038 | </div> |
2041 | <div class="chapter"> | | 2039 | <div class="chapter"> |
2042 | <div class="titlepage"><div><div><h2 class="title"> | | 2040 | <div class="titlepage"><div><div><h2 class="title"> |
2043 | <a name="binary"></a>Chapter 7. Creating binary packages</h2></div></div></div> | | 2041 | <a name="binary"></a>Chapter 7. Creating binary packages</h2></div></div></div> |
2044 | <div class="toc"> | | 2042 | <div class="toc"> |
2045 | <p><b>Table of Contents</b></p> | | 2043 | <p><b>Table of Contents</b></p> |
2046 | <dl class="toc"> | | 2044 | <dl class="toc"> |
2047 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> | | 2045 | <dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt> |
2048 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> | | 2046 | <dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt> |
2049 | </dl> | | 2047 | </dl> |
2050 | </div> | | 2048 | </div> |
2051 | <div class="sect1"> | | 2049 | <div class="sect1"> |
2052 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2050 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2053 | <a name="building-a-single-binary-package"></a>7.1. Building a single binary package</h2></div></div></div> | | 2051 | <a name="building-a-single-binary-package"></a>7.1. Building a single binary package</h2></div></div></div> |
2054 | <p>Once you have built and installed a package, you can create | | 2052 | <p>Once you have built and installed a package, you can create |
2055 | a <span class="emphasis"><em>binary package</em></span> which can be installed on | | 2053 | a <span class="emphasis"><em>binary package</em></span> which can be installed on |
2056 | another system with <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a>. This saves having to build | | 2054 | another system with <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">pkg_add</span>(1)</span></a>. This saves having to build |
2057 | the same package on a group of hosts and wasting CPU time. It also | | 2055 | the same package on a group of hosts and wasting CPU time. It also |
2058 | provides a simple means for others to install your package, should | | 2056 | provides a simple means for others to install your package, should |
2059 | you distribute it.</p> | | 2057 | you distribute it.</p> |
2060 | <p>To create a binary package, change into the appropriate | | 2058 | <p>To create a binary package, change into the appropriate |
2061 | directory in pkgsrc, and run <span class="command"><strong>make | | 2059 | directory in pkgsrc, and run <span class="command"><strong>make |
2062 | package</strong></span>:</p> | | 2060 | package</strong></span>:</p> |
2063 | <pre class="screen"> | | 2061 | <pre class="screen"> |
2064 | <code class="prompt">$</code> <strong class="userinput"><code>cd misc/figlet</code></strong> | | 2062 | <code class="prompt">$</code> <strong class="userinput"><code>cd misc/figlet</code></strong> |
2065 | <code class="prompt">$</code> <strong class="userinput"><code>make package</code></strong> | | 2063 | <code class="prompt">$</code> <strong class="userinput"><code>make package</code></strong> |
2066 | </pre> | | 2064 | </pre> |
2067 | <p>This will build and install your package (if not already done), | | 2065 | <p>This will build and install your package (if not already done), |
2068 | and then build a binary package from what was installed. You can | | 2066 | and then build a binary package from what was installed. You can |
2069 | then use the <span class="command"><strong>pkg_*</strong></span> tools to manipulate | | 2067 | then use the <span class="command"><strong>pkg_*</strong></span> tools to manipulate |
2070 | it. Binary packages are created by default in | | 2068 | it. Binary packages are created by default in |
2071 | <code class="filename">/usr/pkgsrc/packages</code>, in the form of a | | 2069 | <code class="filename">/usr/pkgsrc/packages</code>, in the form of a |
2072 | gzipped tar file. See <a class="xref" href="#logs.package" title="B.2. Packaging figlet">Section B.2, “Packaging figlet”</a> for a | | 2070 | gzipped tar file. See <a class="xref" href="#logs.package" title="B.2. Packaging figlet">Section B.2, “Packaging figlet”</a> for a |
2073 | continuation of the above <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/misc/figlet/README.html" target="_top"><code class="filename">misc/figlet</code></a> example.</p> | | 2071 | continuation of the above <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/misc/figlet/README.html" target="_top"><code class="filename">misc/figlet</code></a> example.</p> |
2074 | <p>See <a class="xref" href="#submit" title="Chapter 23. Submitting and Committing">Chapter 23, <i>Submitting and Committing</i></a> for information on how to submit | | 2072 | <p>See <a class="xref" href="#submit" title="Chapter 23. Submitting and Committing">Chapter 23, <i>Submitting and Committing</i></a> for information on how to submit |
2075 | such a binary package.</p> | | 2073 | such a binary package.</p> |
2076 | </div> | | 2074 | </div> |
2077 | <div class="sect1"> | | 2075 | <div class="sect1"> |
2078 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2076 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2079 | <a name="settings-for-creationg-of-binary-packages"></a>7.2. Settings for creation of binary packages</h2></div></div></div> | | 2077 | <a name="settings-for-creationg-of-binary-packages"></a>7.2. Settings for creation of binary packages</h2></div></div></div> |
2080 | <p>See <a class="xref" href="#build.helpful-targets" title="19.17. Other helpful targets">Section 19.17, “Other helpful targets”</a>.</p> | | 2078 | <p>See <a class="xref" href="#build.helpful-targets" title="19.17. Other helpful targets">Section 19.17, “Other helpful targets”</a>.</p> |
2081 | </div> | | 2079 | </div> |
2082 | </div> | | 2080 | </div> |
2083 | <div class="chapter"> | | 2081 | <div class="chapter"> |
2084 | <div class="titlepage"><div><div><h2 class="title"> | | 2082 | <div class="titlepage"><div><div><h2 class="title"> |
2085 | <a name="bulk"></a>Chapter 8. Creating binary packages for everything in pkgsrc (bulk | | 2083 | <a name="bulk"></a>Chapter 8. Creating binary packages for everything in pkgsrc (bulk |
2086 | builds)</h2></div></div></div> | | 2084 | builds)</h2></div></div></div> |
2087 | <div class="toc"> | | 2085 | <div class="toc"> |
2088 | <p><b>Table of Contents</b></p> | | 2086 | <p><b>Table of Contents</b></p> |
2089 | <dl class="toc"> | | 2087 | <dl class="toc"> |
2090 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> | | 2088 | <dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt> |
2091 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> | | 2089 | <dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a pbulk-style bulk build</a></span></dt> |
2092 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> | | 2090 | <dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd> |
2093 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> | | 2091 | <dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt> |
2094 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> | | 2092 | <dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt> |
2095 | <dd><dl> | | 2093 | <dd><dl> |
2096 | <dt><span class="sect2"><a href="#bulk.var.subst_noop">8.4.1. Strict SUBST blocks</a></span></dt> | | 2094 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt> |
2097 | <dt><span class="sect2"><a href="#bulk.var.confopt">8.4.2. Detect unknown configure options</a></span></dt> | | 2095 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt> |
2098 | <dt><span class="sect2"><a href="#bulk.var.comperr">8.4.3. Detect classes of bugs by forcing compiler warnings</a></span></dt> | | 2096 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.3. Use custom directories</a></span></dt> |
2099 | <dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt> | | 2097 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.4. Turn warnings into errors</a></span></dt> |
2100 | <dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt> | | 2098 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.5. Reject packages for which pkglint reports errors</a></span></dt> |
2101 | <dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt> | | 2099 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.6. Reject packages that contain forbidden strings</a></span></dt> |
2102 | <dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt> | | 2100 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.7. Reject packages whose self-test fails</a></span></dt> |
2103 | <dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt> | | 2101 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.8. Reject packages that use undefined shell variables</a></span></dt> |
2104 | <dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt> | | 2102 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.9. Turn off verbose logging</a></span></dt> |
2105 | <dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt> | | | |
2106 | <dt><span class="sect2"><a href="#bulk.var.options">8.4.11. Select random sets of options</a></span></dt> | | | |
2107 | <dt><span class="sect2"><a href="#bulk.var.build_defs">8.4.12. Select random configurations of BUILD_DEFS</a></span></dt> | | | |
2108 | </dl></dd> | | 2103 | </dl></dd> |
2109 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> | | 2104 | <dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt> |
2110 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> | | 2105 | <dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd> |
2111 | </dl> | | 2106 | </dl> |
2112 | </div> | | 2107 | </div> |
2113 | <p>For a number of reasons, you may want to build binary packages | | 2108 | <p>For a number of reasons, you may want to build binary packages |
2114 | for a large selected set of packages in pkgsrc, or even for all pkgsrc packages. | | 2109 | for a large selected set of packages in pkgsrc, or even for all pkgsrc packages. |
2115 | For instance, when you have multiple machines that should run the same software, | | 2110 | For instance, when you have multiple machines that should run the same software, |
2116 | it is wasted time if they all build their packages themselves from source. | | 2111 | it is wasted time if they all build their packages themselves from source. |
2117 | Or you may want to build a list of packages you want and check them before | | 2112 | Or you may want to build a list of packages you want and check them before |
2118 | deploying onto production systems. | | 2113 | deploying onto production systems. |
2119 | There is a way of getting a set of binary packages: | | 2114 | There is a way of getting a set of binary packages: |
2120 | the bulk build system, or pbulk ("p" stands for "parallel"). | | 2115 | the bulk build system, or pbulk ("p" stands for "parallel"). |
2121 | This chapter describes how to set it up.</p> | | 2116 | This chapter describes how to set it up.</p> |
2122 | <div class="sect1"> | | 2117 | <div class="sect1"> |
2123 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2118 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2124 | <a name="bulk.pre"></a>8.1. Preparations</h2></div></div></div> | | 2119 | <a name="bulk.pre"></a>8.1. Preparations</h2></div></div></div> |
2125 | <p>First of all, you have to decide whether you build all packages | | 2120 | <p>First of all, you have to decide whether you build all packages |
2126 | or a limited set of them. Full bulk builds usually consume a lot more resources, | | 2121 | or a limited set of them. Full bulk builds usually consume a lot more resources, |
2127 | both space and time, than builds for some practical sets of packages. | | 2122 | both space and time, than builds for some practical sets of packages. |
2128 | A number of particularly heavy packages exist that are not actually | | 2123 | A number of particularly heavy packages exist that are not actually |
2129 | interesting to a wide audience. (The approximate resource consumption for a | | 2124 | interesting to a wide audience. (The approximate resource consumption for a |
2130 | full bulk build is given in section <a class="xref" href="#bulk.req" title="8.3. Requirements of a full bulk build">Section 8.3, “Requirements of a full bulk build”</a>.) | | 2125 | full bulk build is given in section <a class="xref" href="#bulk.req" title="8.3. Requirements of a full bulk build">Section 8.3, “Requirements of a full bulk build”</a>.) |
2131 | For limited bulk builds you need to make a list of packages you want to build. | | 2126 | For limited bulk builds you need to make a list of packages you want to build. |
2132 | Note that all their dependencies will be built, so you don't need to track them manually. | | 2127 | Note that all their dependencies will be built, so you don't need to track them manually. |
2133 | </p> | | 2128 | </p> |
2134 | <p>During bulk builds various packages are installed and deinstalled | | 2129 | <p>During bulk builds various packages are installed and deinstalled |
2135 | in <code class="filename">/usr/pkg</code> (or whatever <code class="filename">LOCALBASE</code> is), | | 2130 | in <code class="filename">/usr/pkg</code> (or whatever <code class="filename">LOCALBASE</code> is), |
2136 | so make sure that you don't need any package during the builds. | | 2131 | so make sure that you don't need any package during the builds. |
2137 | Essentially, you should provide a fresh system, either a chroot environment | | 2132 | Essentially, you should provide a fresh system, either a chroot environment |
2138 | or something even more restrictive, depending on what the operating system provides, | | 2133 | or something even more restrictive, depending on what the operating system provides, |
2139 | or dedicate the whole physical machine. | | 2134 | or dedicate the whole physical machine. |
2140 | As a useful side effect this makes sure that bulk builds cannot | | 2135 | As a useful side effect this makes sure that bulk builds cannot |
2141 | break anything in your system. There have been numerous cases where | | 2136 | break anything in your system. There have been numerous cases where |
2142 | certain packages tried to install files outside the | | 2137 | certain packages tried to install files outside the |
2143 | <code class="filename">LOCALBASE</code> or wanted to edit some files in | | 2138 | <code class="filename">LOCALBASE</code> or wanted to edit some files in |
2144 | <code class="filename">/etc</code>. | | 2139 | <code class="filename">/etc</code>. |
2145 | </p> | | 2140 | </p> |
2146 | </div> | | 2141 | </div> |
2147 | <div class="sect1"> | | 2142 | <div class="sect1"> |
2148 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2143 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2149 | <a name="bulk.pbulk"></a>8.2. Running a pbulk-style bulk build</h2></div></div></div> | | 2144 | <a name="bulk.pbulk"></a>8.2. Running a pbulk-style bulk build</h2></div></div></div> |
2150 | <p>Running a pbulk-style bulk build works roughly as follows:</p> | | 2145 | <p>Running a pbulk-style bulk build works roughly as follows:</p> |
2151 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2146 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2152 | <li class="listitem"><p>First, build the pbulk infrastructure in a fresh pkgsrc location.</p></li> | | 2147 | <li class="listitem"><p>First, build the pbulk infrastructure in a fresh pkgsrc location.</p></li> |
2153 | <li class="listitem"><p>Then, build each of the packages from a clean installation directory using the infrastructure.</p></li> | | 2148 | <li class="listitem"><p>Then, build each of the packages from a clean installation directory using the infrastructure.</p></li> |
2154 | </ul></div> | | 2149 | </ul></div> |
2155 | <div class="sect2"> | | 2150 | <div class="sect2"> |
2156 | <div class="titlepage"><div><div><h3 class="title"> | | 2151 | <div class="titlepage"><div><div><h3 class="title"> |
2157 | <a name="bulk.pbulk.conf"></a>8.2.1. Configuration</h3></div></div></div> | | 2152 | <a name="bulk.pbulk.conf"></a>8.2.1. Configuration</h3></div></div></div> |
2158 | <p>To simplify configuration, we provide the helper script <code class="filename">mk/pbulk/pbulk.sh</code>.</p> | | 2153 | <p>To simplify configuration, we provide the helper script <code class="filename">mk/pbulk/pbulk.sh</code>.</p> |
2159 | <p>In order to use it, prepare a clear system (real one, chroot environment, jail, zone, virtual machine). | | 2154 | <p>In order to use it, prepare a clear system (real one, chroot environment, jail, zone, virtual machine). |
2160 | Configure network access to fetch distribution files. | | 2155 | Configure network access to fetch distribution files. |
2161 | Create a user with name "pbulk".</p> | | 2156 | Create a user with name "pbulk".</p> |
2162 | <p>Fetch and extract pkgsrc. Use a command like one of these:</p> | | 2157 | <p>Fetch and extract pkgsrc. Use a command like one of these:</p> |
2163 | <pre class="screen"> | | 2158 | <pre class="screen"> |
2164 | <code class="prompt">#</code> <strong class="userinput"><code>(cd /usr && ftp -o - https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz | tar -zxf-)</code></strong> | | 2159 | <code class="prompt">#</code> <strong class="userinput"><code>(cd /usr && ftp -o - https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz | tar -zxf-)</code></strong> |
2165 | <code class="prompt">#</code> <strong class="userinput"><code>(cd /usr && fetch -o - https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz | tar -zxf-)</code></strong> | | 2160 | <code class="prompt">#</code> <strong class="userinput"><code>(cd /usr && fetch -o - https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz | tar -zxf-)</code></strong> |
2166 | <code class="prompt">#</code> <strong class="userinput"><code>(cd /usr && cvs -Q -z3 -d anoncvs@anoncvs.NetBSD.org:/cvsroot get -P pkgsrc)</code></strong> | | 2161 | <code class="prompt">#</code> <strong class="userinput"><code>(cd /usr && cvs -Q -z3 -d anoncvs@anoncvs.NetBSD.org:/cvsroot get -P pkgsrc)</code></strong> |
2167 | </pre> | | 2162 | </pre> |
2168 | <p>Or any other way that fits (e.g., curl, wget).</p> | | 2163 | <p>Or any other way that fits (e.g., curl, wget).</p> |
2169 | <p>Deploy and configure pbulk tools, e.g.:</p> | | 2164 | <p>Deploy and configure pbulk tools, e.g.:</p> |
2170 | <pre class="screen"> | | 2165 | <pre class="screen"> |
2171 | <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -n # use native make, no bootstrap kit needed (for use on NetBSD)</code></strong> | | 2166 | <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -n # use native make, no bootstrap kit needed (for use on NetBSD)</code></strong> |
2172 | <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -n -c mk.conf.frag # native, apply settings from given mk.conf fragment</code></strong> | | 2167 | <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -n -c mk.conf.frag # native, apply settings from given mk.conf fragment</code></strong> |
2173 | <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -nlc mk.conf.frag # native, apply settings, configure for limited build</code></strong> | | 2168 | <code class="prompt">#</code> <strong class="userinput"><code>sh pbulk.sh -nlc mk.conf.frag # native, apply settings, configure for limited build</code></strong> |
2174 | </pre> | | 2169 | </pre> |
2175 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 2170 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
2176 | <h3 class="title">Note</h3> | | 2171 | <h3 class="title">Note</h3> |
2177 | <p><code class="filename">mk.conf.frag</code> is a fragment of | | 2172 | <p><code class="filename">mk.conf.frag</code> is a fragment of |
2178 | <code class="filename">mk.conf</code> that contains settings you want to | | 2173 | <code class="filename">mk.conf</code> that contains settings you want to |
2179 | apply to packages you build. For instance,</p> | | 2174 | apply to packages you build. For instance,</p> |
2180 | <pre class="programlisting"> | | 2175 | <pre class="programlisting"> |
2181 | PKG_DEVELOPER= yes # perform more checks | | 2176 | PKG_DEVELOPER= yes # perform more checks |
2182 | X11_TYPE= modular # use pkgsrc X11 | | 2177 | X11_TYPE= modular # use pkgsrc X11 |
2183 | SKIP_LICENSE_CHECK= yes # accept all licences (useful | | 2178 | SKIP_LICENSE_CHECK= yes # accept all licences (useful |
2184 | # when building all packages) | | 2179 | # when building all packages) |
2185 | </pre> | | 2180 | </pre> |
2186 | </div> | | 2181 | </div> |
2187 | <p>If configured for limited list, replace the list in <code class="filename">/usr/pbulk/etc/pbulk.list</code> | | 2182 | <p>If configured for limited list, replace the list in <code class="filename">/usr/pbulk/etc/pbulk.list</code> |
2188 | with your list of packages, one per line without empty lines or comments. E.g.:</p> | | 2183 | with your list of packages, one per line without empty lines or comments. E.g.:</p> |
2189 | <pre class="programlisting"> | | 2184 | <pre class="programlisting"> |
2190 | www/firefox | | 2185 | www/firefox |
2191 | mail/thunderbird | | 2186 | mail/thunderbird |
2192 | misc/libreoffice4 | | 2187 | misc/libreoffice4 |
2193 | </pre> | | 2188 | </pre> |
2194 | <p>At this point you can also review configuration in <code class="filename">/usr/pbulk/etc</code> | | 2189 | <p>At this point you can also review configuration in <code class="filename">/usr/pbulk/etc</code> |
2195 | and make final amendments, if wanted.</p> | | 2190 | and make final amendments, if wanted.</p> |
2196 | <p>Start it:</p> | | 2191 | <p>Start it:</p> |
2197 | <pre class="screen"> | | 2192 | <pre class="screen"> |
2198 | <code class="prompt">#</code> <strong class="userinput"><code>/usr/pbulk/bin/bulkbuild</code></strong> | | 2193 | <code class="prompt">#</code> <strong class="userinput"><code>/usr/pbulk/bin/bulkbuild</code></strong> |
2199 | </pre> | | 2194 | </pre> |
2200 | <p>After it finishes, you'll have <code class="filename">/mnt</code> filled with distribution files, binary packages, and reports, | | 2195 | <p>After it finishes, you'll have <code class="filename">/mnt</code> filled with distribution files, binary packages, and reports, |
2201 | plain text summary in <code class="filename">/mnt/bulklog/meta/report.txt</code> | | 2196 | plain text summary in <code class="filename">/mnt/bulklog/meta/report.txt</code> |
2202 | </p> | | 2197 | </p> |
2203 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 2198 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
2204 | <h3 class="title">Note</h3> | | 2199 | <h3 class="title">Note</h3> |
2205 | <p>The <code class="filename">pbulk.sh</code> script does not cover all possible use cases. | | 2200 | <p>The <code class="filename">pbulk.sh</code> script does not cover all possible use cases. |
2206 | While being ready to run, it serves as a good starting point to understand and build more complex setups. | | 2201 | While being ready to run, it serves as a good starting point to understand and build more complex setups. |
2207 | The script is kept small enough for better understanding.</p> | | 2202 | The script is kept small enough for better understanding.</p> |
2208 | </div> | | 2203 | </div> |
2209 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> | | 2204 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
2210 | <h3 class="title">Note</h3> | | 2205 | <h3 class="title">Note</h3> |
2211 | <p>The <code class="filename">pbulk.sh</code> script supports running | | 2206 | <p>The <code class="filename">pbulk.sh</code> script supports running |
2212 | unprivileged bulk build and helps configuring distributed bulk builds.</p> | | 2207 | unprivileged bulk build and helps configuring distributed bulk builds.</p> |
2213 | </div> | | 2208 | </div> |
2214 | </div> | | 2209 | </div> |
2215 | </div> | | 2210 | </div> |
2216 | <div class="sect1"> | | 2211 | <div class="sect1"> |
2217 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2212 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2218 | <a name="bulk.req"></a>8.3. Requirements of a full bulk build</h2></div></div></div> | | 2213 | <a name="bulk.req"></a>8.3. Requirements of a full bulk build</h2></div></div></div> |
2219 | <p>A complete bulk build requires lots of disk space. Some of the | | 2214 | <p>A complete bulk build requires lots of disk space. Some of the |
2220 | disk space can be read-only, some other must be writable. Some can be on | | 2215 | disk space can be read-only, some other must be writable. Some can be on |
2221 | remote filesystems (such as NFS) and some should be local. Some can be | | 2216 | remote filesystems (such as NFS) and some should be local. Some can be |
2222 | temporary filesystems, others must survive a sudden reboot.</p> | | 2217 | temporary filesystems, others must survive a sudden reboot.</p> |
2223 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2218 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2224 | <li class="listitem"><p>40 GB for the distfiles (read-write, remote, temporary)</p></li> | | 2219 | <li class="listitem"><p>40 GB for the distfiles (read-write, remote, temporary)</p></li> |
2225 | <li class="listitem"><p>30 GB for the binary packages (read-write, remote, permanent)</p></li> | | 2220 | <li class="listitem"><p>30 GB for the binary packages (read-write, remote, permanent)</p></li> |
2226 | <li class="listitem"><p>1 GB for the pkgsrc tree (read-only, remote, permanent)</p></li> | | 2221 | <li class="listitem"><p>1 GB for the pkgsrc tree (read-only, remote, permanent)</p></li> |
2227 | <li class="listitem"><p>5 GB for <code class="filename">LOCALBASE</code> (read-write, local, temporary)</p></li> | | 2222 | <li class="listitem"><p>5 GB for <code class="filename">LOCALBASE</code> (read-write, local, temporary)</p></li> |
2228 | <li class="listitem"><p>10 GB for the log files (read-write, remote, permanent)</p></li> | | 2223 | <li class="listitem"><p>10 GB for the log files (read-write, remote, permanent)</p></li> |
2229 | <li class="listitem"><p>5 GB for temporary files (read-write, local, temporary)</p></li> | | 2224 | <li class="listitem"><p>5 GB for temporary files (read-write, local, temporary)</p></li> |
2230 | </ul></div> | | 2225 | </ul></div> |
2231 | </div> | | 2226 | </div> |
2232 | <div class="sect1"> | | 2227 | <div class="sect1"> |
2233 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2228 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2234 | <a name="bulk.var"></a>8.4. Bulk build variants</h2></div></div></div> | | 2229 | <a name="bulk.var"></a>8.4. Bulk build variants</h2></div></div></div> |
2235 | <p>To ensure that pkgsrc packages work in different configurations, it | | 2230 | <p>To ensure that pkgsrc packages work in different configurations, it |
2236 | makes sense to run non-default bulk builds from time to time. This | | 2231 | makes sense to run non-default bulk builds from time to time. This |
2237 | section lists some ideas for bulk builds that intentionally let packages | | 2232 | section lists some ideas for bulk builds that intentionally let packages |
2238 | fail if they don't follow the pkgsrc style.</p> | | 2233 | fail if they don't follow the pkgsrc style.</p> |
2239 | <div class="sect2"> | | 2234 | <div class="sect2"> |
2240 | <div class="titlepage"><div><div><h3 class="title"> | | 2235 | <div class="titlepage"><div><div><h3 class="title"> |
2241 | <a name="bulk.var.subst_noop"></a>8.4.1. Strict SUBST blocks</h3></div></div></div> | | 2236 | <a name="bulk.var.confopt"></a>8.4.1. Detect unknown configure options</h3></div></div></div> |
2242 | <p>Up to May 2020, the SUBST blocks ignored files that didn't exist, | | | |
2243 | as well as substitutions that didn't have any effect. There were quite a | | | |
2244 | few SUBST blocks that were redundant, and these have been removed | | | |
2245 | already.</p> | | | |
2246 | <p>The next step would be to not only check that each filename pattern | | | |
2247 | has an effect but also that each substitution in SUBST_SED or SUBST_VARS | | | |
2248 | applies to at least one file.</p> | | | |
2249 | <p>To do this, <code class="filename">mk/subst.mk</code> would have to be | | | |
2250 | adjusted, in a similar way as the check for no-op SUBST_FILES. There are | | | |
2251 | several regression tests in <code class="filename">regress/infra-unittests</code> | | | |
2252 | that help to get all edge cases correct.</p> | | | |
2253 | <p>When a package fails this additional check, there are various | | | |
2254 | possible causes why the <code class="varname">SUBST_SED</code> became a | | | |
2255 | no-op.</p> | | | |
2256 | <div class="orderedlist"><ol class="orderedlist" type="1"> | | | |
2257 | <li class="listitem"><p>The pattern used to be found in a former version of the | | | |
2258 | package, but is not needed anymore. In that case, just remove | | | |
2259 | it.</p></li> | | | |
2260 | <li class="listitem"><p>The pattern contains a typo. In that case, fix the typo | | | |
2261 | and bump <code class="varname">PKGREVISION</code>, since the fixed typo will | | | |
2262 | probably modify the resulting binary package.</p></li> | | | |
2263 | <li class="listitem"><p>There is a patch that is applied before the SUBST block, | | | |
2264 | and the patch accidentally contains the change that was intended for the | | | |
2265 | SUBST block. In that case, remove the respective hunk from the | | | |
2266 | patch.</p></li> | | | |
2267 | </ol></div> | | | |
2268 | </div> | | | |
2269 | <div class="sect2"> | | | |
2270 | <div class="titlepage"><div><div><h3 class="title"> | | | |
2271 | <a name="bulk.var.confopt"></a>8.4.2. Detect unknown configure options</h3></div></div></div> | | | |
2272 | <p>Add the following line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2237 | <p>Add the following line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2273 | <pre class="programlisting"> | | 2238 | <pre class="programlisting"> |
2274 | GNU_CONFIGURE_STRICT= yes | | 2239 | GNU_CONFIGURE_STRICT= yes |
2275 | </pre> | | 2240 | </pre> |
2276 | <p>When a package fails this additional check, the most common cause | | 2241 | <p>When a package fails this additional check, the most common cause |
2277 | is that the configure option was valid for an older version of the | | 2242 | is that the configure option was valid for an older version of the |
2278 | package but does not apply anymore. In that case, just remove it.</p> | | 2243 | package but does not apply anymore. In that case, just remove it.</p> |
2279 | </div> | | 2244 | </div> |
2280 | <div class="sect2"> | | 2245 | <div class="sect2"> |
2281 | <div class="titlepage"><div><div><h3 class="title"> | | 2246 | <div class="titlepage"><div><div><h3 class="title"> |
2282 | <a name="bulk.var.comperr"></a>8.4.3. Detect classes of bugs by forcing compiler warnings</h3></div></div></div> | | 2247 | <a name="bulk.var.comperr"></a>8.4.2. Detect classes of bugs by forcing compiler warnings</h3></div></div></div> |
2283 | <p>The job of a compiler is not restricted to producing executable | | 2248 | <p>The job of a compiler is not restricted to producing executable |
2284 | code, most compilers also detects typical mistakes.</p> | | 2249 | code, most compilers also detect typical programming mistakes. The pkgsrc |
2285 | <p>Add the following line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2250 | compiler wrappers make it easy to force compiler options when the package |
| | | 2251 | is built. This can be used to find typical bugs across all packages that |
| | | 2252 | are in pkgsrc. By reporting these bugs upstream, the packages will be |
| | | 2253 | more reliable with the next updates.</p> |
| | | 2254 | <p>Add some of the following lines to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p> |
2286 | <pre class="programlisting"> | | 2255 | <pre class="programlisting"> |
2287 | CFLAGS+= -Werror=char-subscripts | | 2256 | CFLAGS+= -Werror=char-subscripts |
| | | 2257 | CFLAGS+= -Werror=implicit-function-declaration |
2288 | </pre> | | 2258 | </pre> |
2289 | <p>When a package fails this additional check, first document the | | 2259 | <p>When a package fails to build using these stricter compiler |
2290 | circumstances in which the compiler produced the error message. This | | 2260 | options, document the circumstances in which the compiler produced the |
2291 | includes:</p> | | 2261 | error message. This includes:</p> |
2292 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2262 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2293 | <li class="listitem"><p>The platform | | 2263 | <li class="listitem"><p>The platform |
2294 | (<code class="varname">MACHINE_PLATFORM</code>)</p></li> | | 2264 | (<code class="varname">MACHINE_PLATFORM</code>)</p></li> |
2295 | <li class="listitem"><p>The source file</p></li> | | 2265 | <li class="listitem"><p>The source file</p></li> |
2296 | <li class="listitem"><p>An excerpt of the code. GCC and Clang already do this as | | 2266 | <li class="listitem"><p>An excerpt of the code. GCC and Clang already do this as |
2297 | part of the diagnostic.</p></li> | | 2267 | part of the diagnostic.</p></li> |
2298 | <li class="listitem"><p>The error message from the compiler.</p></li> | | 2268 | <li class="listitem"><p>The exact error message from the compiler.</p></li> |
2299 | </ul></div> | | 2269 | </ul></div> |
2300 | <p>If a package produces these error messages, but the package is | | 2270 | <p>If a package produces these error messages, but the package is |
2301 | fine, document this in the package Makefile, like this:</p> | | 2271 | fine, record this in your local <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, like this, to skip this check |
| | | 2272 | in the next builds:</p> |
2302 | <pre class="programlisting"> | | 2273 | <pre class="programlisting"> |
| | | 2274 | .if ${PKGPATH} == category/package |
2303 | # Version ${VERSION} failed on ${MACHINE_PLATFORM}: | | 2275 | # Version ${VERSION} failed on ${MACHINE_PLATFORM}: |
2304 | # error message | | 2276 | # error message |
2305 | # code | | 2277 | # code |
2306 | # reason why the code does not need to be fixed | | 2278 | # Reason why the code does not need to be fixed. |
2307 | BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts | | 2279 | BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts |
| | | 2280 | .endif |
2308 | </pre> | | 2281 | </pre> |
2309 | <p>If the error messages from the compiler are valid and the code | | 2282 | <p>If the error messages from the compiler are valid and the code |
2310 | needs to be fixed, prepare a patch for a single source file, or if it's a | | 2283 | needs to be fixed, prepare a local patch (see |
2311 | one-liner fix, add a SUBST block to the package Makefile. In any case, | | 2284 | <code class="varname">LOCALPATCHES</code>) and report the bug to the upstream |
2312 | report it to the upstream authors of the package.</p> | | 2285 | authors of the package, providing them with the information you collected |
| | | 2286 | above.</p> |
| | | 2287 | <p>Patches that are not essential for the package to work should only |
| | | 2288 | be reported upstream but not committed to pkgsrc, to make future updates |
| | | 2289 | easier.</p> |
2313 | </div> | | 2290 | </div> |
2314 | <div class="sect2"> | | 2291 | <div class="sect2"> |
2315 | <div class="titlepage"><div><div><h3 class="title"> | | 2292 | <div class="titlepage"><div><div><h3 class="title"> |
2316 | <a name="bulk.var.dirs"></a>8.4.4. Use custom directories</h3></div></div></div> | | 2293 | <a name="bulk.var.dirs"></a>8.4.3. Use custom directories</h3></div></div></div> |
2317 | <p>Some directories like <code class="varname">PREFIX</code>, | | 2294 | <p>Some directories like <code class="varname">PREFIX</code>, |
2318 | <code class="varname">VARBASE</code>, <code class="varname">PKG_SYSCONFDIR</code>, | | 2295 | <code class="varname">VARBASE</code>, <code class="varname">PKG_SYSCONFDIR</code>, |
2319 | <code class="varname">PKGMANDIR</code>, <code class="varname">PKG_INFODIR</code> can be | | 2296 | <code class="varname">PKGMANDIR</code>, <code class="varname">PKG_INFODIR</code> can be |
2320 | configured in pkgsrc. Set these to arbitrary paths during bootstrap or | | 2297 | configured in pkgsrc. Set these to arbitrary paths during bootstrap or |
2321 | afterwards in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2298 | afterwards in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2322 | <pre class="programlisting"> | | 2299 | <pre class="programlisting"> |
2323 | PREFIX= /a-random-uuid | | 2300 | PREFIX= /a-random-uuid |
2324 | PKG_SYSCONFDIR= /a-random-uuid | | 2301 | PKG_SYSCONFDIR= /a-random-uuid |
2325 | VARBASE= /a-random-uuid | | 2302 | VARBASE= /a-random-uuid |
2326 | PKGMANDIR= a-random-uuid | | 2303 | PKGMANDIR= a-random-uuid |
2327 | PKG_INFODIR= a-random-uuid | | 2304 | PKG_INFODIR= a-random-uuid |
2328 | </pre> | | 2305 | </pre> |
2329 | </div> | | 2306 | </div> |
2330 | <div class="sect2"> | | 2307 | <div class="sect2"> |
2331 | <div class="titlepage"><div><div><h3 class="title"> | | 2308 | <div class="titlepage"><div><div><h3 class="title"> |
2332 | <a name="bulk.var.warn"></a>8.4.5. Turn warnings into errors</h3></div></div></div> | | 2309 | <a name="bulk.var.warn"></a>8.4.4. Turn warnings into errors</h3></div></div></div> |
2333 | <p>When building a package, warnings are typically ignored since they | | 2310 | <p>When building a package, warnings are typically ignored since they |
2334 | just flow by and do not cause the build to fail immediately. To find | | 2311 | just flow by and do not cause the build to fail immediately. To find |
2335 | these warnings, redefine them to errors in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2312 | these warnings, redefine them to errors in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2336 | <pre class="programlisting"> | | 2313 | <pre class="programlisting"> |
2337 | DELAYED_WARNING_MSG= ${DELAYED_ERROR_MSG} "(was warning)" | | 2314 | DELAYED_WARNING_MSG= ${DELAYED_ERROR_MSG} "(was warning)" |
2338 | WARNING_MSG= ${FAIL_MSG} "(was warning)" | | 2315 | WARNING_MSG= ${FAIL_MSG} "(was warning)" |
2339 | </pre> | | 2316 | </pre> |
2340 | <p>(There are many more classes of warnings in pkgsrc, and most of | | 2317 | <p>(There are many more classes of warnings in pkgsrc, and most of |
2341 | them can be redefined with a simple definition like above.</p> | | 2318 | them can be redefined with a simple definition like above.</p> |
2342 | <p>If a package suggest to add <code class="varname">USE_TOOLS+=perl</code> to | | 2319 | <p>If a package suggests to add <code class="varname">USE_TOOLS+=perl</code> to |
2343 | the package Makefile, research whether the package actually needs Perl. | | 2320 | the package Makefile, research whether the package actually needs Perl. |
2344 | If it does, add <code class="varname">USE_TOOLS+=perl</code> to the package | | 2321 | If it does, add <code class="varname">USE_TOOLS+=perl</code> to the package |
2345 | Makefile, and if it doesn't, add | | 2322 | Makefile, and if it doesn't, add |
2346 | <code class="varname">TOOLS_BROKEN+=perl</code>.</p> | | 2323 | <code class="varname">TOOLS_BROKEN+=perl</code>.</p> |
2347 | </div> | | 2324 | </div> |
2348 | <div class="sect2"> | | 2325 | <div class="sect2"> |
2349 | <div class="titlepage"><div><div><h3 class="title"> | | 2326 | <div class="titlepage"><div><div><h3 class="title"> |
2350 | <a name="bulk.var.pkglint"></a>8.4.6. Reject packages for which pkglint reports errors</h3></div></div></div> | | 2327 | <a name="bulk.var.pkglint"></a>8.4.5. Reject packages for which pkglint reports errors</h3></div></div></div> |
2351 | <p>Using pkglint as part of the regular build process is mostly a | | 2328 | <p>Using pkglint as part of the regular build process is mostly a |
2352 | waste of time. If you want to fix some of the warnings, just run pkglint | | 2329 | waste of time. If you want to fix some of the warnings, just run pkglint |
2353 | recursively on the whole pkgsrc tree. This will take a few minutes (up to | | 2330 | recursively on the whole pkgsrc tree. This will take a few minutes (up to |
2354 | 10), which is much faster than a complete bulk build.</p> | | 2331 | 10), which is much faster than a complete bulk build.</p> |
2355 | </div> | | 2332 | </div> |
2356 | <div class="sect2"> | | 2333 | <div class="sect2"> |
2357 | <div class="titlepage"><div><div><h3 class="title"> | | 2334 | <div class="titlepage"><div><div><h3 class="title"> |
2358 | <a name="bulk.var.strings"></a>8.4.7. Reject packages that contain forbidden strings</h3></div></div></div> | | 2335 | <a name="bulk.var.strings"></a>8.4.6. Reject packages that contain forbidden strings</h3></div></div></div> |
2359 | <p>To ensure that the binary packages don't contain references to the | | 2336 | <p>To ensure that the binary packages don't contain references to the |
2360 | build directory, there is already <code class="varname">CHECK_WRKREF</code>. If | | 2337 | build directory, there is already <code class="varname">CHECK_WRKREF</code>. If |
2361 | that variable includes the item <code class="literal">extra</code>, it is | | 2338 | that variable includes the item <code class="literal">extra</code>, it is |
2362 | possible to define additional patterns that must not appear in any | | 2339 | possible to define additional patterns that must not appear in any |
2363 | installed file. This is specified in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2340 | installed file. This is specified in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2364 | <pre class="programlisting"> | | 2341 | <pre class="programlisting"> |
2365 | CHECK_WRKREF= extra | | 2342 | CHECK_WRKREF= extra |
2366 | CHECK_WRKREF_EXTRA_DIRS+= /usr/local | | 2343 | CHECK_WRKREF_EXTRA_DIRS+= /usr/local |
2367 | CHECK_WRKREF_EXTRA_DIRS+= /usr/pkg | | 2344 | CHECK_WRKREF_EXTRA_DIRS+= /usr/pkg |
2368 | CHECK_WRKREF_EXTRA_DIRS+= @[A-Z][A-Z]*@ | | 2345 | CHECK_WRKREF_EXTRA_DIRS+= @[A-Z][A-Z]*@ |
2369 | </pre> | | 2346 | </pre> |
2370 | <p>The above patterns will probably generate many false positives, | | 2347 | <p>The above patterns will probably generate many false positives, |
2371 | therefore the results need to be taken with a grain of salt.</p> | | 2348 | therefore the results need to be taken with a grain of salt.</p> |
2372 | </div> | | 2349 | </div> |
2373 | <div class="sect2"> | | 2350 | <div class="sect2"> |
2374 | <div class="titlepage"><div><div><h3 class="title"> | | 2351 | <div class="titlepage"><div><div><h3 class="title"> |
2375 | <a name="bulk.var.test"></a>8.4.8. Reject packages whose self-test fails</h3></div></div></div> | | 2352 | <a name="bulk.var.test"></a>8.4.7. Reject packages whose self-test fails</h3></div></div></div> |
2376 | <p>To run the test suites that come with each package, add this line | | 2353 | <p>To run the test suites that come with each package, add this line |
2377 | to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2354 | to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2378 | <pre class="programlisting"> | | 2355 | <pre class="programlisting"> |
2379 | PKGSRC_RUN_TEST= yes | | 2356 | PKGSRC_RUN_TEST= yes |
2380 | </pre> | | 2357 | </pre> |
2381 | <p>Be prepared that even the most basic packages fail this test. When | | 2358 | <p>Be prepared that even the most basic packages fail this test. When |
2382 | doing a bulk build with this, it will often abort in the early phase | | 2359 | doing a bulk build with this, it will often abort in the early phase |
2383 | where the packages are scanned for their dependencies since there are | | 2360 | where the packages are scanned for their dependencies since there are |
2384 | cyclic dependencies. There is still a lot to do in this area.</p> | | 2361 | cyclic dependencies. There is still a lot to do in this area.</p> |
2385 | </div> | | 2362 | </div> |
2386 | <div class="sect2"> | | 2363 | <div class="sect2"> |
2387 | <div class="titlepage"><div><div><h3 class="title"> | | 2364 | <div class="titlepage"><div><div><h3 class="title"> |
2388 | <a name="bulk.var.shvar"></a>8.4.9. Reject packages that use undefined shell variables</h3></div></div></div> | | 2365 | <a name="bulk.var.shvar"></a>8.4.8. Reject packages that use undefined shell variables</h3></div></div></div> |
2389 | <p>To catch typos in the shell snippets from the Makefile fragments, | | 2366 | <p>To catch typos in the shell snippets from the Makefile fragments, |
2390 | add the <code class="literal">-u</code> flag to most of the commands by adding this | | 2367 | add the <code class="literal">-u</code> flag to most of the commands by adding this |
2391 | line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2368 | line to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2392 | <pre class="programlisting"> | | 2369 | <pre class="programlisting"> |
2393 | RUN= @set -eu; | | 2370 | RUN= @set -eu; |
2394 | </pre> | | 2371 | </pre> |
2395 | <p>See <code class="filename">mk/misc/common.mk</code> for the existing | | 2372 | <p>See <code class="filename">mk/misc/common.mk</code> for the existing |
2396 | definition.</p> | | 2373 | definition.</p> |
2397 | </div> | | 2374 | </div> |
2398 | <div class="sect2"> | | 2375 | <div class="sect2"> |
2399 | <div class="titlepage"><div><div><h3 class="title"> | | 2376 | <div class="titlepage"><div><div><h3 class="title"> |
2400 | <a name="bulk.var.quiet"></a>8.4.10. Turn off verbose logging</h3></div></div></div> | | 2377 | <a name="bulk.var.quiet"></a>8.4.9. Turn off verbose logging</h3></div></div></div> |
2401 | <p>The build logs of a package are often quite long. This allows error | | 2378 | <p>The build logs of a package are often quite long. This allows error |
2402 | messages or other interesting details to hide between the noise. To make | | 2379 | messages or other interesting details to hide between the noise. To make |
2403 | the actual error message stand out more, add these lines to | | 2380 | the actual error message stand out more, add these lines to |
2404 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2381 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2405 | <pre class="programlisting"> | | 2382 | <pre class="programlisting"> |
2406 | GNU_CONFIGURE_QUIET= yes | | 2383 | GNU_CONFIGURE_QUIET= yes |
2407 | MAKE_FLAGS+= -s | | 2384 | MAKE_FLAGS+= -s |
2408 | </pre> | | 2385 | </pre> |
2409 | <p>The <code class="literal">-s</code> option works for both GNU Make and BSD | | 2386 | <p>The <code class="literal">-s</code> option works for both GNU Make and BSD |
2410 | Make. On exotic platforms with their own make, it may be a little | | 2387 | Make. On exotic platforms with their own make, it may be a little |
2411 | different.</p> | | 2388 | different.</p> |
2412 | </div> | | 2389 | </div> |
2413 | <div class="sect2"> | | | |
2414 | <div class="titlepage"><div><div><h3 class="title"> | | | |
2415 | <a name="bulk.var.options"></a>8.4.11. Select random sets of options</h3></div></div></div> | | | |
2416 | <p>Most bulk builds run with the default package options. This means | | | |
2417 | that other combinations of options are not regularly tested. To do this, | | | |
2418 | run a bulk build with these configurations.</p> | | | |
2419 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | | |
2420 | <li class="listitem"><p>no options enabled</p></li> | | | |
2421 | <li class="listitem"><p>all options enabled</p></li> | | | |
2422 | <li class="listitem"><p>2n + 0</p></li> | | | |
2423 | <li class="listitem"><p>2n + 1</p></li> | | | |
2424 | <li class="listitem"><p>4n + 0..1</p></li> | | | |
2425 | <li class="listitem"><p>4n + 2..3</p></li> | | | |
2426 | <li class="listitem"><p>8n + 0..3</p></li> | | | |
2427 | <li class="listitem"><p>8n + 4..7</p></li> | | | |
2428 | <li class="listitem"><p>2048n + 0..1023</p></li> | | | |
2429 | <li class="listitem"><p>2048n + 1024..2047</p></li> | | | |
2430 | </ul></div> | | | |
2431 | <p>Open questions are:</p> | | | |
2432 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | | |
2433 | <li class="listitem"><p>how to collect all options from the entire | | | |
2434 | pkgsrc</p></li> | | | |
2435 | <li class="listitem"><p>how to handle mutually exclusive | | | |
2436 | options</p></li> | | | |
2437 | <li class="listitem"><p>the sets of mutually exclusive options are defined | | | |
2438 | per-package</p></li> | | | |
2439 | <li class="listitem"><p>the sets of nonempty sets are defined | | | |
2440 | per-package</p></li> | | | |
2441 | </ul></div> | | | |
2442 | </div> | | | |
2443 | <div class="sect2"> | | | |
2444 | <div class="titlepage"><div><div><h3 class="title"> | | | |
2445 | <a name="bulk.var.build_defs"></a>8.4.12. Select random configurations of BUILD_DEFS</h3></div></div></div> | | | |
2446 | <p>Just like the <code class="varname">PKG_OPTIONS</code>, the | | | |
2447 | <code class="varname">BUILD_DEFS</code> also allow different variants of pkgsrc to | | | |
2448 | be created. The same ideas as in <a class="xref" href="#bulk.var.options" title="8.4.11. Select random sets of options">Section 8.4.11, “Select random sets of options”</a> | | | |
2449 | apply.</p> | | | |
2450 | </div> | | | |
2451 | </div> | | 2390 | </div> |
2452 | <div class="sect1"> | | 2391 | <div class="sect1"> |
2453 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2392 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2454 | <a name="creating-cdroms"></a>8.5. Creating a multiple CD-ROM packages collection</h2></div></div></div> | | 2393 | <a name="creating-cdroms"></a>8.5. Creating a multiple CD-ROM packages collection</h2></div></div></div> |
2455 | <p>After your pkgsrc bulk-build has completed, you may wish to | | 2394 | <p>After your pkgsrc bulk-build has completed, you may wish to |
2456 | create a CD-ROM set of the resulting binary packages to assist | | 2395 | create a CD-ROM set of the resulting binary packages to assist |
2457 | in installing packages on other machines. The | | 2396 | in installing packages on other machines. The |
2458 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/cdpack/README.html" target="_top"><code class="filename">pkgtools/cdpack</code></a> package provides | | 2397 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/cdpack/README.html" target="_top"><code class="filename">pkgtools/cdpack</code></a> package provides |
2459 | a simple tool for creating the ISO 9660 images. | | 2398 | a simple tool for creating the ISO 9660 images. |
2460 | <span class="command"><strong>cdpack</strong></span> arranges the packages on the CD-ROMs in a | | 2399 | <span class="command"><strong>cdpack</strong></span> arranges the packages on the CD-ROMs in a |
2461 | way that keeps all the dependencies for a given package on the same | | 2400 | way that keeps all the dependencies for a given package on the same |
2462 | CD as that package.</p> | | 2401 | CD as that package.</p> |
2463 | <div class="sect2"> | | 2402 | <div class="sect2"> |
2464 | <div class="titlepage"><div><div><h3 class="title"> | | 2403 | <div class="titlepage"><div><div><h3 class="title"> |
2465 | <a name="cdpack-example"></a>8.5.1. Example of cdpack</h3></div></div></div> | | 2404 | <a name="cdpack-example"></a>8.5.1. Example of cdpack</h3></div></div></div> |
2466 | <p>Complete documentation for cdpack is found in the cdpack(1) | | 2405 | <p>Complete documentation for cdpack is found in the cdpack(1) |
2467 | man page. The following short example assumes that the binary | | 2406 | man page. The following short example assumes that the binary |
2468 | packages are left in | | 2407 | packages are left in |
2469 | <code class="filename">/usr/pkgsrc/packages/All</code> and that | | 2408 | <code class="filename">/usr/pkgsrc/packages/All</code> and that |
2470 | sufficient disk space exists in <code class="filename">/u2</code> to | | 2409 | sufficient disk space exists in <code class="filename">/u2</code> to |
2471 | hold the ISO 9660 images.</p> | | 2410 | hold the ISO 9660 images.</p> |
2472 | <pre class="screen"> | | 2411 | <pre class="screen"> |
2473 | <code class="prompt">#</code> <strong class="userinput"><code>mkdir /u2/images</code></strong> | | 2412 | <code class="prompt">#</code> <strong class="userinput"><code>mkdir /u2/images</code></strong> |
2474 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add /usr/pkgsrc/packages/All/cdpack</code></strong> | | 2413 | <code class="prompt">#</code> <strong class="userinput"><code>pkg_add /usr/pkgsrc/packages/All/cdpack</code></strong> |
2475 | <code class="prompt">#</code> <strong class="userinput"><code>cdpack /usr/pkgsrc/packages/All /u2/images</code></strong> | | 2414 | <code class="prompt">#</code> <strong class="userinput"><code>cdpack /usr/pkgsrc/packages/All /u2/images</code></strong> |
2476 | </pre> | | 2415 | </pre> |
2477 | <p>If you wish to include a common set of files | | 2416 | <p>If you wish to include a common set of files |
2478 | (<code class="filename">COPYRIGHT</code>, <code class="filename">README</code>, | | 2417 | (<code class="filename">COPYRIGHT</code>, <code class="filename">README</code>, |
2479 | etc.) on each CD in the collection, then you need to create a | | 2418 | etc.) on each CD in the collection, then you need to create a |
2480 | directory which contains these files, e.g.:</p> | | 2419 | directory which contains these files, e.g.:</p> |
2481 | <pre class="screen"> | | 2420 | <pre class="screen"> |
2482 | <code class="prompt">#</code> <strong class="userinput"><code>mkdir /tmp/common</code></strong> | | 2421 | <code class="prompt">#</code> <strong class="userinput"><code>mkdir /tmp/common</code></strong> |
2483 | <code class="prompt">#</code> <strong class="userinput"><code>echo "This is a README" > /tmp/common/README</code></strong> | | 2422 | <code class="prompt">#</code> <strong class="userinput"><code>echo "This is a README" > /tmp/common/README</code></strong> |
2484 | <code class="prompt">#</code> <strong class="userinput"><code>echo "Another file" > /tmp/common/COPYING</code></strong> | | 2423 | <code class="prompt">#</code> <strong class="userinput"><code>echo "Another file" > /tmp/common/COPYING</code></strong> |
2485 | <code class="prompt">#</code> <strong class="userinput"><code>mkdir /tmp/common/bin</code></strong> | | 2424 | <code class="prompt">#</code> <strong class="userinput"><code>mkdir /tmp/common/bin</code></strong> |
2486 | <code class="prompt">#</code> <strong class="userinput"><code>echo "#!/bin/sh" > /tmp/common/bin/myscript</code></strong> | | 2425 | <code class="prompt">#</code> <strong class="userinput"><code>echo "#!/bin/sh" > /tmp/common/bin/myscript</code></strong> |
2487 | <code class="prompt">#</code> <strong class="userinput"><code>echo "echo Hello world" >> /tmp/common/bin/myscript</code></strong> | | 2426 | <code class="prompt">#</code> <strong class="userinput"><code>echo "echo Hello world" >> /tmp/common/bin/myscript</code></strong> |
2488 | <code class="prompt">#</code> <strong class="userinput"><code>chmod 755 /tmp/common/bin/myscript</code></strong> | | 2427 | <code class="prompt">#</code> <strong class="userinput"><code>chmod 755 /tmp/common/bin/myscript</code></strong> |
2489 | </pre> | | 2428 | </pre> |
2490 | <p>Now create the images:</p> | | 2429 | <p>Now create the images:</p> |
2491 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images</code></strong></pre> | | 2430 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images</code></strong></pre> |
2492 | <p>Each image will contain <code class="filename">README</code>, | | 2431 | <p>Each image will contain <code class="filename">README</code>, |
2493 | <code class="filename">COPYING</code>, and <code class="filename">bin/myscript</code> | | 2432 | <code class="filename">COPYING</code>, and <code class="filename">bin/myscript</code> |
2494 | in their root directories.</p> | | 2433 | in their root directories.</p> |
2495 | </div> | | 2434 | </div> |
2496 | </div> | | 2435 | </div> |
2497 | </div> | | 2436 | </div> |
2498 | <div class="chapter"> | | 2437 | <div class="chapter"> |
2499 | <div class="titlepage"><div><div><h2 class="title"> | | 2438 | <div class="titlepage"><div><div><h2 class="title"> |
2500 | <a name="files"></a>Chapter 9. Directory layout of the installed files</h2></div></div></div> | | 2439 | <a name="files"></a>Chapter 9. Directory layout of the installed files</h2></div></div></div> |
2501 | <div class="toc"> | | 2440 | <div class="toc"> |
2502 | <p><b>Table of Contents</b></p> | | 2441 | <p><b>Table of Contents</b></p> |
2503 | <dl class="toc"> | | 2442 | <dl class="toc"> |
2504 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> | | 2443 | <dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt> |
2505 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> | | 2444 | <dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt> |
2506 | </dl> | | 2445 | </dl> |
2507 | </div> | | 2446 | </div> |
2508 | <p>The files that are installed by pkgsrc are organized in a way that | | 2447 | <p>The files that are installed by pkgsrc are organized in a way that |
2509 | is similar to what you find in the <code class="filename">/usr</code> directory | | 2448 | is similar to what you find in the <code class="filename">/usr</code> directory |
2510 | of the base system. But some details are different. This is because | | 2449 | of the base system. But some details are different. This is because |
2511 | pkgsrc initially came from FreeBSD and had adopted its file system | | 2450 | pkgsrc initially came from FreeBSD and had adopted its file system |
2512 | hierarchy. Later it was largely influenced by NetBSD. But no matter | | 2451 | hierarchy. Later it was largely influenced by NetBSD. But no matter |
2513 | which operating system you are using pkgsrc with, you can expect the | | 2452 | which operating system you are using pkgsrc with, you can expect the |
2514 | same layout for pkgsrc.</p> | | 2453 | same layout for pkgsrc.</p> |
2515 | <p>There are mainly four root directories for pkgsrc, which are all | | 2454 | <p>There are mainly four root directories for pkgsrc, which are all |
2516 | configurable in the <code class="filename">bootstrap/bootstrap</code> script. | | 2455 | configurable in the <code class="filename">bootstrap/bootstrap</code> script. |
2517 | When pkgsrc has been installed as root, the default locations | | 2456 | When pkgsrc has been installed as root, the default locations |
2518 | are:</p> | | 2457 | are:</p> |
2519 | <pre class="programlisting"> | | 2458 | <pre class="programlisting"> |
2520 | LOCALBASE= /usr/pkg | | 2459 | LOCALBASE= /usr/pkg |
2521 | PKG_SYSCONFBASE= /usr/pkg/etc | | 2460 | PKG_SYSCONFBASE= /usr/pkg/etc |
2522 | VARBASE= /var | | 2461 | VARBASE= /var |
2523 | PKG_DBDIR= /usr/pkg/pkgdb | | 2462 | PKG_DBDIR= /usr/pkg/pkgdb |
2524 | </pre> | | 2463 | </pre> |
2525 | <p>In unprivileged mode (when pkgsrc has been installed as any other | | 2464 | <p>In unprivileged mode (when pkgsrc has been installed as any other |
2526 | user), the default locations are:</p> | | 2465 | user), the default locations are:</p> |
2527 | <pre class="programlisting"> | | 2466 | <pre class="programlisting"> |
2528 | LOCALBASE= ${HOME}/pkg | | 2467 | LOCALBASE= ${HOME}/pkg |
2529 | PKG_SYSCONFBASE= ${HOME}/pkg/etc | | 2468 | PKG_SYSCONFBASE= ${HOME}/pkg/etc |
2530 | VARBASE= ${HOME}/pkg/var | | 2469 | VARBASE= ${HOME}/pkg/var |
2531 | PKG_DBDIR= ${HOME}/pkg/pkgdb | | 2470 | PKG_DBDIR= ${HOME}/pkg/pkgdb |
2532 | </pre> | | 2471 | </pre> |
2533 | <p>What these four directories are for, and what they look like is | | 2472 | <p>What these four directories are for, and what they look like is |
2534 | explained below.</p> | | 2473 | explained below.</p> |
2535 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2474 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2536 | <li class="listitem"><p><code class="varname">LOCALBASE</code> corresponds to the | | 2475 | <li class="listitem"><p><code class="varname">LOCALBASE</code> corresponds to the |
2537 | <code class="filename">/usr</code> directory in the base system. It is the | | 2476 | <code class="filename">/usr</code> directory in the base system. It is the |
2538 | <span class="quote">“<span class="quote">main</span>”</span> directory where the files are installed and contains | | 2477 | <span class="quote">“<span class="quote">main</span>”</span> directory where the files are installed and contains |
2539 | the well-known subdirectories like <code class="filename">bin</code>, | | 2478 | the well-known subdirectories like <code class="filename">bin</code>, |
2540 | <code class="filename">include</code>, <code class="filename">lib</code>, | | 2479 | <code class="filename">include</code>, <code class="filename">lib</code>, |
2541 | <code class="filename">share</code> and | | 2480 | <code class="filename">share</code> and |
2542 | <code class="filename">sbin</code>.</p></li> | | 2481 | <code class="filename">sbin</code>.</p></li> |
2543 | <li class="listitem"><p><code class="varname">VARBASE</code> corresponds to | | 2482 | <li class="listitem"><p><code class="varname">VARBASE</code> corresponds to |
2544 | <code class="filename">/var</code> in the base system. Some programs (especially | | 2483 | <code class="filename">/var</code> in the base system. Some programs (especially |
2545 | games, network daemons) need write access to it during normal | | 2484 | games, network daemons) need write access to it during normal |
2546 | operation.</p></li> | | 2485 | operation.</p></li> |
2547 | <li class="listitem"><p><code class="varname">PKG_SYSCONFDIR</code> corresponds to | | 2486 | <li class="listitem"><p><code class="varname">PKG_SYSCONFDIR</code> corresponds to |
2548 | <code class="filename">/etc</code> in the base system. It contains configuration | | 2487 | <code class="filename">/etc</code> in the base system. It contains configuration |
2549 | files of the packages, as well as pkgsrc's <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> | | 2488 | files of the packages, as well as pkgsrc's <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> |
2550 | itself.</p></li> | | 2489 | itself.</p></li> |
2551 | </ul></div> | | 2490 | </ul></div> |
2552 | <div class="sect1"> | | 2491 | <div class="sect1"> |
2553 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2492 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2554 | <a name="files.localbase"></a>9.1. File system layout in <code class="literal">${LOCALBASE}</code> | | 2493 | <a name="files.localbase"></a>9.1. File system layout in <code class="literal">${LOCALBASE}</code> |
2555 | </h2></div></div></div> | | 2494 | </h2></div></div></div> |
2556 | <p>The following directories exist in a typical pkgsrc installation | | 2495 | <p>The following directories exist in a typical pkgsrc installation |
2557 | in <code class="filename">${LOCALBASE}</code>.</p> | | 2496 | in <code class="filename">${LOCALBASE}</code>.</p> |
2558 | <div class="variablelist"><dl class="variablelist"> | | 2497 | <div class="variablelist"><dl class="variablelist"> |
2559 | <dt><span class="term"><code class="filename">bin</code></span></dt> | | 2498 | <dt><span class="term"><code class="filename">bin</code></span></dt> |
2560 | <dd><p>Contains executable programs that are intended to be | | 2499 | <dd><p>Contains executable programs that are intended to be |
2561 | directly used by the end user.</p></dd> | | 2500 | directly used by the end user.</p></dd> |
2562 | <dt><span class="term"><code class="filename">emul</code></span></dt> | | 2501 | <dt><span class="term"><code class="filename">emul</code></span></dt> |
2563 | <dd><p>Contains files for the emulation layers of various other | | 2502 | <dd><p>Contains files for the emulation layers of various other |
2564 | operating systems, especially for | | 2503 | operating systems, especially for |
2565 | NetBSD.</p></dd> | | 2504 | NetBSD.</p></dd> |
2566 | <dt><span class="term"><code class="filename">etc</code> (the usual location of | | 2505 | <dt><span class="term"><code class="filename">etc</code> (the usual location of |
2567 | <code class="filename">${PKG_SYSCONFDIR}</code>)</span></dt> | | 2506 | <code class="filename">${PKG_SYSCONFDIR}</code>)</span></dt> |
2568 | <dd><p>Contains | | 2507 | <dd><p>Contains |
2569 | the configuration files.</p></dd> | | 2508 | the configuration files.</p></dd> |
2570 | <dt><span class="term"><code class="filename">include</code></span></dt> | | 2509 | <dt><span class="term"><code class="filename">include</code></span></dt> |
2571 | <dd><p>Contains headers for the C and C++ programming | | 2510 | <dd><p>Contains headers for the C and C++ programming |
2572 | languages.</p></dd> | | 2511 | languages.</p></dd> |
2573 | <dt><span class="term"><code class="filename">info</code></span></dt> | | 2512 | <dt><span class="term"><code class="filename">info</code></span></dt> |
2574 | <dd><p>Contains GNU info files of various | | 2513 | <dd><p>Contains GNU info files of various |
2575 | packages.</p></dd> | | 2514 | packages.</p></dd> |
2576 | <dt><span class="term"><code class="filename">lib</code></span></dt> | | 2515 | <dt><span class="term"><code class="filename">lib</code></span></dt> |
2577 | <dd><p>Contains shared and static | | 2516 | <dd><p>Contains shared and static |
2578 | libraries.</p></dd> | | 2517 | libraries.</p></dd> |
2579 | <dt><span class="term"><code class="filename">libdata</code></span></dt> | | 2518 | <dt><span class="term"><code class="filename">libdata</code></span></dt> |
2580 | <dd><p>Contains data files that don't change after | | 2519 | <dd><p>Contains data files that don't change after |
2581 | installation. Other data files belong into | | 2520 | installation. Other data files belong into |
2582 | <code class="filename">${VARBASE}</code>.</p></dd> | | 2521 | <code class="filename">${VARBASE}</code>.</p></dd> |
2583 | <dt><span class="term"><code class="filename">libexec</code></span></dt> | | 2522 | <dt><span class="term"><code class="filename">libexec</code></span></dt> |
2584 | <dd><p>Contains programs that are not intended to be used by | | 2523 | <dd><p>Contains programs that are not intended to be used by |
2585 | end users, such as helper programs or network | | 2524 | end users, such as helper programs or network |
2586 | daemons.</p></dd> | | 2525 | daemons.</p></dd> |
2587 | <dt><span class="term"><code class="filename">libexec/cgi-bin</code></span></dt> | | 2526 | <dt><span class="term"><code class="filename">libexec/cgi-bin</code></span></dt> |
2588 | <dd><p>Contains programs that are intended to be executed as | | 2527 | <dd><p>Contains programs that are intended to be executed as |
2589 | CGI scripts by a web server.</p></dd> | | 2528 | CGI scripts by a web server.</p></dd> |
2590 | <dt><span class="term"><code class="filename">man</code> (the usual value of | | 2529 | <dt><span class="term"><code class="filename">man</code> (the usual value of |
2591 | <code class="filename">${PKGMANDIR}</code>)</span></dt> | | 2530 | <code class="filename">${PKGMANDIR}</code>)</span></dt> |
2592 | <dd><p>Contains brief | | 2531 | <dd><p>Contains brief |
2593 | documentation in form of manual pages.</p></dd> | | 2532 | documentation in form of manual pages.</p></dd> |
2594 | <dt><span class="term"><code class="filename">sbin</code></span></dt> | | 2533 | <dt><span class="term"><code class="filename">sbin</code></span></dt> |
2595 | <dd><p>Contains programs that are intended to be used only by | | 2534 | <dd><p>Contains programs that are intended to be used only by |
2596 | the super-user.</p></dd> | | 2535 | the super-user.</p></dd> |
2597 | <dt><span class="term"><code class="filename">share</code></span></dt> | | 2536 | <dt><span class="term"><code class="filename">share</code></span></dt> |
2598 | <dd><p>Contains platform-independent data files that don't | | 2537 | <dd><p>Contains platform-independent data files that don't |
2599 | change after installation.</p></dd> | | 2538 | change after installation.</p></dd> |
2600 | <dt><span class="term"><code class="filename">share/doc</code></span></dt> | | 2539 | <dt><span class="term"><code class="filename">share/doc</code></span></dt> |
2601 | <dd><p>Contains documentation files provided by the | | 2540 | <dd><p>Contains documentation files provided by the |
2602 | packages.</p></dd> | | 2541 | packages.</p></dd> |
2603 | <dt><span class="term"><code class="filename">share/examples</code></span></dt> | | 2542 | <dt><span class="term"><code class="filename">share/examples</code></span></dt> |
2604 | <dd><p>Contains example files provided by the packages. Among | | 2543 | <dd><p>Contains example files provided by the packages. Among |
2605 | others, the original configuration files are saved here and copied to | | 2544 | others, the original configuration files are saved here and copied to |
2606 | <code class="filename">${PKG_SYSCONFDIR}</code> during | | 2545 | <code class="filename">${PKG_SYSCONFDIR}</code> during |
2607 | installation.</p></dd> | | 2546 | installation.</p></dd> |
2608 | <dt><span class="term"><code class="filename">share/examples/rc.d</code></span></dt> | | 2547 | <dt><span class="term"><code class="filename">share/examples/rc.d</code></span></dt> |
2609 | <dd><p>Contains the original files for rc.d | | 2548 | <dd><p>Contains the original files for rc.d |
2610 | scripts.</p></dd> | | 2549 | scripts.</p></dd> |
2611 | <dt><span class="term"><code class="filename">var</code> (the usual location of | | 2550 | <dt><span class="term"><code class="filename">var</code> (the usual location of |
2612 | <code class="filename">${VARBASE}</code>)</span></dt> | | 2551 | <code class="filename">${VARBASE}</code>)</span></dt> |
2613 | <dd><p>Contains files | | 2552 | <dd><p>Contains files |
2614 | that may be modified after | | 2553 | that may be modified after |
2615 | installation.</p></dd> | | 2554 | installation.</p></dd> |
2616 | </dl></div> | | 2555 | </dl></div> |
2617 | </div> | | 2556 | </div> |
2618 | <div class="sect1"> | | 2557 | <div class="sect1"> |
2619 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2558 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2620 | <a name="files.varbase"></a>9.2. File system layout in <code class="literal">${VARBASE}</code> | | 2559 | <a name="files.varbase"></a>9.2. File system layout in <code class="literal">${VARBASE}</code> |
2621 | </h2></div></div></div> | | 2560 | </h2></div></div></div> |
2622 | <div class="variablelist"><dl class="variablelist"> | | 2561 | <div class="variablelist"><dl class="variablelist"> |
2623 | <dt><span class="term"><code class="filename">db/pkg</code> (the usual location of | | 2562 | <dt><span class="term"><code class="filename">db/pkg</code> (the usual location of |
2624 | <code class="filename">${PKG_DBDIR}</code>)</span></dt> | | 2563 | <code class="filename">${PKG_DBDIR}</code>)</span></dt> |
2625 | <dd><p>Contains | | 2564 | <dd><p>Contains |
2626 | information about the currently installed | | 2565 | information about the currently installed |
2627 | packages.</p></dd> | | 2566 | packages.</p></dd> |
2628 | <dt><span class="term"><code class="filename">games</code></span></dt> | | 2567 | <dt><span class="term"><code class="filename">games</code></span></dt> |
2629 | <dd><p>Contains highscore | | 2568 | <dd><p>Contains highscore |
2630 | files.</p></dd> | | 2569 | files.</p></dd> |
2631 | <dt><span class="term"><code class="filename">log</code></span></dt> | | 2570 | <dt><span class="term"><code class="filename">log</code></span></dt> |
2632 | <dd><p>Contains log files.</p></dd> | | 2571 | <dd><p>Contains log files.</p></dd> |
2633 | <dt><span class="term"><code class="filename">run</code></span></dt> | | 2572 | <dt><span class="term"><code class="filename">run</code></span></dt> |
2634 | <dd><p>Contains informational files about daemons that are | | 2573 | <dd><p>Contains informational files about daemons that are |
2635 | currently running.</p></dd> | | 2574 | currently running.</p></dd> |
2636 | </dl></div> | | 2575 | </dl></div> |
2637 | </div> | | 2576 | </div> |
2638 | </div> | | 2577 | </div> |
2639 | <div class="chapter"> | | 2578 | <div class="chapter"> |
2640 | <div class="titlepage"><div><div><h2 class="title"> | | 2579 | <div class="titlepage"><div><div><h2 class="title"> |
2641 | <a name="faq"></a>Chapter 10. Frequently Asked Questions</h2></div></div></div> | | 2580 | <a name="faq"></a>Chapter 10. Frequently Asked Questions</h2></div></div></div> |
2642 | <div class="toc"> | | 2581 | <div class="toc"> |
2643 | <p><b>Table of Contents</b></p> | | 2582 | <p><b>Table of Contents</b></p> |
2644 | <dl class="toc"> | | 2583 | <dl class="toc"> |
2645 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> | | 2584 | <dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> |
2646 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> | | 2585 | <dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt> |
2647 | <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt> | | 2586 | <dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt> |
2648 | <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt> | | 2587 | <dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt> |
2649 | <dt><span class="sect1"><a href="#x.org-from-pkgsrc">10.5. How can I install/use modular X.org from pkgsrc?</a></span></dt> | | 2588 | <dt><span class="sect1"><a href="#x.org-from-pkgsrc">10.5. How can I install/use modular X.org from pkgsrc?</a></span></dt> |
2650 | <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt> | | 2589 | <dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt> |
2651 | <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt> | | 2590 | <dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt> |
2652 | <dt><span class="sect1"><a href="#passive-ftp">10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</a></span></dt> | | 2591 | <dt><span class="sect1"><a href="#passive-ftp">10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</a></span></dt> |
2653 | <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt> | | 2592 | <dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt> |
2654 | <dt><span class="sect1"><a href="#tmac.andoc-missing">10.10. What does <span class="quote">“<span class="quote">Don't know how to make | | 2593 | <dt><span class="sect1"><a href="#tmac.andoc-missing">10.10. What does <span class="quote">“<span class="quote">Don't know how to make |
2655 | /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt> | | 2594 | /usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt> |
2656 | <dt><span class="sect1"><a href="#bsd.own.mk-missing">10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</a></span></dt> | | 2595 | <dt><span class="sect1"><a href="#bsd.own.mk-missing">10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</a></span></dt> |
2657 | <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt> | | 2596 | <dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' with pkgsrc</a></span></dt> |
2658 | <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt> | | 2597 | <dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt> |
2659 | <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt> | | 2598 | <dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt> |
2660 | <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt> | | 2599 | <dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt> |
2661 | <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt> | | 2600 | <dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt> |
2662 | <dt><span class="sect1"><a href="#faq.rcs-conflicts">10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</a></span></dt> | | 2601 | <dt><span class="sect1"><a href="#faq.rcs-conflicts">10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</a></span></dt> |
2663 | </dl> | | 2602 | </dl> |
2664 | </div> | | 2603 | </div> |
2665 | <p>This section contains hints, tips & tricks on special things in | | 2604 | <p>This section contains hints, tips & tricks on special things in |
2666 | pkgsrc that we didn't find a better place for in the previous chapters, and | | 2605 | pkgsrc that we didn't find a better place for in the previous chapters, and |
2667 | it contains items for both pkgsrc users and developers.</p> | | 2606 | it contains items for both pkgsrc users and developers.</p> |
2668 | <div class="sect1"> | | 2607 | <div class="sect1"> |
2669 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2608 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2670 | <a name="mailing-list-pointers"></a>10.1. Are there any mailing lists for pkg-related discussion?</h2></div></div></div> | | 2609 | <a name="mailing-list-pointers"></a>10.1. Are there any mailing lists for pkg-related discussion?</h2></div></div></div> |
2671 | <p>The following mailing lists may be of interest to pkgsrc users:</p> | | 2610 | <p>The following mailing lists may be of interest to pkgsrc users:</p> |
2672 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2611 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2673 | <li class="listitem"><p><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#pkgsrc-users" target="_top">pkgsrc-users</a>: | | 2612 | <li class="listitem"><p><a class="ulink" href="http://www.NetBSD.org/mailinglists/index.html#pkgsrc-users" target="_top">pkgsrc-users</a>: |
2674 | This is a general purpose list for most issues regarding | | 2613 | This is a general purpose list for most issues regarding |
2675 | pkgsrc, regardless of platform, e.g. soliciting user help | | 2614 | pkgsrc, regardless of platform, e.g. soliciting user help |
2676 | for pkgsrc configuration, unexpected build failures, using | | 2615 | for pkgsrc configuration, unexpected build failures, using |
2677 | particular packages, upgrading pkgsrc installations, | | 2616 | particular packages, upgrading pkgsrc installations, |
2678 | questions regarding the pkgsrc release branches, etc. General announcements or | | 2617 | questions regarding the pkgsrc release branches, etc. General announcements or |
2679 | proposals for changes that impact the pkgsrc user community, | | 2618 | proposals for changes that impact the pkgsrc user community, |
2680 | e.g. major infrastructure changes, new features, package | | 2619 | e.g. major infrastructure changes, new features, package |
2681 | removals, etc., may also be posted.</p></li> | | 2620 | removals, etc., may also be posted.</p></li> |
2682 | <li class="listitem"><p><a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#pkgsrc-bulk" target="_top">pkgsrc-bulk</a>: | | 2621 | <li class="listitem"><p><a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#pkgsrc-bulk" target="_top">pkgsrc-bulk</a>: |
2683 | A list where the results of pkgsrc bulk builds are sent and | | 2622 | A list where the results of pkgsrc bulk builds are sent and |
2684 | discussed.</p></li> | | 2623 | discussed.</p></li> |
2685 | <li class="listitem"><p><a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#pkgsrc-changes" target="_top">pkgsrc-changes</a>: | | 2624 | <li class="listitem"><p><a class="ulink" href="https://www.NetBSD.org/mailinglists/index.html#pkgsrc-changes" target="_top">pkgsrc-changes</a>: |
2686 | This list is for those who are interested in getting a | | 2625 | This list is for those who are interested in getting a |
2687 | commit message for every change committed to pkgsrc. It is | | 2626 | commit message for every change committed to pkgsrc. It is |
2688 | also available in digest form, meaning one daily message | | 2627 | also available in digest form, meaning one daily message |
2689 | containing all commit messages for changes to the package | | 2628 | containing all commit messages for changes to the package |
2690 | source tree in that 24 hour period.</p></li> | | 2629 | source tree in that 24 hour period.</p></li> |
2691 | </ul></div> | | 2630 | </ul></div> |
2692 | <p>To subscribe, do:</p> | | 2631 | <p>To subscribe, do:</p> |
2693 | <pre class="programlisting"> | | 2632 | <pre class="programlisting"> |
2694 | <code class="prompt">%</code> echo subscribe <em class="replaceable"><code>listname</code></em> | mail majordomo@NetBSD.org | | 2633 | <code class="prompt">%</code> echo subscribe <em class="replaceable"><code>listname</code></em> | mail majordomo@NetBSD.org |
2695 | </pre> | | 2634 | </pre> |
2696 | <p>Archives for all these mailing lists are available from | | 2635 | <p>Archives for all these mailing lists are available from |
2697 | <a class="ulink" href="https://mail-index.NetBSD.org/" target="_top">https://mail-index.NetBSD.org/</a>.</p> | | 2636 | <a class="ulink" href="https://mail-index.NetBSD.org/" target="_top">https://mail-index.NetBSD.org/</a>.</p> |
2698 | </div> | | 2637 | </div> |
2699 | <div class="sect1"> | | 2638 | <div class="sect1"> |
2700 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2639 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2701 | <a name="faq-pkgtools"></a>10.2. Utilities for package management (pkgtools)</h2></div></div></div> | | 2640 | <a name="faq-pkgtools"></a>10.2. Utilities for package management (pkgtools)</h2></div></div></div> |
2702 | <p>The directory <code class="filename">pkgsrc/pkgtools</code> contains | | 2641 | <p>The directory <code class="filename">pkgsrc/pkgtools</code> contains |
2703 | a number of useful utilities for both users and developers of pkgsrc. This | | 2642 | a number of useful utilities for both users and developers of pkgsrc. This |
2704 | section attempts only to make the reader aware of some of the utilities and when | | 2643 | section attempts only to make the reader aware of some of the utilities and when |
2705 | they might be useful, and not to duplicate the documentation that comes | | 2644 | they might be useful, and not to duplicate the documentation that comes |
2706 | with each package.</p> | | 2645 | with each package.</p> |
2707 | <p>Utilities used by pkgsrc (automatically installed when needed):</p> | | 2646 | <p>Utilities used by pkgsrc (automatically installed when needed):</p> |
2708 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/x11-links/README.html" target="_top"><code class="filename">pkgtools/x11-links</code></a>: | | 2647 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/x11-links/README.html" target="_top"><code class="filename">pkgtools/x11-links</code></a>: |
2709 | Symlinks for use by buildlink.</p></li></ul></div> | | 2648 | Symlinks for use by buildlink.</p></li></ul></div> |
2710 | <p>OS tool augmentation (automatically installed when needed):</p> | | 2649 | <p>OS tool augmentation (automatically installed when needed):</p> |
2711 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2650 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2712 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/digest/README.html" target="_top"><code class="filename">pkgtools/digest</code></a>: | | 2651 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/digest/README.html" target="_top"><code class="filename">pkgtools/digest</code></a>: |
2713 | Calculates various kinds of checksums (including SHA3).</p></li> | | 2652 | Calculates various kinds of checksums (including SHA3).</p></li> |
2714 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/libnbcompat/README.html" target="_top"><code class="filename">pkgtools/libnbcompat</code></a>: | | 2653 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/libnbcompat/README.html" target="_top"><code class="filename">pkgtools/libnbcompat</code></a>: |
2715 | Compatibility library for pkgsrc tools.</p></li> | | 2654 | Compatibility library for pkgsrc tools.</p></li> |
2716 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/mtree/README.html" target="_top"><code class="filename">pkgtools/mtree</code></a>: Installed on | | 2655 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/mtree/README.html" target="_top"><code class="filename">pkgtools/mtree</code></a>: Installed on |
2717 | non-BSD systems due to lack of native mtree.</p></li> | | 2656 | non-BSD systems due to lack of native mtree.</p></li> |
2718 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a>: | | 2657 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a>: |
2719 | Up-to-date replacement for | | 2658 | Up-to-date replacement for |
2720 | <code class="filename">/usr/sbin/pkg_install</code>, or for use on operating | | 2659 | <code class="filename">/usr/sbin/pkg_install</code>, or for use on operating |
2721 | systems where pkg_install is not present.</p></li> | | 2660 | systems where pkg_install is not present.</p></li> |
2722 | </ul></div> | | 2661 | </ul></div> |
2723 | <p>Utilities used by pkgsrc (not automatically installed):</p> | | 2662 | <p>Utilities used by pkgsrc (not automatically installed):</p> |
2724 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2663 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2725 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_tarup/README.html" target="_top"><code class="filename">pkgtools/pkg_tarup</code></a>: | | 2664 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_tarup/README.html" target="_top"><code class="filename">pkgtools/pkg_tarup</code></a>: |
2726 | Create a binary package from an | | 2665 | Create a binary package from an |
2727 | already-installed package. Used by <span class="command"><strong>make replace</strong></span> to | | 2666 | already-installed package. Used by <span class="command"><strong>make replace</strong></span> to |
2728 | save the old package.</p></li> | | 2667 | save the old package.</p></li> |
2729 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/dfdisk/README.html" target="_top"><code class="filename">pkgtools/dfdisk</code></a>: | | 2668 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/dfdisk/README.html" target="_top"><code class="filename">pkgtools/dfdisk</code></a>: |
2730 | Adds extra functionality to pkgsrc, allowing it to fetch distfiles | | 2669 | Adds extra functionality to pkgsrc, allowing it to fetch distfiles |
2731 | from multiple locations. It currently supports the following | | 2670 | from multiple locations. It currently supports the following |
2732 | methods: multiple CD-ROMs and network FTP/HTTP connections.</p></li> | | 2671 | methods: multiple CD-ROMs and network FTP/HTTP connections.</p></li> |
2733 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/cpuflags/README.html" target="_top"><code class="filename">devel/cpuflags</code></a>: Determine | | 2672 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/cpuflags/README.html" target="_top"><code class="filename">devel/cpuflags</code></a>: Determine |
2734 | the best compiler flags to optimise code for your current | | 2673 | the best compiler flags to optimise code for your current |
2735 | CPU and compiler. </p></li> | | 2674 | CPU and compiler. </p></li> |
2736 | </ul></div> | | 2675 | </ul></div> |
2737 | <p>Utilities for keeping track of installed packages, being up to date, | | 2676 | <p>Utilities for keeping track of installed packages, being up to date, |
2738 | etc:</p> | | 2677 | etc:</p> |
2739 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2678 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2740 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgin/README.html" target="_top"><code class="filename">pkgtools/pkgin</code></a>: A package | | 2679 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgin/README.html" target="_top"><code class="filename">pkgtools/pkgin</code></a>: A package |
2741 | update tool similar to apt(1). Download, install, and upgrade | | 2680 | update tool similar to apt(1). Download, install, and upgrade |
2742 | binary packages easily.</p></li> | | 2681 | binary packages easily.</p></li> |
2743 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_chk/README.html" target="_top"><code class="filename">pkgtools/pkg_chk</code></a>: Reports on | | 2682 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_chk/README.html" target="_top"><code class="filename">pkgtools/pkg_chk</code></a>: Reports on |
2744 | packages whose installed versions do not match the latest pkgsrc | | 2683 | packages whose installed versions do not match the latest pkgsrc |
2745 | entries.</p></li> | | 2684 | entries.</p></li> |
2746 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdep/README.html" target="_top"><code class="filename">pkgtools/pkgdep</code></a>: Makes | | 2685 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdep/README.html" target="_top"><code class="filename">pkgtools/pkgdep</code></a>: Makes |
2747 | dependency graphs of packages, to aid in choosing a strategy for | | 2686 | dependency graphs of packages, to aid in choosing a strategy for |
2748 | updating.</p></li> | | 2687 | updating.</p></li> |
2749 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdepgraph/README.html" target="_top"><code class="filename">pkgtools/pkgdepgraph</code></a>: Makes | | 2688 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdepgraph/README.html" target="_top"><code class="filename">pkgtools/pkgdepgraph</code></a>: Makes |
2750 | graphs from the output of <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdep/README.html" target="_top"><code class="filename">pkgtools/pkgdep</code></a> (uses graphviz).</p></li> | | 2689 | graphs from the output of <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdep/README.html" target="_top"><code class="filename">pkgtools/pkgdep</code></a> (uses graphviz).</p></li> |
2751 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>: The | | 2690 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>: The |
2752 | pkglint(1) program checks a pkgsrc entry for errors.</p></li> | | 2691 | pkglint(1) program checks a pkgsrc entry for errors.</p></li> |
2753 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/lintpkgsrc/README.html" target="_top"><code class="filename">pkgtools/lintpkgsrc</code></a>: The lintpkgsrc(1) program | | 2692 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/lintpkgsrc/README.html" target="_top"><code class="filename">pkgtools/lintpkgsrc</code></a>: The lintpkgsrc(1) program |
2754 | does various checks on the complete pkgsrc system.</p></li> | | 2693 | does various checks on the complete pkgsrc system.</p></li> |
2755 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgsurvey/README.html" target="_top"><code class="filename">pkgtools/pkgsurvey</code></a>: Report what | | 2694 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgsurvey/README.html" target="_top"><code class="filename">pkgtools/pkgsurvey</code></a>: Report what |
2756 | packages you have installed.</p></li> | | 2695 | packages you have installed.</p></li> |
2757 | </ul></div> | | 2696 | </ul></div> |
2758 | <p>Utilities for people maintaining or creating individual packages:</p> | | 2697 | <p>Utilities for people maintaining or creating individual packages:</p> |
2759 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2698 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2760 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdiff/README.html" target="_top"><code class="filename">pkgtools/pkgdiff</code></a>: Automate | | 2699 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkgdiff/README.html" target="_top"><code class="filename">pkgtools/pkgdiff</code></a>: Automate |
2761 | making and maintaining patches for a package (includes pkgdiff, | | 2700 | making and maintaining patches for a package (includes pkgdiff, |
2762 | pkgvi, mkpatches, etc.).</p></li> | | 2701 | pkgvi, mkpatches, etc.).</p></li> |
2763 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/url2pkg/README.html" target="_top"><code class="filename">pkgtools/url2pkg</code></a>: Aids in | | 2702 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/url2pkg/README.html" target="_top"><code class="filename">pkgtools/url2pkg</code></a>: Aids in |
2764 | converting to pkgsrc.</p></li> | | 2703 | converting to pkgsrc.</p></li> |
2765 | </ul></div> | | 2704 | </ul></div> |
2766 | <p>Utilities for people maintaining pkgsrc (or: more obscure pkg | | 2705 | <p>Utilities for people maintaining pkgsrc (or: more obscure pkg |
2767 | utilities)</p> | | 2706 | utilities)</p> |
2768 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2707 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2769 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_comp/README.html" target="_top"><code class="filename">pkgtools/pkg_comp</code></a>: Build | | 2708 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_comp/README.html" target="_top"><code class="filename">pkgtools/pkg_comp</code></a>: Build |
2770 | packages in a chrooted area.</p></li> | | 2709 | packages in a chrooted area.</p></li> |
2771 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/libkver/README.html" target="_top"><code class="filename">pkgtools/libkver</code></a>: Spoof | | 2710 | <li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/libkver/README.html" target="_top"><code class="filename">pkgtools/libkver</code></a>: Spoof |
2772 | kernel version for chrooted cross builds.</p></li> | | 2711 | kernel version for chrooted cross builds.</p></li> |
2773 | </ul></div> | | 2712 | </ul></div> |
2774 | </div> | | 2713 | </div> |
2775 | <div class="sect1"> | | 2714 | <div class="sect1"> |
2776 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2715 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2777 | <a name="non-root-pkgsrc"></a>10.3. How to use pkgsrc as non-root</h2></div></div></div> | | 2716 | <a name="non-root-pkgsrc"></a>10.3. How to use pkgsrc as non-root</h2></div></div></div> |
2778 | <p>To install packages from source as a non-root user, download | | 2717 | <p>To install packages from source as a non-root user, download |
2779 | pkgsrc as described in <a class="xref" href="#getting" title="Chapter 3. Where to get pkgsrc and how to keep it up-to-date">Chapter 3, <i>Where to get pkgsrc and how to keep it up-to-date</i></a>, cd into that | | 2718 | pkgsrc as described in <a class="xref" href="#getting" title="Chapter 3. Where to get pkgsrc and how to keep it up-to-date">Chapter 3, <i>Where to get pkgsrc and how to keep it up-to-date</i></a>, cd into that |
2780 | directory and run the command <span class="command"><strong>./bootstrap/bootstrap | | 2719 | directory and run the command <span class="command"><strong>./bootstrap/bootstrap |
2781 | --unprivileged</strong></span>.</p> | | 2720 | --unprivileged</strong></span>.</p> |
2782 | <p>This will install the binary part of pkgsrc to | | 2721 | <p>This will install the binary part of pkgsrc to |
2783 | <code class="filename">~/pkg</code> and put the pkgsrc configuration <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> | | 2722 | <code class="filename">~/pkg</code> and put the pkgsrc configuration <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> |
2784 | into <code class="filename">~/pkg/etc</code>.</p> | | 2723 | into <code class="filename">~/pkg/etc</code>.</p> |
2785 | <p>For more details, see <code class="filename">mk/unprivileged.mk</code>.</p> | | 2724 | <p>For more details, see <code class="filename">mk/unprivileged.mk</code>.</p> |
2786 | </div> | | 2725 | </div> |
2787 | <div class="sect1"> | | 2726 | <div class="sect1"> |
2788 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2727 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2789 | <a name="resume-transfers"></a>10.4. How to resume transfers when fetching distfiles?</h2></div></div></div> | | 2728 | <a name="resume-transfers"></a>10.4. How to resume transfers when fetching distfiles?</h2></div></div></div> |
2790 | <p>By default, resuming transfers in pkgsrc is disabled, but you can | | 2729 | <p>By default, resuming transfers in pkgsrc is disabled, but you can |
2791 | enable this feature by adding the option | | 2730 | enable this feature by adding the option |
2792 | <code class="varname">PKG_RESUME_TRANSFERS=YES</code> into | | 2731 | <code class="varname">PKG_RESUME_TRANSFERS=YES</code> into |
2793 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. If, during a fetch step, an incomplete | | 2732 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>. If, during a fetch step, an incomplete |
2794 | distfile is found, pkgsrc will try to resume it.</p> | | 2733 | distfile is found, pkgsrc will try to resume it.</p> |
2795 | <p>You can also | | 2734 | <p>You can also |
2796 | use a different program than the platform default program by changing the | | 2735 | use a different program than the platform default program by changing the |
2797 | <code class="varname">FETCH_USING</code> variable. You can specify the program by | | 2736 | <code class="varname">FETCH_USING</code> variable. You can specify the program by |
2798 | using of ftp, fetch, wget or curl. Alternatively, fetching can be disabled | | 2737 | using of ftp, fetch, wget or curl. Alternatively, fetching can be disabled |
2799 | by using the value manual. A value of custom disables the system defaults | | 2738 | by using the value manual. A value of custom disables the system defaults |
2800 | and dependency tracking for the fetch program. In that case you have to | | 2739 | and dependency tracking for the fetch program. In that case you have to |
2801 | provide <code class="varname">FETCH_CMD</code>, <code class="varname">FETCH_BEFORE_ARGS</code>, | | 2740 | provide <code class="varname">FETCH_CMD</code>, <code class="varname">FETCH_BEFORE_ARGS</code>, |
2802 | <code class="varname">FETCH_RESUME_ARGS</code>, <code class="varname">FETCH_OUTPUT_ARGS</code>, | | 2741 | <code class="varname">FETCH_RESUME_ARGS</code>, <code class="varname">FETCH_OUTPUT_ARGS</code>, |
2803 | <code class="varname">FETCH_AFTER_ARGS</code>.</p> | | 2742 | <code class="varname">FETCH_AFTER_ARGS</code>.</p> |
2804 | <p>For example, if you want to use | | 2743 | <p>For example, if you want to use |
2805 | <code class="filename">wget</code> to download, you'll have to use something | | 2744 | <code class="filename">wget</code> to download, you'll have to use something |
2806 | like:</p> | | 2745 | like:</p> |
2807 | <pre class="programlisting"> | | 2746 | <pre class="programlisting"> |
2808 | FETCH_USING= wget | | 2747 | FETCH_USING= wget |
2809 | </pre> | | 2748 | </pre> |
2810 | </div> | | 2749 | </div> |
2811 | <div class="sect1"> | | 2750 | <div class="sect1"> |
2812 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2751 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2813 | <a name="x.org-from-pkgsrc"></a>10.5. How can I install/use modular X.org from pkgsrc?</h2></div></div></div> | | 2752 | <a name="x.org-from-pkgsrc"></a>10.5. How can I install/use modular X.org from pkgsrc?</h2></div></div></div> |
2814 | <p>If you want to use modular X.org from pkgsrc instead of your system's own X11 | | 2753 | <p>If you want to use modular X.org from pkgsrc instead of your system's own X11 |
2815 | (<code class="filename">/usr/X11R6</code>, <code class="filename">/usr/openwin</code>, ...) | | 2754 | (<code class="filename">/usr/X11R6</code>, <code class="filename">/usr/openwin</code>, ...) |
2816 | you will have to add the following line into | | 2755 | you will have to add the following line into |
2817 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p> | | 2756 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p> |
2818 | <pre class="programlisting"> | | 2757 | <pre class="programlisting"> |
2819 | X11_TYPE=modular | | 2758 | X11_TYPE=modular |
2820 | </pre> | | 2759 | </pre> |
2821 | </div> | | 2760 | </div> |
2822 | <div class="sect1"> | | 2761 | <div class="sect1"> |
2823 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2762 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2824 | <a name="fetch-behind-firewall"></a>10.6. How to fetch files from behind a firewall</h2></div></div></div> | | 2763 | <a name="fetch-behind-firewall"></a>10.6. How to fetch files from behind a firewall</h2></div></div></div> |
2825 | <p>If you are sitting behind a firewall which does not allow direct | | 2764 | <p>If you are sitting behind a firewall which does not allow direct |
2826 | connections to Internet hosts (i.e. non-NAT), you may specify the | | 2765 | connections to Internet hosts (i.e. non-NAT), you may specify the |
2827 | relevant proxy hosts. This is done using an environment variable in the | | 2766 | relevant proxy hosts. This is done using an environment variable in the |
2828 | form of a URL, e.g. in Amdahl, the machine | | 2767 | form of a URL, e.g. in Amdahl, the machine |
2829 | <span class="quote">“<span class="quote">orpheus.amdahl.com</span>”</span> is one of the firewalls, and it uses | | 2768 | <span class="quote">“<span class="quote">orpheus.amdahl.com</span>”</span> is one of the firewalls, and it uses |
2830 | port 80 as the proxy port number. So the proxy environment variables | | 2769 | port 80 as the proxy port number. So the proxy environment variables |
2831 | are:</p> | | 2770 | are:</p> |
2832 | <pre class="programlisting"> | | 2771 | <pre class="programlisting"> |
2833 | ftp_proxy=ftp://orpheus.amdahl.com:80/ | | 2772 | ftp_proxy=ftp://orpheus.amdahl.com:80/ |
2834 | http_proxy=http://orpheus.amdahl.com:80/ | | 2773 | http_proxy=http://orpheus.amdahl.com:80/ |
2835 | </pre> | | 2774 | </pre> |
2836 | </div> | | 2775 | </div> |
2837 | <div class="sect1"> | | 2776 | <div class="sect1"> |
2838 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2777 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2839 | <a name="fetch-https"></a>10.7. How to fetch files from HTTPS sites</h2></div></div></div> | | 2778 | <a name="fetch-https"></a>10.7. How to fetch files from HTTPS sites</h2></div></div></div> |
2840 | <p>Some fetch tools are not prepared to support HTTPS by default | | 2779 | <p>Some fetch tools are not prepared to support HTTPS by default |
2841 | (for example, the one in NetBSD 6.0), or the one installed by the | | 2780 | (for example, the one in NetBSD 6.0), or the one installed by the |
2842 | pkgsrc bootstrap (to avoid an openssl dependency that low in the | | 2781 | pkgsrc bootstrap (to avoid an openssl dependency that low in the |
2843 | dependency graph).</p> | | 2782 | dependency graph).</p> |
2844 | <p>Usually you won't notice, because distribution files are | | 2783 | <p>Usually you won't notice, because distribution files are |
2845 | mirrored weekly to <span class="quote">“<span class="quote">ftp.NetBSD.org</span>”</span>, but that might not | | 2784 | mirrored weekly to <span class="quote">“<span class="quote">ftp.NetBSD.org</span>”</span>, but that might not |
2846 | be often enough if you are following pkgsrc-current. In that case, set | | 2785 | be often enough if you are following pkgsrc-current. In that case, set |
2847 | <code class="varname">FETCH_USING</code> in your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file to | | 2786 | <code class="varname">FETCH_USING</code> in your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file to |
2848 | <span class="quote">“<span class="quote">curl</span>”</span> or <span class="quote">“<span class="quote">wget</span>”</span>, which are both compiled | | 2787 | <span class="quote">“<span class="quote">curl</span>”</span> or <span class="quote">“<span class="quote">wget</span>”</span>, which are both compiled |
2849 | with HTTPS support by default. Of course, these tools need to be | | 2788 | with HTTPS support by default. Of course, these tools need to be |
2850 | installed before you can use them this way.</p> | | 2789 | installed before you can use them this way.</p> |
2851 | </div> | | 2790 | </div> |
2852 | <div class="sect1"> | | 2791 | <div class="sect1"> |
2853 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2792 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2854 | <a name="passive-ftp"></a>10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</h2></div></div></div> | | 2793 | <a name="passive-ftp"></a>10.8. How do I tell <span class="command"><strong>make fetch</strong></span> to do passive FTP?</h2></div></div></div> |
2855 | <p>This depends on which utility is used to retrieve distfiles. From | | 2794 | <p>This depends on which utility is used to retrieve distfiles. From |
2856 | <code class="filename">bsd.pkg.mk</code>, <code class="varname">FETCH_CMD</code> is assigned | | 2795 | <code class="filename">bsd.pkg.mk</code>, <code class="varname">FETCH_CMD</code> is assigned |
2857 | the first available command from the following list:</p> | | 2796 | the first available command from the following list:</p> |
2858 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 2797 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
2859 | <li class="listitem"><p><code class="filename">${LOCALBASE}/bin/ftp</code></p></li> | | 2798 | <li class="listitem"><p><code class="filename">${LOCALBASE}/bin/ftp</code></p></li> |
2860 | <li class="listitem"><p><code class="filename">/usr/bin/ftp</code></p></li> | | 2799 | <li class="listitem"><p><code class="filename">/usr/bin/ftp</code></p></li> |
2861 | </ul></div> | | 2800 | </ul></div> |
2862 | <p>On a default NetBSD installation, this will be | | 2801 | <p>On a default NetBSD installation, this will be |
2863 | <code class="filename">/usr/bin/ftp</code>, which automatically tries passive | | 2802 | <code class="filename">/usr/bin/ftp</code>, which automatically tries passive |
2864 | connections first, and falls back to active connections if the server | | 2803 | connections first, and falls back to active connections if the server |
2865 | refuses to do passive. For the other tools, add the following to your | | 2804 | refuses to do passive. For the other tools, add the following to your |
2866 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file: | | 2805 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a> file: |
2867 | <code class="varname">PASSIVE_FETCH=1</code>.</p> | | 2806 | <code class="varname">PASSIVE_FETCH=1</code>.</p> |
2868 | <p>Having that option present will prevent | | 2807 | <p>Having that option present will prevent |
2869 | <code class="filename">/usr/bin/ftp</code> from falling back to active | | 2808 | <code class="filename">/usr/bin/ftp</code> from falling back to active |
2870 | transfers.</p> | | 2809 | transfers.</p> |
2871 | </div> | | 2810 | </div> |
2872 | <div class="sect1"> | | 2811 | <div class="sect1"> |
2873 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2812 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2874 | <a name="fetching-all-distfiles"></a>10.9. How to fetch all distfiles at once</h2></div></div></div> | | 2813 | <a name="fetching-all-distfiles"></a>10.9. How to fetch all distfiles at once</h2></div></div></div> |
2875 | <p>You would like to download all the distfiles in a single batch | | 2814 | <p>You would like to download all the distfiles in a single batch |
2876 | from work or university, where you can't run a <span class="command"><strong>make | | 2815 | from work or university, where you can't run a <span class="command"><strong>make |
2877 | fetch</strong></span>. There is an archive of distfiles on <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/" target="_top">ftp.NetBSD.org</a>, | | 2816 | fetch</strong></span>. There is an archive of distfiles on <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/" target="_top">ftp.NetBSD.org</a>, |
2878 | but downloading the entire directory may not be appropriate.</p> | | 2817 | but downloading the entire directory may not be appropriate.</p> |
2879 | <p>The answer here is to do a <span class="command"><strong>make fetch-list</strong></span> in | | 2818 | <p>The answer here is to do a <span class="command"><strong>make fetch-list</strong></span> in |
2880 | <code class="filename">/usr/pkgsrc</code> or one of its subdirectories, carry the | | 2819 | <code class="filename">/usr/pkgsrc</code> or one of its subdirectories, carry the |
2881 | resulting list to your machine at work/school and use it there. If you | | 2820 | resulting list to your machine at work/school and use it there. If you |
2882 | don't have a NetBSD-compatible <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?ftp+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">ftp</span>(1)</span></a> (like tnftp) at work, don't | | 2821 | don't have a NetBSD-compatible <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?ftp+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">ftp</span>(1)</span></a> (like tnftp) at work, don't |
2883 | forget to set <code class="varname">FETCH_CMD</code> to something that fetches a | | 2822 | forget to set <code class="varname">FETCH_CMD</code> to something that fetches a |
2884 | URL:</p> | | 2823 | URL:</p> |
2885 | <p>At home:</p> | | 2824 | <p>At home:</p> |
2886 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cd /usr/pkgsrc</code></strong> | | 2825 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>cd /usr/pkgsrc</code></strong> |
2887 | <code class="prompt">%</code> <strong class="userinput"><code>make fetch-list FETCH_CMD=wget DISTDIR=/tmp/distfiles >/tmp/fetch.sh</code></strong> | | 2826 | <code class="prompt">%</code> <strong class="userinput"><code>make fetch-list FETCH_CMD=wget DISTDIR=/tmp/distfiles >/tmp/fetch.sh</code></strong> |
2888 | <code class="prompt">%</code> <strong class="userinput"><code>scp /tmp/fetch.sh work:/tmp</code></strong></pre> | | 2827 | <code class="prompt">%</code> <strong class="userinput"><code>scp /tmp/fetch.sh work:/tmp</code></strong></pre> |
2889 | <p>At work:</p> | | 2828 | <p>At work:</p> |
2890 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>sh /tmp/fetch.sh</code></strong></pre> | | 2829 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>sh /tmp/fetch.sh</code></strong></pre> |
2891 | <p>then tar up <code class="filename">/tmp/distfiles</code> and take it | | 2830 | <p>then tar up <code class="filename">/tmp/distfiles</code> and take it |
2892 | home.</p> | | 2831 | home.</p> |
2893 | <p>If you have a machine running NetBSD, and you want to get | | 2832 | <p>If you have a machine running NetBSD, and you want to get |
2894 | <span class="emphasis"><em>all</em></span> distfiles (even ones that aren't for your | | 2833 | <span class="emphasis"><em>all</em></span> distfiles (even ones that aren't for your |
2895 | machine architecture), you can do so by using the above-mentioned | | 2834 | machine architecture), you can do so by using the above-mentioned |
2896 | <span class="command"><strong>make fetch-list</strong></span> approach, or fetch the distfiles | | 2835 | <span class="command"><strong>make fetch-list</strong></span> approach, or fetch the distfiles |
2897 | directly by running:</p> | | 2836 | directly by running:</p> |
2898 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make mirror-distfiles</code></strong></pre> | | 2837 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make mirror-distfiles</code></strong></pre> |
2899 | <p>If you even decide to ignore | | 2838 | <p>If you even decide to ignore |
2900 | <code class="varname">NO_{SRC,BIN}_ON_{FTP,CDROM}</code>, then you can get everything | | 2839 | <code class="varname">NO_{SRC,BIN}_ON_{FTP,CDROM}</code>, then you can get everything |
2901 | by running:</p> | | 2840 | by running:</p> |
2902 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make fetch NO_SKIP=yes</code></strong></pre> | | 2841 | <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>make fetch NO_SKIP=yes</code></strong></pre> |
2903 | </div> | | 2842 | </div> |
2904 | <div class="sect1"> | | 2843 | <div class="sect1"> |
2905 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2844 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2906 | <a name="tmac.andoc-missing"></a>10.10. What does <span class="quote">“<span class="quote">Don't know how to make | | 2845 | <a name="tmac.andoc-missing"></a>10.10. What does <span class="quote">“<span class="quote">Don't know how to make |
2907 | /usr/share/tmac/tmac.andoc</span>”</span> mean?</h2></div></div></div> | | 2846 | /usr/share/tmac/tmac.andoc</span>”</span> mean?</h2></div></div></div> |
2908 | <p>When compiling the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a> | | 2847 | <p>When compiling the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a> |
2909 | package, you get the error from make that it doesn't know how to make | | 2848 | package, you get the error from make that it doesn't know how to make |
2910 | <code class="filename">/usr/share/tmac/tmac.andoc</code>? This indicates that | | 2849 | <code class="filename">/usr/share/tmac/tmac.andoc</code>? This indicates that |
2911 | you don't have installed the <span class="quote">“<span class="quote">text</span>”</span> set (nroff, ...) from | | 2850 | you don't have installed the <span class="quote">“<span class="quote">text</span>”</span> set (nroff, ...) from |
2912 | the NetBSD base distribution on your machine. It is recommended to do | | 2851 | the NetBSD base distribution on your machine. It is recommended to do |
2913 | that to format man pages.</p> | | 2852 | that to format man pages.</p> |
2914 | <p>In the case of the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a> package, you | | 2853 | <p>In the case of the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a> package, you |
2915 | can get away with setting <code class="varname">NOMAN=YES</code> either in the | | 2854 | can get away with setting <code class="varname">NOMAN=YES</code> either in the |
2916 | environment or in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> | | 2855 | environment or in <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>.</p> |
2917 | </div> | | 2856 | </div> |
2918 | <div class="sect1"> | | 2857 | <div class="sect1"> |
2919 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2858 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2920 | <a name="bsd.own.mk-missing"></a>10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</h2></div></div></div> | | 2859 | <a name="bsd.own.mk-missing"></a>10.11. What does <span class="quote">“<span class="quote">Could not find bsd.own.mk</span>”</span> mean?</h2></div></div></div> |
2921 | <p>You didn't install the compiler set, <code class="filename">comp.tgz</code>, | | 2860 | <p>You didn't install the compiler set, <code class="filename">comp.tgz</code>, |
2922 | when you installed your NetBSD machine. Please get and install it, by | | 2861 | when you installed your NetBSD machine. Please get and install it, by |
2923 | extracting it in <code class="filename">/</code>:</p> | | 2862 | extracting it in <code class="filename">/</code>:</p> |
2924 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cd /</code></strong> | | 2863 | <pre class="screen"><code class="prompt">#</code> <strong class="userinput"><code>cd /</code></strong> |
2925 | <code class="prompt">#</code> <strong class="userinput"><code>tar --unlink -zxvpf .../comp.tgz</code></strong></pre> | | 2864 | <code class="prompt">#</code> <strong class="userinput"><code>tar --unlink -zxvpf .../comp.tgz</code></strong></pre> |
2926 | <p><code class="filename">comp.tgz</code> is part of every NetBSD release. Get | | 2865 | <p><code class="filename">comp.tgz</code> is part of every NetBSD release. Get |
2927 | the one that corresponds to your release (determine via <span class="command"><strong>uname | | 2866 | the one that corresponds to your release (determine via <span class="command"><strong>uname |
2928 | -r</strong></span>).</p> | | 2867 | -r</strong></span>).</p> |
2929 | </div> | | 2868 | </div> |
2930 | <div class="sect1"> | | 2869 | <div class="sect1"> |
2931 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2870 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2932 | <a name="using-sudo-with-pkgsrc"></a>10.12. Using 'sudo' with pkgsrc</h2></div></div></div> | | 2871 | <a name="using-sudo-with-pkgsrc"></a>10.12. Using 'sudo' with pkgsrc</h2></div></div></div> |
2933 | <p>When installing packages as non-root user and using the just-in-time | | 2872 | <p>When installing packages as non-root user and using the just-in-time |
2934 | <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?su+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">su</span>(1)</span></a> feature of pkgsrc, it can become annoying to type in the root | | 2873 | <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?su+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">su</span>(1)</span></a> feature of pkgsrc, it can become annoying to type in the root |
2935 | password for each required package installed. To avoid this, the sudo | | 2874 | password for each required package installed. To avoid this, the sudo |
2936 | package can be used, which does password caching over a limited time. To | | 2875 | package can be used, which does password caching over a limited time. To |
2937 | use it, install sudo (either as binary package or from | | 2876 | use it, install sudo (either as binary package or from |
2938 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/sudo/README.html" target="_top"><code class="filename">security/sudo</code></a>) and then put the | | 2877 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/security/sudo/README.html" target="_top"><code class="filename">security/sudo</code></a>) and then put the |
2939 | following into your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, somewhere | | 2878 | following into your <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, somewhere |
2940 | <span class="emphasis"><em>after</em></span> the definition of the | | 2879 | <span class="emphasis"><em>after</em></span> the definition of the |
2941 | <code class="varname">LOCALBASE</code> variable:</p> | | 2880 | <code class="varname">LOCALBASE</code> variable:</p> |
2942 | <pre class="programlisting"> | | 2881 | <pre class="programlisting"> |
2943 | .if exists(${LOCALBASE}/bin/sudo) | | 2882 | .if exists(${LOCALBASE}/bin/sudo) |
2944 | SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c | | 2883 | SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c |
2945 | .endif | | 2884 | .endif |
2946 | </pre> | | 2885 | </pre> |
2947 | </div> | | 2886 | </div> |
2948 | <div class="sect1"> | | 2887 | <div class="sect1"> |
2949 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2888 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2950 | <a name="faq.conf"></a>10.13. How do I change the location of configuration files?</h2></div></div></div> | | 2889 | <a name="faq.conf"></a>10.13. How do I change the location of configuration files?</h2></div></div></div> |
2951 | <p>As the system administrator, you can choose where configuration files | | 2890 | <p>As the system administrator, you can choose where configuration files |
2952 | are installed. The default settings make all these files go into | | 2891 | are installed. The default settings make all these files go into |
2953 | <code class="filename">${PREFIX}/etc</code> or some of its subdirectories; this may | | 2892 | <code class="filename">${PREFIX}/etc</code> or some of its subdirectories; this may |
2954 | be suboptimal depending on your expectations (e.g., a read-only, | | 2893 | be suboptimal depending on your expectations (e.g., a read-only, |
2955 | NFS-exported <code class="varname">PREFIX</code> with a need of per-machine | | 2894 | NFS-exported <code class="varname">PREFIX</code> with a need of per-machine |
2956 | configuration of the provided packages).</p> | | 2895 | configuration of the provided packages).</p> |
2957 | <p>In order to change the defaults, you can modify the | | 2896 | <p>In order to change the defaults, you can modify the |
2958 | <code class="varname">PKG_SYSCONFBASE</code> variable (in | | 2897 | <code class="varname">PKG_SYSCONFBASE</code> variable (in |
2959 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>) to point to your preferred configuration | | 2898 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>) to point to your preferred configuration |
2960 | directory; some common examples include <code class="filename">/etc</code> or | | 2899 | directory; some common examples include <code class="filename">/etc</code> or |
2961 | <code class="filename">/etc/pkg</code>.</p> | | 2900 | <code class="filename">/etc/pkg</code>.</p> |
2962 | <p>Furthermore, you can change this value on a per-package basis by | | 2901 | <p>Furthermore, you can change this value on a per-package basis by |
2963 | setting the <code class="varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code> variable. | | 2902 | setting the <code class="varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code> variable. |
2964 | <code class="varname">PKG_SYSCONFVAR</code>'s value usually matches the name of the | | 2903 | <code class="varname">PKG_SYSCONFVAR</code>'s value usually matches the name of the |
2965 | package you would like to modify, that is, the contents of | | 2904 | package you would like to modify, that is, the contents of |
2966 | <code class="varname">PKGBASE</code>.</p> | | 2905 | <code class="varname">PKGBASE</code>.</p> |
2967 | <p>Note that after changing these settings, you must rebuild and | | 2906 | <p>Note that after changing these settings, you must rebuild and |
2968 | reinstall any affected packages.</p> | | 2907 | reinstall any affected packages.</p> |
2969 | </div> | | 2908 | </div> |
2970 | <div class="sect1"> | | 2909 | <div class="sect1"> |
2971 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2910 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
2972 | <a name="audit-packages"></a>10.14. Automated security checks</h2></div></div></div> | | 2911 | <a name="audit-packages"></a>10.14. Automated security checks</h2></div></div></div> |
2973 | <p>Please be aware that there can often be bugs in third-party software, | | 2912 | <p>Please be aware that there can often be bugs in third-party software, |
2974 | and some of these bugs can leave a machine vulnerable to exploitation by | | 2913 | and some of these bugs can leave a machine vulnerable to exploitation by |
2975 | attackers. In an effort to lessen the exposure, the NetBSD packages team | | 2914 | attackers. In an effort to lessen the exposure, the NetBSD packages team |
2976 | maintains a database of known-exploits to packages which have at one time | | 2915 | maintains a database of known-exploits to packages which have at one time |
2977 | been included in pkgsrc. The database can be downloaded automatically, and | | 2916 | been included in pkgsrc. The database can be downloaded automatically, and |
2978 | a security audit of all packages installed on a system can take place. To | | 2917 | a security audit of all packages installed on a system can take place. To |
2979 | do this, refer to the following two tools (installed as part of the | | 2918 | do this, refer to the following two tools (installed as part of the |
2980 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a> package):</p> | | 2919 | <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkg_install/README.html" target="_top"><code class="filename">pkgtools/pkg_install</code></a> package):</p> |
2981 | <div class="orderedlist"><ol class="orderedlist" type="1"> | | 2920 | <div class="orderedlist"><ol class="orderedlist" type="1"> |
2982 | <li class="listitem"> | | 2921 | <li class="listitem"> |
2983 | <p><span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, an easy way to | | 2922 | <p><span class="command"><strong>pkg_admin fetch-pkg-vulnerabilities</strong></span>, an easy way to |
2984 | download a list of the security vulnerabilities information. This list | | 2923 | download a list of the security vulnerabilities information. This list |
2985 | is kept up to date by the pkgsrc security team, and is distributed | | 2924 | is kept up to date by the pkgsrc security team, and is distributed |
2986 | from the NetBSD ftp server:</p> | | 2925 | from the NetBSD ftp server:</p> |
2987 | <p><a class="ulink" href="https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities" target="_top">https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities</a></p> | | 2926 | <p><a class="ulink" href="https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities" target="_top">https://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities</a></p> |
2988 | </li> | | 2927 | </li> |
2989 | <li class="listitem"><p><span class="command"><strong>pkg_admin audit</strong></span>, an easy way to audit the | | 2928 | <li class="listitem"><p><span class="command"><strong>pkg_admin audit</strong></span>, an easy way to audit the |
2990 | current machine, checking each known vulnerability. If a | | 2929 | current machine, checking each known vulnerability. If a |
2991 | vulnerable package is installed, it will be shown by output to stdout, | | 2930 | vulnerable package is installed, it will be shown by output to stdout, |
2992 | including a description of the type of vulnerability, and a URL | | 2931 | including a description of the type of vulnerability, and a URL |
2993 | containing more information.</p></li> | | 2932 | containing more information.</p></li> |
2994 | </ol></div> | | 2933 | </ol></div> |
2995 | <p>Use of these tools is strongly recommended! | | 2934 | <p>Use of these tools is strongly recommended! |
2996 | See <a class="xref" href="#vulnerabilities" title="5.1.5. Checking for security vulnerabilities in installed packages">Section 5.1.5, “Checking for security vulnerabilities in installed packages”</a> for instructions on how to automate checking and | | 2935 | See <a class="xref" href="#vulnerabilities" title="5.1.5. Checking for security vulnerabilities in installed packages">Section 5.1.5, “Checking for security vulnerabilities in installed packages”</a> for instructions on how to automate checking and |
2997 | reporting.</p> | | 2936 | reporting.</p> |
2998 | <p>If this database is installed, pkgsrc builds will use it to | | 2937 | <p>If this database is installed, pkgsrc builds will use it to |
2999 | perform a security check before building any package.</p> | | 2938 | perform a security check before building any package.</p> |
3000 | </div> | | 2939 | </div> |
3001 | <div class="sect1"> | | 2940 | <div class="sect1"> |
3002 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2941 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
3003 | <a name="ufaq-cflags"></a>10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</h2></div></div></div> | | 2942 | <a name="ufaq-cflags"></a>10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</h2></div></div></div> |
3004 | <p>When you add your own preferences to the | | 2943 | <p>When you add your own preferences to the |
3005 | <code class="varname">CFLAGS</code> variable in your | | 2944 | <code class="varname">CFLAGS</code> variable in your |
3006 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, these flags are passed in | | 2945 | <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>, these flags are passed in |
3007 | environment variables to the <code class="filename">./configure</code> | | 2946 | environment variables to the <code class="filename">./configure</code> |
3008 | scripts and to <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>. Some package authors ignore the | | 2947 | scripts and to <a class="citerefentry" href="https://netbsd.gw.com/cgi-bin/man-cgi?make+1.i386+NetBSD-9.0"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a>. Some package authors ignore the |
3009 | <code class="varname">CFLAGS</code> from the environment variable by | | 2948 | <code class="varname">CFLAGS</code> from the environment variable by |
3010 | overriding them in the <code class="filename">Makefile</code>s of their | | 2949 | overriding them in the <code class="filename">Makefile</code>s of their |
3011 | package.</p> | | 2950 | package.</p> |
3012 | <p>Currently there is no solution to this problem. If you | | 2951 | <p>Currently there is no solution to this problem. If you |
3013 | really need the package to use your <code class="varname">CFLAGS</code> | | 2952 | really need the package to use your <code class="varname">CFLAGS</code> |
3014 | you should run <span class="command"><strong>make patch</strong></span> in the package | | 2953 | you should run <span class="command"><strong>make patch</strong></span> in the package |
3015 | directory and then inspect any <code class="filename">Makefile</code> and | | 2954 | directory and then inspect any <code class="filename">Makefile</code> and |
3016 | <code class="filename">Makefile.in</code> for whether they define | | 2955 | <code class="filename">Makefile.in</code> for whether they define |
3017 | <code class="varname">CFLAGS</code> explicitly. Usually you can remove | | 2956 | <code class="varname">CFLAGS</code> explicitly. Usually you can remove |
3018 | these lines. But be aware that some <span class="quote">“<span class="quote">smart</span>”</span> | | 2957 | these lines. But be aware that some <span class="quote">“<span class="quote">smart</span>”</span> |
3019 | programmers write so bad code that it only works for the | | 2958 | programmers write so bad code that it only works for the |
3020 | specific combination of <code class="varname">CFLAGS</code> they have | | 2959 | specific combination of <code class="varname">CFLAGS</code> they have |
3021 | chosen.</p> | | 2960 | chosen.</p> |
3022 | <p>To find out where the CFLAGS are ignored, add the following lines to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p> | | 2961 | <p>To find out where the CFLAGS are ignored, add the following lines to <a class="link" href="#mk.conf"><code class="filename">mk.conf</code></a>:</p> |
3023 | <pre class="programlisting"> | | 2962 | <pre class="programlisting"> |
3024 | CPPFLAGS+= -Dpkgsrc___CPPFLAGS | | 2963 | CPPFLAGS+= -Dpkgsrc___CPPFLAGS |
3025 | CFLAGS+= -Dpkgsrc___CFLAGS | | 2964 | CFLAGS+= -Dpkgsrc___CFLAGS |
3026 | CXXFLAGS+= -Dpkgsrc___CXXFLAGS | | 2965 | CXXFLAGS+= -Dpkgsrc___CXXFLAGS |
3027 | </pre> | | 2966 | </pre> |
3028 | <p>Then run <span class="command"><strong>bmake show-all-configure show-all-build</strong></span> | | 2967 | <p>Then run <span class="command"><strong>bmake show-all-configure show-all-build</strong></span> |
3029 | to see whether the above flags are passed to the actual build | | 2968 | to see whether the above flags are passed to the actual build |
3030 | commands in general.</p> | | 2969 | commands in general.</p> |
3031 | <p>To find out whether the flags are passed to individual compiler | | 2970 | <p>To find out whether the flags are passed to individual compiler |
3032 | commands, have a look at the file <code class="filename">work/.work.log</code>. In | | 2971 | commands, have a look at the file <code class="filename">work/.work.log</code>. In |
3033 | most cases, the flags from the original command lines (the lines starting | | 2972 | most cases, the flags from the original command lines (the lines starting |
3034 | with <code class="literal">[*]</code>) are passed unmodified to the actual compiler | | 2973 | with <code class="literal">[*]</code>) are passed unmodified to the actual compiler |
3035 | (the lines starting with <code class="literal"><.></code>). If the flag is | | 2974 | (the lines starting with <code class="literal"><.></code>). If the flag is |
3036 | missing from the actual compiler command, it must have been removed by | | 2975 | missing from the actual compiler command, it must have been removed by |
3037 | the <a class="link" href="#build.wrapper" title="19.10. The wrapper phase">pkgsrc compiler wrappers</a>.</p> | | 2976 | the <a class="link" href="#build.wrapper" title="19.10. The wrapper phase">pkgsrc compiler wrappers</a>.</p> |
3038 | </div> | | 2977 | </div> |
3039 | <div class="sect1"> | | 2978 | <div class="sect1"> |
3040 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 2979 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
3041 | <a name="ufaq-fail"></a>10.16. A package does not build. What shall I do?</h2></div></div></div> | | 2980 | <a name="ufaq-fail"></a>10.16. A package does not build. What shall I do?</h2></div></div></div> |
3042 | <div class="procedure"><ol class="procedure" type="1"> | | 2981 | <div class="procedure"><ol class="procedure" type="1"> |
3043 | <li class="step"><p>Make sure that your copy of pkgsrc is consistent. A | | 2982 | <li class="step"><p>Make sure that your copy of pkgsrc is consistent. A |
3044 | case that occurs often is that people only update pkgsrc in | | 2983 | case that occurs often is that people only update pkgsrc in |
3045 | parts, because of performance reasons. Since pkgsrc is one large | | 2984 | parts, because of performance reasons. Since pkgsrc is one large |
3046 | system, not a collection of many small systems, there are | | 2985 | system, not a collection of many small systems, there are |
3047 | sometimes changes that only work when the whole pkgsrc tree is | | 2986 | sometimes changes that only work when the whole pkgsrc tree is |
3048 | updated.</p></li> | | 2987 | updated.</p></li> |
3049 | <li class="step"><p>Make sure that you don't have any CVS conflicts. | | 2988 | <li class="step"><p>Make sure that you don't have any CVS conflicts. |
3050 | Search for <span class="quote">“<span class="quote"><<<<<<</span>”</span> or | | 2989 | Search for <span class="quote">“<span class="quote"><<<<<<</span>”</span> or |
3051 | <span class="quote">“<span class="quote">>>>>>></span>”</span> in all your pkgsrc | | 2990 | <span class="quote">“<span class="quote">>>>>>></span>”</span> in all your pkgsrc |
3052 | files.</p></li> | | 2991 | files.</p></li> |
3053 | <li class="step"><p>Make sure that you don't have old copies of the packages | | 2992 | <li class="step"><p>Make sure that you don't have old copies of the packages |
3054 | extracted. Run <span class="command"><strong>make clean clean-depends</strong></span> to | | 2993 | extracted. Run <span class="command"><strong>make clean clean-depends</strong></span> to |
3055 | verify this.</p></li> | | 2994 | verify this.</p></li> |
3056 | <li class="step"><p>If you are a package developer who wants to invest | | 2995 | <li class="step"><p>If you are a package developer who wants to invest |
3057 | some work, have a look at <a class="xref" href="#fixes" title="Chapter 21. Making your package work">Chapter 21, <i>Making your package work</i></a>.</p></li> | | 2996 | some work, have a look at <a class="xref" href="#fixes" title="Chapter 21. Making your package work">Chapter 21, <i>Making your package work</i></a>.</p></li> |
3058 | <li class="step"><p>If the problem still exists, write a mail to the | | 2997 | <li class="step"><p>If the problem still exists, write a mail to the |
3059 | <code class="literal">pkgsrc-users</code> mailing list.</p></li> | | 2998 | <code class="literal">pkgsrc-users</code> mailing list.</p></li> |
3060 | </ol></div> | | 2999 | </ol></div> |
3061 | </div> | | 3000 | </div> |
3062 | <div class="sect1"> | | 3001 | <div class="sect1"> |
3063 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | | 3002 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
3064 | <a name="faq.rcs-conflicts"></a>10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</h2></div></div></div> | | 3003 | <a name="faq.rcs-conflicts"></a>10.17. What does <span class="quote">“<span class="quote">Makefile appears to contain unresolved cvs/rcs/??? merge conflicts</span>”</span> mean?</h2></div></div></div> |
3065 | <p>You have modified a file from pkgsrc, and someone else has | | 3004 | <p>You have modified a file from pkgsrc, and someone else has |
3066 | modified that same file afterwards in the CVS repository. Both changes | | 3005 | modified that same file afterwards in the CVS repository. Both changes |
3067 | are in the same region of the file, so when you updated pkgsrc, the | | 3006 | are in the same region of the file, so when you updated pkgsrc, the |
3068 | <code class="literal">cvs</code> command marked the conflicting changes in the | | 3007 | <code class="literal">cvs</code> command marked the conflicting changes in the |
3069 | file. Because of these markers, the file is no longer a valid | | 3008 | file. Because of these markers, the file is no longer a valid |
3070 | <code class="filename">Makefile</code>.</p> | | 3009 | <code class="filename">Makefile</code>.</p> |
3071 | <p>Have a look at that file, and if you don't need your local changes | | 3010 | <p>Have a look at that file, and if you don't need your local changes |
3072 | anymore, you can remove that file and run <span class="command"><strong>cvs -q update | | 3011 | anymore, you can remove that file and run <span class="command"><strong>cvs -q update |
3073 | -dP</strong></span> in that directory to download the current version.</p> | | 3012 | -dP</strong></span> in that directory to download the current version.</p> |
3074 | </div> | | 3013 | </div> |
3075 | </div> | | 3014 | </div> |
3076 | </div> | | 3015 | </div> |
3077 | <div class="part"> | | 3016 | <div class="part"> |
3078 | <div class="titlepage"><div><div><h1 class="title"> | | 3017 | <div class="titlepage"><div><div><h1 class="title"> |
3079 | <a name="developers-guide"></a>Part II. The pkgsrc developer's guide</h1></div></div></div> | | 3018 | <a name="developers-guide"></a>Part II. The pkgsrc developer's guide</h1></div></div></div> |
3080 | <div class="partintro"> | | 3019 | <div class="partintro"> |
3081 | <div></div> | | 3020 | <div></div> |
3082 | <p>This part of the book deals with creating and | | 3021 | <p>This part of the book deals with creating and |
3083 | modifying packages. It starts with a <span class="quote">“<span class="quote">HOWTO</span>”</span>-like | | 3022 | modifying packages. It starts with a <span class="quote">“<span class="quote">HOWTO</span>”</span>-like |
3084 | guide on creating a new package. The remaining chapters are more | | 3023 | guide on creating a new package. The remaining chapters are more |
3085 | like a reference manual for pkgsrc.</p> | | 3024 | like a reference manual for pkgsrc.</p> |
3086 | <div class="toc"> | | 3025 | <div class="toc"> |
3087 | <p><b>Table of Contents</b></p> | | 3026 | <p><b>Table of Contents</b></p> |
3088 | <dl class="toc"> | | 3027 | <dl class="toc"> |
3089 | <dt><span class="chapter"><a href="#help-devel">11. Getting help</a></span></dt> | | 3028 | <dt><span class="chapter"><a href="#help-devel">11. Getting help</a></span></dt> |
3090 | <dt><span class="chapter"><a href="#creating">12. Creating a new pkgsrc package from scratch</a></span></dt> | | 3029 | <dt><span class="chapter"><a href="#creating">12. Creating a new pkgsrc package from scratch</a></span></dt> |
3091 | <dd><dl> | | 3030 | <dd><dl> |
3092 | <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt> | | 3031 | <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt> |
3093 | <dd><dl> | | 3032 | <dd><dl> |
3094 | <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt> | | 3033 | <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt> |
3095 | <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt> | | 3034 | <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt> |
3096 | <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt> | | 3035 | <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt> |
3097 | <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt> | | 3036 | <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt> |
3098 | </dl></dd> | | 3037 | </dl></dd> |
3099 | <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt> | | 3038 | <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt> |
3100 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">12.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> | | 3039 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">12.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> |
3101 | </dl></dd> | | 3040 | </dl></dd> |
3102 | <dt><span class="chapter"><a href="#components">13. Package components - files, directories and contents</a></span></dt> | | 3041 | <dt><span class="chapter"><a href="#components">13. Package components - files, directories and contents</a></span></dt> |
3103 | <dd><dl> | | 3042 | <dd><dl> |
3104 | <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt> | | 3043 | <dt><span class="sect1"><a href="#components.Makefile">13.1. <code class="filename">Makefile</code></a></span></dt> |
3105 | <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt> | | 3044 | <dt><span class="sect1"><a href="#components.distinfo">13.2. <code class="filename">distinfo</code></a></span></dt> |
3106 | <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt> | | 3045 | <dt><span class="sect1"><a href="#components.patches">13.3. <code class="filename">patches/*</code></a></span></dt> |
3107 | <dd><dl> | | 3046 | <dd><dl> |
3108 | <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt> | | 3047 | <dt><span class="sect2"><a href="#components.patch.structure">13.3.1. Structure of a single patch file</a></span></dt> |
3109 | <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt> | | 3048 | <dt><span class="sect2"><a href="#components.patches.caveats">13.3.2. Creating patch files</a></span></dt> |
3110 | <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt> | | 3049 | <dt><span class="sect2"><a href="#components.patches.sources">13.3.3. Sources where the patch files come from</a></span></dt> |
3111 | <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt> | | 3050 | <dt><span class="sect2"><a href="#components.patches.guidelines">13.3.4. Patching guidelines</a></span></dt> |
3112 | <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt> | | 3051 | <dt><span class="sect2"><a href="#components.patches.feedback">13.3.5. Feedback to the author</a></span></dt> |
3113 | </dl></dd> | | 3052 | </dl></dd> |
3114 | <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt> | | 3053 | <dt><span class="sect1"><a href="#other-mandatory-files">13.4. Other mandatory files</a></span></dt> |
3115 | <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt> | | 3054 | <dt><span class="sect1"><a href="#components.optional">13.5. Optional files</a></span></dt> |
3116 | <dd><dl> | | 3055 | <dd><dl> |
3117 | <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt> | | 3056 | <dt><span class="sect2"><a href="#components.optional.bin">13.5.1. Files affecting the binary package</a></span></dt> |
3118 | <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt> | | 3057 | <dt><span class="sect2"><a href="#components.optional.build">13.5.2. Files affecting the build process</a></span></dt> |
3119 | <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt> | | 3058 | <dt><span class="sect2"><a href="#components.optional.none">13.5.3. Files affecting nothing at all</a></span></dt> |
3120 | </dl></dd> | | 3059 | </dl></dd> |
3121 | <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt> | | 3060 | <dt><span class="sect1"><a href="#work-dir">13.6. <code class="filename">work*</code></a></span></dt> |
3122 | <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt> | | 3061 | <dt><span class="sect1"><a href="#files-dir">13.7. <code class="filename">files/*</code></a></span></dt> |
3123 | </dl></dd> | | 3062 | </dl></dd> |
3124 | <dt><span class="chapter"><a href="#makefile">14. Programming in <code class="filename">Makefile</code>s</a></span></dt> | | 3063 | <dt><span class="chapter"><a href="#makefile">14. Programming in <code class="filename">Makefile</code>s</a></span></dt> |
3125 | <dd><dl> | | 3064 | <dd><dl> |
3126 | <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt> | | 3065 | <dt><span class="sect1"><a href="#makefile.style">14.1. Caveats</a></span></dt> |
3127 | <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt> | | 3066 | <dt><span class="sect1"><a href="#makefile.variables">14.2. <code class="filename">Makefile</code> variables</a></span></dt> |
3128 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd> | | 3067 | <dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">14.2.1. Naming conventions</a></span></dt></dl></dd> |
3129 | <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt> | | 3068 | <dt><span class="sect1"><a href="#makefile.code">14.3. Code snippets</a></span></dt> |
3130 | <dd><dl> | | 3069 | <dd><dl> |
3131 | <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt> | | 3070 | <dt><span class="sect2"><a href="#adding-to-list">14.3.1. Adding things to a list</a></span></dt> |
3132 | <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt> | | 3071 | <dt><span class="sect2"><a href="#echo-literal">14.3.2. Echoing a string exactly as-is</a></span></dt> |
3133 | <dt><span class="sect2"><a href="#cflags-gnu-configure">14.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt> | | 3072 | <dt><span class="sect2"><a href="#cflags-gnu-configure">14.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt> |
3134 | <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt> | | 3073 | <dt><span class="sect2"><a href="#empty-variables">14.3.4. Handling possibly empty variables</a></span></dt> |
3135 | </dl></dd> | | 3074 | </dl></dd> |
3136 | </dl></dd> | | 3075 | </dl></dd> |
3137 | <dt><span class="chapter"><a href="#plist">15. PLIST issues</a></span></dt> | | 3076 | <dt><span class="chapter"><a href="#plist">15. PLIST issues</a></span></dt> |
3138 | <dd><dl> | | 3077 | <dd><dl> |
3139 | <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt> | | 3078 | <dt><span class="sect1"><a href="#rcs-id">15.1. RCS ID</a></span></dt> |
3140 | <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> | | 3079 | <dt><span class="sect1"><a href="#automatic-plist-generation">15.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> |
3141 | <dt><span class="sect1"><a href="#print-PLIST">15.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> | | 3080 | <dt><span class="sect1"><a href="#print-PLIST">15.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> |
3142 | <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt> | | 3081 | <dt><span class="sect1"><a href="#plist.misc">15.4. Variable substitution in PLIST</a></span></dt> |
3143 | <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt> | | 3082 | <dt><span class="sect1"><a href="#manpage-compression">15.5. Man page compression</a></span></dt> |
3144 | <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> | | 3083 | <dt><span class="sect1"><a href="#using-PLIST_SRC">15.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> |
3145 | <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt> | | 3084 | <dt><span class="sect1"><a href="#platform-specific-plist">15.7. Platform-specific and differing PLISTs</a></span></dt> |
3146 | <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt> | | 3085 | <dt><span class="sect1"><a href="#build-plist">15.8. Build-specific PLISTs</a></span></dt> |
3147 | <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt> | | 3086 | <dt><span class="sect1"><a href="#faq.common-dirs">15.9. Sharing directories between packages</a></span></dt> |
3148 | </dl></dd> | | 3087 | </dl></dd> |
3149 | <dt><span class="chapter"><a href="#buildlink">16. Buildlink methodology</a></span></dt> | | 3088 | <dt><span class="chapter"><a href="#buildlink">16. Buildlink methodology</a></span></dt> |
3150 | <dd><dl> | | 3089 | <dd><dl> |
3151 | <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt> | | 3090 | <dt><span class="sect1"><a href="#converting-to-buildlink3">16.1. Converting packages to use buildlink3</a></span></dt> |
3152 | <dt><span class="sect1"><a href="#creating-buildlink3.mk">16.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt> | | 3091 | <dt><span class="sect1"><a href="#creating-buildlink3.mk">16.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt> |
3153 | <dd><dl> | | 3092 | <dd><dl> |
3154 | <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt> | | 3093 | <dt><span class="sect2"><a href="#anatomy-of-bl3">16.2.1. Anatomy of a buildlink3.mk file</a></span></dt> |
3155 | <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating | | 3094 | <dt><span class="sect2"><a href="#updating-buildlink-depends">16.2.2. Updating |
3156 | <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code> | | 3095 | <code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code> |
3157 | and | | 3096 | and |
3158 | <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code> | | 3097 | <code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code> |
3159 | in <code class="filename">buildlink3.mk</code> files</a></span></dt> | | 3098 | in <code class="filename">buildlink3.mk</code> files</a></span></dt> |
3160 | </dl></dd> | | 3099 | </dl></dd> |
3161 | <dt><span class="sect1"><a href="#writing-builtin.mk">16.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt> | | 3100 | <dt><span class="sect1"><a href="#writing-builtin.mk">16.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt> |
3162 | <dd><dl> | | 3101 | <dd><dl> |
3163 | <dt><span class="sect2"><a href="#anatomy-of-builtin.mk">16.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</a></span></dt> | | 3102 | <dt><span class="sect2"><a href="#anatomy-of-builtin.mk">16.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</a></span></dt> |
3164 | <dt><span class="sect2"><a href="#native-or-pkgsrc-preference">16.3.2. Global preferences for native or pkgsrc software</a></span></dt> | | 3103 | <dt><span class="sect2"><a href="#native-or-pkgsrc-preference">16.3.2. Global preferences for native or pkgsrc software</a></span></dt> |
3165 | </dl></dd> | | 3104 | </dl></dd> |
3166 | </dl></dd> | | 3105 | </dl></dd> |
3167 | <dt><span class="chapter"><a href="#pkginstall">17. The pkginstall framework</a></span></dt> | | 3106 | <dt><span class="chapter"><a href="#pkginstall">17. The pkginstall framework</a></span></dt> |
3168 | <dd><dl> | | 3107 | <dd><dl> |
3169 | <dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">17.1. Files and directories outside the installation prefix</a></span></dt> | | 3108 | <dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">17.1. Files and directories outside the installation prefix</a></span></dt> |
3170 | <dd><dl> | | 3109 | <dd><dl> |
3171 | <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt> | | 3110 | <dt><span class="sect2"><a href="#dirs-outside-prefix">17.1.1. Directory manipulation</a></span></dt> |
3172 | <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt> | | 3111 | <dt><span class="sect2"><a href="#files-outside-prefix">17.1.2. File manipulation</a></span></dt> |
3173 | </dl></dd> | | 3112 | </dl></dd> |
3174 | <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt> | | 3113 | <dt><span class="sect1"><a href="#conf-files">17.2. Configuration files</a></span></dt> |
3175 | <dd><dl> | | 3114 | <dd><dl> |
3176 | <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt> | | 3115 | <dt><span class="sect2"><a href="#conf-files-sysconfdir">17.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt> |
3177 | <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt> | | 3116 | <dt><span class="sect2"><a href="#conf-files-configure">17.2.2. Telling the software where configuration files are</a></span></dt> |
3178 | <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt> | | 3117 | <dt><span class="sect2"><a href="#conf-files-patching">17.2.3. Patching installations</a></span></dt> |
3179 | <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt> | | 3118 | <dt><span class="sect2"><a href="#conf-files-disable">17.2.4. Disabling handling of configuration files</a></span></dt> |
3180 | </dl></dd> | | 3119 | </dl></dd> |
3181 | <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt> | | 3120 | <dt><span class="sect1"><a href="#rcd-scripts">17.3. System startup scripts</a></span></dt> |
3182 | <dd><dl><dt><span class="sect2"><a href="#rcd-scripts-disable">17.3.1. Disabling handling of system startup scripts</a></span></dt></dl></dd> | | 3121 | <dd><dl><dt><span class="sect2"><a href="#rcd-scripts-disable">17.3.1. Disabling handling of system startup scripts</a></span></dt></dl></dd> |
3183 | <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt> | | 3122 | <dt><span class="sect1"><a href="#users-and-groups">17.4. System users and groups</a></span></dt> |
3184 | <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt> | | 3123 | <dt><span class="sect1"><a href="#shells">17.5. System shells</a></span></dt> |
3185 | <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd> | | 3124 | <dd><dl><dt><span class="sect2"><a href="#shells-disable">17.5.1. Disabling shell registration</a></span></dt></dl></dd> |
3186 | <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt> | | 3125 | <dt><span class="sect1"><a href="#fonts">17.6. Fonts</a></span></dt> |
3187 | <dd><dl><dt><span class="sect2"><a href="#fonts-disable">17.6.1. Disabling automatic update of the fonts databases</a></span></dt></dl></dd> | | 3126 | <dd><dl><dt><span class="sect2"><a href="#fonts-disable">17.6.1. Disabling automatic update of the fonts databases</a></span></dt></dl></dd> |
3188 | </dl></dd> | | 3127 | </dl></dd> |
3189 | <dt><span class="chapter"><a href="#options">18. Options handling</a></span></dt> | | 3128 | <dt><span class="chapter"><a href="#options">18. Options handling</a></span></dt> |
3190 | <dd><dl> | | 3129 | <dd><dl> |
3191 | <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt> | | 3130 | <dt><span class="sect1"><a href="#global-default-options">18.1. Global default options</a></span></dt> |
3192 | <dt><span class="sect1"><a href="#converting-to-options">18.2. Converting packages to use <code class="filename">bsd.options.mk</code></a></span></dt> | | 3131 | <dt><span class="sect1"><a href="#converting-to-options">18.2. Converting packages to use <code class="filename">bsd.options.mk</code></a></span></dt> |
3193 | <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt> | | 3132 | <dt><span class="sect1"><a href="#option-names">18.3. Option Names</a></span></dt> |
3194 | <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt> | | 3133 | <dt><span class="sect1"><a href="#option-build">18.4. Determining the options of dependencies</a></span></dt> |
3195 | </dl></dd> | | 3134 | </dl></dd> |
3196 | <dt><span class="chapter"><a href="#build">19. The build process</a></span></dt> | | 3135 | <dt><span class="chapter"><a href="#build">19. The build process</a></span></dt> |
3197 | <dd><dl> | | 3136 | <dd><dl> |
3198 | <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt> | | 3137 | <dt><span class="sect1"><a href="#build.intro">19.1. Introduction</a></span></dt> |
3199 | <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt> | | 3138 | <dt><span class="sect1"><a href="#build.prefix">19.2. Program location</a></span></dt> |
3200 | <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt> | | 3139 | <dt><span class="sect1"><a href="#build.builddirs">19.3. Directories used during the build process</a></span></dt> |
3201 | <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt> | | 3140 | <dt><span class="sect1"><a href="#build.running">19.4. Running a phase</a></span></dt> |
3202 | <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt> | | 3141 | <dt><span class="sect1"><a href="#build.fetch">19.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt> |
3203 | <dd><dl> | | 3142 | <dd><dl> |
3204 | <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt> | | 3143 | <dt><span class="sect2"><a href="#build.fetch.what">19.5.1. What to fetch and where to get it from</a></span></dt> |
3205 | <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt> | | 3144 | <dt><span class="sect2"><a href="#build.fetch.how">19.5.2. How are the files fetched?</a></span></dt> |
3206 | </dl></dd> | | 3145 | </dl></dd> |
3207 | <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt> | | 3146 | <dt><span class="sect1"><a href="#build.checksum">19.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt> |
3208 | <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt> | | 3147 | <dt><span class="sect1"><a href="#build.extract">19.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt> |
3209 | <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt> | | 3148 | <dt><span class="sect1"><a href="#build.patch">19.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt> |
3210 | <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt> | | 3149 | <dt><span class="sect1"><a href="#build.tools">19.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt> |
3211 | <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt> | | 3150 | <dt><span class="sect1"><a href="#build.wrapper">19.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt> |
3212 | <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt> | | 3151 | <dt><span class="sect1"><a href="#build.configure">19.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt> |
3213 | <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt> | | 3152 | <dt><span class="sect1"><a href="#build.build">19.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt> |
3214 | <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt> | | 3153 | <dt><span class="sect1"><a href="#build.test">19.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt> |
3215 | <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt> | | 3154 | <dt><span class="sect1"><a href="#build.install">19.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt> |
3216 | <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt> | | 3155 | <dt><span class="sect1"><a href="#build.package">19.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt> |
3217 | <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt> | | 3156 | <dt><span class="sect1"><a href="#build.clean">19.16. Cleaning up</a></span></dt> |
3218 | <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt> | | 3157 | <dt><span class="sect1"><a href="#build.helpful-targets">19.17. Other helpful targets</a></span></dt> |
3219 | </dl></dd> | | 3158 | </dl></dd> |
3220 | <dt><span class="chapter"><a href="#tools">20. Tools needed for building or running</a></span></dt> | | 3159 | <dt><span class="chapter"><a href="#tools">20. Tools needed for building or running</a></span></dt> |
3221 | <dd><dl> | | 3160 | <dd><dl> |
3222 | <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt> | | 3161 | <dt><span class="sect1"><a href="#pkgsrc-tools">20.1. Tools for pkgsrc builds</a></span></dt> |
3223 | <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt> | | 3162 | <dt><span class="sect1"><a href="#package-tools">20.2. Tools needed by packages</a></span></dt> |
3224 | <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt> | | 3163 | <dt><span class="sect1"><a href="#platform-tools">20.3. Tools provided by platforms</a></span></dt> |
3225 | </dl></dd> | | 3164 | </dl></dd> |
3226 | <dt><span class="chapter"><a href="#fixes">21. Making your package work</a></span></dt> | | 3165 | <dt><span class="chapter"><a href="#fixes">21. Making your package work</a></span></dt> |
3227 | <dd><dl> | | 3166 | <dd><dl> |
3228 | <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt> | | 3167 | <dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt> |
3229 | <dd><dl> | | 3168 | <dd><dl> |
3230 | <dt><span class="sect2"><a href="#pulling-vars-from-etc-mk.conf">21.1.1. How to pull in user-settable variables from <code class="filename">mk.conf</code></a></span></dt> | | 3169 | <dt><span class="sect2"><a href="#pulling-vars-from-etc-mk.conf">21.1.1. How to pull in user-settable variables from <code class="filename">mk.conf</code></a></span></dt> |
3231 | <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt> | | 3170 | <dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt> |
3232 | <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt> | | 3171 | <dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt> |
3233 | <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt> | | 3172 | <dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt> |
3234 | <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt> | | 3173 | <dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt> |
3235 | <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt> | | 3174 | <dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt> |
3236 | <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt> | | 3175 | <dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt> |
3237 | <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt> | | 3176 | <dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt> |
3238 | <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt> | | 3177 | <dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt> |
3239 | <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt> | | 3178 | <dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt> |
3240 | <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt> | | 3179 | <dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt> |
3241 | </dl></dd> | | 3180 | </dl></dd> |
3242 | <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt> | | 3181 | <dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt> |
3243 | <dd><dl> | | 3182 | <dd><dl> |
3244 | <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> | | 3183 | <dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> |
3245 | <dt><span class="sect2"><a href="#modified-distfiles-same-name">21.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> | | 3184 | <dt><span class="sect2"><a href="#modified-distfiles-same-name">21.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> |
3246 | <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt> | | 3185 | <dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt> |
3247 | </dl></dd> | | 3186 | </dl></dd> |
3248 | <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt> | | 3187 | <dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt> |
3249 | <dd><dl> | | 3188 | <dd><dl> |
3250 | <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt> | | 3189 | <dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt> |
3251 | <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> | | 3190 | <dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> |
3252 | <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt> | | 3191 | <dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt> |
3253 | </dl></dd> | | 3192 | </dl></dd> |
3254 | <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt> | | 3193 | <dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt> |
3255 | <dd><dl> | | 3194 | <dd><dl> |
3256 | <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt> | | 3195 | <dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt> |
3257 | <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt> | | 3196 | <dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt> |
3258 | <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt> | | 3197 | <dt><span class="sect2"><a href="#perl-scripts">21.4.3. Packages containing perl scripts</a></span></dt> |
3259 | <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt> | | 3198 | <dt><span class="sect2"><a href="#shell-scripts">21.4.4. Packages containing shell scripts</a></span></dt> |
3260 | <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt> | | 3199 | <dt><span class="sect2"><a href="#other-programming-languages">21.4.5. Other programming languages</a></span></dt> |
3261 | </dl></dd> | | 3200 | </dl></dd> |
3262 | <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt> | | 3201 | <dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt> |
3263 | <dd><dl> | | 3202 | <dd><dl> |
3264 | <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt> | | 3203 | <dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt> |
3265 | <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt> | | 3204 | <dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt> |
3266 | <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt> | | 3205 | <dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt> |
3267 | <dt><span class="sect2"><a href="#undefined-reference">21.5.4. Undefined reference to <span class="quote">“<span class="quote">...</span>”</span></a></span></dt> | | 3206 | <dt><span class="sect2"><a href="#undefined-reference">21.5.4. Undefined reference to <span class="quote">“<span class="quote">...</span>”</span></a></span></dt> |
3268 | <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt> | | 3207 | <dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt> |
3269 | </dl></dd> | | 3208 | </dl></dd> |
3270 | <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt> | | 3209 | <dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt> |
3271 | <dd><dl> | | 3210 | <dd><dl> |
3272 | <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt> | | 3211 | <dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt> |
3273 | <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt> | | 3212 | <dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt> |
3274 | <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt> | | 3213 | <dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt> |
3275 | <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt> | | 3214 | <dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt> |
3276 | <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt> | | 3215 | <dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt> |
3277 | <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt> | | 3216 | <dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing perl modules</a></span></dt> |
3278 | <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt> | | 3217 | <dt><span class="sect2"><a href="#faq.info-files">21.6.7. Packages installing info files</a></span></dt> |
3279 | <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt> | | 3218 | <dt><span class="sect2"><a href="#manpages">21.6.8. Packages installing man pages</a></span></dt> |
3280 | <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt> | | 3219 | <dt><span class="sect2"><a href="#gconf-data-files">21.6.9. Packages installing GConf data files</a></span></dt> |
3281 | <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt> | | 3220 | <dt><span class="sect2"><a href="#scrollkeeper-data-files">21.6.10. Packages installing scrollkeeper/rarian data files</a></span></dt> |
3282 | <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt> | | 3221 | <dt><span class="sect2"><a href="#x11-fonts">21.6.11. Packages installing X11 fonts</a></span></dt> |
3283 | <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt> | | 3222 | <dt><span class="sect2"><a href="#gtk2-modules">21.6.12. Packages installing GTK2 modules</a></span></dt> |
3284 | <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt> | | 3223 | <dt><span class="sect2"><a href="#sgml-xml-data">21.6.13. Packages installing SGML or XML data</a></span></dt> |
3285 | <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt> | | 3224 | <dt><span class="sect2"><a href="#mime-database">21.6.14. Packages installing extensions to the MIME database</a></span></dt> |
3286 | <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt> | | 3225 | <dt><span class="sect2"><a href="#intltool">21.6.15. Packages using intltool</a></span></dt> |
3287 | <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt> | | 3226 | <dt><span class="sect2"><a href="#startup-scripts">21.6.16. Packages installing startup scripts</a></span></dt> |
3288 | <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt> | | 3227 | <dt><span class="sect2"><a href="#tex-packages">21.6.17. Packages installing TeX modules</a></span></dt> |
3289 | <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in | | 3228 | <dt><span class="sect2"><a href="#emulation-packages">21.6.18. Packages supporting running binaries in |
3290 | emulation</a></span></dt> | | 3229 | emulation</a></span></dt> |
3291 | <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt> | | 3230 | <dt><span class="sect2"><a href="#hicolor-theme">21.6.19. Packages installing hicolor theme icons</a></span></dt> |
3292 | <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt> | | 3231 | <dt><span class="sect2"><a href="#desktop-files">21.6.20. Packages installing desktop files</a></span></dt> |
3293 | </dl></dd> | | 3232 | </dl></dd> |
3294 | <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt> | | 3233 | <dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt> |
3295 | </dl></dd> | | 3234 | </dl></dd> |
3296 | <dt><span class="chapter"><a href="#debug">22. Debugging</a></span></dt> | | 3235 | <dt><span class="chapter"><a href="#debug">22. Debugging</a></span></dt> |
3297 | <dt><span class="chapter"><a href="#submit">23. Submitting and Committing</a></span></dt> | | 3236 | <dt><span class="chapter"><a href="#submit">23. Submitting and Committing</a></span></dt> |
3298 | <dd><dl> | | 3237 | <dd><dl> |
3299 | <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt> | | 3238 | <dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt> |
3300 | <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt> | | 3239 | <dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt> |
3301 | <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt> | | 3240 | <dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt> |
3302 | <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt> | | 3241 | <dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt> |
3303 | <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt> | | 3242 | <dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt> |
3304 | <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt> | | 3243 | <dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt> |
3305 | <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt> | | 3244 | <dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt> |
3306 | <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt> | | 3245 | <dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt> |
3307 | </dl></dd> | | 3246 | </dl></dd> |
3308 | <dt><span class="chapter"><a href="#devfaq">24. Frequently Asked Questions</a></span></dt> | | 3247 | <dt><span class="chapter"><a href="#devfaq">24. Frequently Asked Questions</a></span></dt> |
3309 | <dt><span class="chapter"><a href="#gnome">25. GNOME packaging and porting</a></span></dt> | | 3248 | <dt><span class="chapter"><a href="#gnome">25. GNOME packaging and porting</a></span></dt> |
3310 | <dd><dl> | | 3249 | <dd><dl> |
3311 | <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt> | | 3250 | <dt><span class="sect1"><a href="#meta-packages">25.1. Meta packages</a></span></dt> |
3312 | <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt> | | 3251 | <dt><span class="sect1"><a href="#new-package">25.2. Packaging a GNOME application</a></span></dt> |
3313 | <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt> | | 3252 | <dt><span class="sect1"><a href="#full-update">25.3. Updating GNOME to a newer version</a></span></dt> |
3314 | <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt> | | 3253 | <dt><span class="sect1"><a href="#patching">25.4. Patching guidelines</a></span></dt> |
3315 | </dl></dd> | | 3254 | </dl></dd> |
3316 | </dl> | | 3255 | </dl> |
3317 | </div> | | 3256 | </div> |
3318 | </div> | | 3257 | </div> |
3319 | <div class="chapter"> | | 3258 | <div class="chapter"> |
3320 | <div class="titlepage"><div><div><h2 class="title"> | | 3259 | <div class="titlepage"><div><div><h2 class="title"> |
3321 | <a name="help-devel"></a>Chapter 11. Getting help</h2></div></div></div> | | 3260 | <a name="help-devel"></a>Chapter 11. Getting help</h2></div></div></div> |
3322 | <p> | | 3261 | <p> |
3323 | To get help when developing pkgsrc, the definitive source is this | | 3262 | To get help when developing pkgsrc, the definitive source is this |
3324 | document, the pkgsrc guide. If you don't find anything here, | | 3263 | document, the pkgsrc guide. If you don't find anything here, |
3325 | there are alternatives: | | 3264 | there are alternatives: |
3326 | </p> | | 3265 | </p> |
3327 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | | 3266 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
3328 | <li class="listitem"> | | 3267 | <li class="listitem"> |
3329 | <p> | | 3268 | <p> |
3330 | The built-in pkgsrc help, which is available after bootstrapping | | 3269 | The built-in pkgsrc help, which is available after bootstrapping |
3331 | pkgsrc. Run <span class="command"><strong>bmake help topic=…</strong></span> to get | | 3270 | pkgsrc. Run <span class="command"><strong>bmake help topic=…</strong></span> to get |
3332 | help for any topic, such as a variable name like | | 3271 | help for any topic, such as a variable name like |
3333 | <code class="varname">BUILD_DEFS</code>, a make target like | | 3272 | <code class="varname">BUILD_DEFS</code>, a make target like |
3334 | <span class="command"><strong>do-build</strong></span>, a missing C or C++ function like | | 3273 | <span class="command"><strong>do-build</strong></span>, a missing C or C++ function like |
3335 | <span class="command"><strong>strcasecmp</strong></span> or any other topic.</p> | | 3274 | <span class="command"><strong>strcasecmp</strong></span> or any other topic.</p> |
3336 | <p>The available help topics are listed in <a class="xref" href="#help-topics" title="Appendix D. Help topics">Appendix D, <i>Help topics</i></a>.</p> | | 3275 | <p>The available help topics are listed in <a class="xref" href="#help-topics" title="Appendix D. Help topics">Appendix D, <i>Help topics</i></a>.</p> |
3337 | </li> | | 3276 | </li> |
3338 | <li class="listitem"><p> | | 3277 | <li class="listitem"><p> |
3339 | To see the value of a single variable, run <span class="command"><strong>bmake | | 3278 | To see the value of a single variable, run <span class="command"><strong>bmake |
3340 | show-var VARNAME=<em class="replaceable"><code>X</code></em></strong></span>. | | 3279 | show-var VARNAME=<em class="replaceable"><code>X</code></em></strong></span>. |
3341 | </p></li> | | 3280 | </p></li> |
3342 | <li class="listitem"><p> | | 3281 | <li class="listitem"><p> |
3343 | To see the values of the most common variables, run | | 3282 | To see the values of the most common variables, run |
3344 | <span class="command"><strong>bmake show-all</strong></span>. These variables are grouped by | | 3283 | <span class="command"><strong>bmake show-all</strong></span>. These variables are grouped by |
3345 | topic. To see the variables for a single topic, run | | 3284 | topic. To see the variables for a single topic, run |
3346 | <span class="command"><strong>bmake | | 3285 | <span class="command"><strong>bmake |
3347 | show-all-<em class="replaceable"><code>topic</code></em></strong></span>, for example | | 3286 | show-all-<em class="replaceable"><code>topic</code></em></strong></span>, for example |
3348 | <span class="command"><strong>bmake show-all-fetch</strong></span>. | | 3287 | <span class="command"><strong>bmake show-all-fetch</strong></span>. |
3349 | </p></li> | | 3288 | </p></li> |
3350 | <li class="listitem"><p> | | 3289 | <li class="listitem"><p> |
3351 | The tech-pkg mailing list, to which | | 3290 | The tech-pkg mailing list, to which |
3352 | <a class="ulink" href="https://www.NetBSD.org/mailinglists/#tech-pkg" target="_top">you | | 3291 | <a class="ulink" href="https://www.NetBSD.org/mailinglists/#tech-pkg" target="_top">you |
3353 | can subscribe</a> and then <a class="ulink" href="mailto:tech-pkg@NetBSD.org" target="_top">ask your | | 3292 | can subscribe</a> and then <a class="ulink" href="mailto:tech-pkg@NetBSD.org" target="_top">ask your |
3354 | questions</a>.</p></li> | | 3293 | questions</a>.</p></li> |
3355 | <li class="listitem"><p>The #pkgsrc IRC channel, which is accessible | | 3294 | <li class="listitem"><p>The #pkgsrc IRC channel, which is accessible |
3356 | <a class="ulink" href="https://webchat.freenode.net/" target="_top">via a web browser</a> | | 3295 | <a class="ulink" href="https://webchat.freenode.net/" target="_top">via a web browser</a> |
3357 | or by using a specialized chat program such as | | 3296 | or by using a specialized chat program such as |
3358 | <a class="ulink" href="http://xchat.org/" target="_top">XChat</a>. | | 3297 | <a class="ulink" href="http://xchat.org/" target="_top">XChat</a>. |
3359 | Pick any user name and join the channel #pkgsrc.</p></li> | | 3298 | Pick any user name and join the channel #pkgsrc.</p></li> |
3360 | </ul></div> | | 3299 | </ul></div> |
3361 | </div> | | 3300 | </div> |
3362 | <div class="chapter"> | | 3301 | <div class="chapter"> |
3363 | <div class="titlepage"><div><div><h2 class="title"> | | 3302 | <div class="titlepage"><div><div><h2 class="title"> |
3364 | <a name="creating"></a>Chapter 12. Creating a new pkgsrc package from scratch</h2></div></div></div> | | 3303 | <a name="creating"></a>Chapter 12. Creating a new pkgsrc package from scratch</h2></div></div></div> |
3365 | <div class="toc"> | | 3304 | <div class="toc"> |
3366 | <p><b>Table of Contents</b></p> | | 3305 | <p><b>Table of Contents</b></p> |
3367 | <dl class="toc"> | | 3306 | <dl class="toc"> |
3368 | <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt> | | 3307 | <dt><span class="sect1"><a href="#creating.common">12.1. Common types of packages</a></span></dt> |
3369 | <dd><dl> | | 3308 | <dd><dl> |
3370 | <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt> | | 3309 | <dt><span class="sect2"><a href="#creating.perl-module">12.1.1. Perl modules</a></span></dt> |
3371 | <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt> | | 3310 | <dt><span class="sect2"><a href="#creating.python-module">12.1.2. Python modules and programs</a></span></dt> |
3372 | <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt> | | 3311 | <dt><span class="sect2"><a href="#creating.R-package">12.1.3. R packages</a></span></dt> |
3373 | <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt> | | 3312 | <dt><span class="sect2"><a href="#creating.TeX-package">12.1.4. TeXlive packages</a></span></dt> |
3374 | </dl></dd> | | 3313 | </dl></dd> |
3375 | <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt> | | 3314 | <dt><span class="sect1"><a href="#creating.examples">12.2. Examples</a></span></dt> |
3376 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">12.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> | | 3315 | <dd><dl><dt><span class="sect2"><a href="#creating.nvu">12.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd> |
3377 | </dl> | | 3316 | </dl> |
3378 | </div> | | 3317 | </div> |
3379 | <p>When you find a package that is not yet in pkgsrc, you | | 3318 | <p>When you find a package that is not yet in pkgsrc, you |
3380 | most likely have a URL from where you can download the source | | 3319 | most likely have a URL from where you can download the source |
3381 | code. Starting with this URL, creating a package involves only a | | 3320 | code. Starting with this URL, creating a package involves only a |
3382 | few steps.</p> | | 3321 | few steps.</p> |
3383 | <div class="procedure"><ol class="procedure" type="1"> | | 3322 | <div class="procedure"><ol class="procedure" type="1"> |
3384 | <li class="step"><p>First, install the packages <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/url2pkg/README.html" target="_top"><code class="filename">pkgtools/url2pkg</code></a> and <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>.</p></li> | | 3323 | <li class="step"><p>First, install the packages <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/url2pkg/README.html" target="_top"><code class="filename">pkgtools/url2pkg</code></a> and <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/README.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>.</p></li> |
3385 | <li class="step"><p>Then, choose one of the top-level directories as the | | 3324 | <li class="step"><p>Then, choose one of the top-level directories as the |
3386 | category in which you want to place your package. You can also create a | | 3325 | category in which you want to place your package. You can also create a |
3387 | directory of your own (maybe called <code class="filename">local</code>). In that | | 3326 | directory of your own (maybe called <code class="filename">local</code>). In that |
3388 | category directory, create another directory for your package and change | | 3327 | category directory, create another directory for your package and change |
3389 | into it.</p></li> | | 3328 | into it.</p></li> |
3390 | <li class="step"><p>Run the program <span class="command"><strong>url2pkg</strong></span>, which will ask | | 3329 | <li class="step"><p>Run the program <span class="command"><strong>url2pkg</strong></span>, which will ask |
3391 | you for a URL. Enter the URL of the distribution file (in most cases a | | 3330 | you for a URL. Enter the URL of the distribution file (in most cases a |
3392 | <code class="filename">.tar.gz</code> file) and watch how the basic ingredients | | 3331 | <code class="filename">.tar.gz</code> file) and watch how the basic ingredients |
3393 | of your package are created automatically. The distribution file is | | 3332 | of your package are created automatically. The distribution file is |
3394 | extracted automatically to fill in some details in the | | 3333 | extracted automatically to fill in some details in the |
3395 | <code class="filename">Makefile</code> that would otherwise have to be done | | 3334 | <code class="filename">Makefile</code> that would otherwise have to be done |
3396 | manually.</p></li> | | 3335 | manually.</p></li> |
3397 | <li class="step"> | | 3336 | <li class="step"> |
3398 | <p>Examine the extracted files to determine the dependencies of | | 3337 | <p>Examine the extracted files to determine the dependencies of |
3399 | your package. Ideally, this is mentioned in some | | 3338 | your package. Ideally, this is mentioned in some |
3400 | <code class="filename">README</code> file, but things may differ. For each of | | 3339 | <code class="filename">README</code> file, but things may differ. For each of |
3401 | these dependencies, look where it exists in pkgsrc, and if there is a | | 3340 | these dependencies, look where it exists in pkgsrc, and if there is a |
3402 | file called <code class="filename">buildlink3.mk</code> in that directory, add a | | 3341 | file called <code class="filename">buildlink3.mk</code> in that directory, add a |
3403 | line to your package <code class="filename">Makefile</code> which includes that | | 3342 | line to your package <code class="filename">Makefile</code> which includes that |
3404 | file just before the last line. If the | | 3343 | file just before the last line. If the |
3405 | <code class="filename">buildlink3.mk</code> file does not exist, it must be | | 3344 | <code class="filename">buildlink3.mk</code> file does not exist, it must be |
3406 | created first. The <code class="filename">buildlink3.mk</code> file makes sure | | 3345 | created first. The <code class="filename">buildlink3.mk</code> file makes sure |
3407 | that the package's include files and libraries are provided.</p> | | 3346 | that the package's include files and libraries are provided.</p> |
3408 | <p>If you just need binaries from a package, add a | | 3347 | <p>If you just need binaries from a package, add a |
3409 | <code class="varname">DEPENDS</code> line to the Makefile, which specifies the | | 3348 | <code class="varname">DEPENDS</code> line to the Makefile, which specifies the |
3410 | version of the dependency and where it can be found in pkgsrc. This line | | 3349 | version of the dependency and where it can be found in pkgsrc. This line |
3411 | should be placed in the third paragraph. If the dependency is only | | 3350 | should be placed in the third paragraph. If the dependency is only |
3412 | needed for building the package, but not when using it, use | | 3351 | needed for building the package, but not when using it, use |
3413 | <code class="varname">TOOL_DEPENDS</code> or <code class="varname">BUILD_DEPENDS</code> | | 3352 | <code class="varname">TOOL_DEPENDS</code> or <code class="varname">BUILD_DEPENDS</code> |
3414 | instead of <code class="varname">DEPENDS</code>. | | 3353 | instead of <code class="varname">DEPENDS</code>. |
3415 | The difference between <code class="varname">TOOL_DEPENDS</code> and | | 3354 | The difference between <code class="varname">TOOL_DEPENDS</code> and |
3416 | <code class="varname">BUILD_DEPENDS</code> occurs when cross-compiling: | | 3355 | <code class="varname">BUILD_DEPENDS</code> occurs when cross-compiling: |
3417 | <code class="varname">TOOL_DEPENDS</code> are <span class="emphasis"><em>native</em></span> | | 3356 | <code class="varname">TOOL_DEPENDS</code> are <span class="emphasis"><em>native</em></span> |
3418 | packages, i.e. packages for the architecture where the package | | 3357 | packages, i.e. packages for the architecture where the package |
3419 | is built; | | 3358 | is built; |
3420 | <code class="varname">BUILD_DEPENDS</code> are <span class="emphasis"><em>target</em></span> | | 3359 | <code class="varname">BUILD_DEPENDS</code> are <span class="emphasis"><em>target</em></span> |
3421 | packages, i.e. packages for the architecture for which the package | | 3360 | packages, i.e. packages for the architecture for which the package |
3422 | is built. There is also <code class="varname">TEST_DEPENDS</code>, which is used | | 3361 | is built. There is also <code class="varname">TEST_DEPENDS</code>, which is used |
3423 | to specify a dependency used only for testing the resulting package | | 3362 | to specify a dependency used only for testing the resulting package |
3424 | built, using the upstream project's included test suite. | | 3363 | built, using the upstream project's included test suite. |
3425 | Your package may then look like this:</p> | | 3364 | Your package may then look like this:</p> |
3426 | <pre class="programlisting"> | | 3365 | <pre class="programlisting"> |
3427 | [...] | | 3366 | [...] |
3428 | | | 3367 | |
3429 | TOOL_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt | | 3368 | TOOL_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt |
3430 | DEPENDS+= screen-[0-9]*:../../misc/screen | | 3369 | DEPENDS+= screen-[0-9]*:../../misc/screen |
3431 | DEPENDS+= screen>=4.0:../../misc/screen | | 3370 | DEPENDS+= screen>=4.0:../../misc/screen |
3432 | | | 3371 | |
3433 | [...] | | 3372 | [...] |
3434 | | | 3373 | |
3435 | .include "../../<em class="replaceable"><code>category</code></em>/<em class="replaceable"><code>package</code></em>/buildlink3.mk" | | 3374 | .include "../../<em class="replaceable"><code>category</code></em>/<em class="replaceable"><code>package</code></em>/buildlink3.mk" |
3436 | .include "../../devel/glib2/buildlink3.mk" | | 3375 | .include "../../devel/glib2/buildlink3.mk" |
3437 | .include "../../mk/bsd.pkg.mk" | | 3376 | .include "../../mk/bsd.pkg.mk" |
3438 | </pre> | | 3377 | </pre> |
3439 | </li> | | 3378 | </li> |
3440 | <li class="step"><p>Run <span class="command"><strong>pkglint</strong></span> to see what things still need | | 3379 | <li class="step"><p>Run <span class="command"><strong>pkglint</strong></span> to see what things still need |
3441 | to be done to make your package a <span class="quote">“<span class="quote">good</span>”</span> one. If you don't | | 3380 | to be done to make your package a <span class="quote">“<span class="quote">good</span>”</span> one. If you don't |
3442 | know what pkglint's warnings want to tell you, try <span class="command"><strong>pkglint | | 3381 | know what pkglint's warnings want to tell you, try <span class="command"><strong>pkglint |
3443 | --explain</strong></span> or <span class="command"><strong>pkglint | | 3382 | --explain</strong></span> or <span class="command"><strong>pkglint |
3444 | -e</strong></span>, which outputs additional | | 3383 | -e</strong></span>, which outputs additional |
3445 | explanations.</p></li> | | 3384 | explanations.</p></li> |
3446 | <li class="step"><p>In many cases the package is not yet ready to build. You can | | 3385 | <li class="step"><p>In many cases the package is not yet ready to build. You can |
3447 | find instructions for the most common cases in the next section, <a class="xref" href="#creating.common" title="12.1. Common types of packages">Section 12.1, “Common types of packages”</a>. After you have followed the instructions | | 3386 | find instructions for the most common cases in the next section, <a class="xref" href="#creating.common" title="12.1. Common types of packages">Section 12.1, “Common types of packages”</a>. After you have followed the instructions |
3448 | over there, you can hopefully continue here.</p></li> | | 3387 | over there, you can hopefully continue here.</p></li> |
3449 | <li class="step"><p>Run <span class="command"><strong>bmake clean</strong></span> to clean the working | | 3388 | <li class="step"><p>Run <span class="command"><strong>bmake clean</strong></span> to clean the working |