-
Notifications
You must be signed in to change notification settings - Fork 160
/
Copy pathpkgsrc.html
15165 lines (15084 loc) · 732 KB
/
pkgsrc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>The pkgsrc guide</title>
<link rel="stylesheet" type="text/css" href="/global.css">
<meta name="generator" content="DocBook XSL Stylesheets VX.X.X">
<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.">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book">
<div class="titlepage">
<div>
<div><h1 class="title">
<a name="the-pkgsrc-guide"></a>The pkgsrc guide</h1></div>
<div><h2 class="subtitle">Documentation on the NetBSD packages system</h2></div>
<div><div class="authorgroup">
<div class="author">
<h3 class="author">
<span class="firstname">Alistair</span> <span class="surname">Crooks</span>
</h3>
<div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:[email protected]">[email protected]</a>></code></p></div></div>
</div>
<div class="author">
<h3 class="author">
<span class="firstname">Hubert</span> <span class="surname">Feyrer</span>
</h3>
<div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:[email protected]">[email protected]</a>></code></p></div></div>
</div>
<h3 class="corpauthor">
The pkgsrc Developers
</h3>
</div></div>
<div><p class="copyright">Copyright © 1994-2024 The NetBSD Foundation, Inc</p></div>
<div><p class="pubdate">$NetBSD: pkgsrc.xml,v 1.43 2024/01/02 07:26:32 jnemeth Exp $</p></div>
<div><div class="abstract">
<p class="title"><b>Abstract</b></p>
<p>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.</p>
</div></div>
</div>
<hr>
</div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="chapter"><a href="#introduction">1. What is pkgsrc?</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#introduction-section">1.1. Introduction</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#why-pkgsrc">1.1.1. Why pkgsrc?</a></span></dt>
<dt><span class="sect2"><a href="#intro.platforms">1.1.2. Supported platforms</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#overview">1.2. Overview</a></span></dt>
<dt><span class="sect1"><a href="#terminology">1.3. Terminology</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#term.roles">1.3.1. Roles involved in pkgsrc</a></span></dt></dl></dd>
<dt><span class="sect1"><a href="#typography">1.4. Typography</a></span></dt>
</dl></dd>
<dt><span class="part"><a href="#users-guide">I. The pkgsrc user's guide</a></span></dt>
<dd><dl>
<dt><span class="chapter"><a href="#help-user">2. Getting help</a></span></dt>
<dt><span class="chapter"><a href="#getting">3. Where to get pkgsrc and how to keep it up-to-date</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt>
<dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt>
<dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#platforms">4. Using pkgsrc on systems other than NetBSD</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt>
<dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#using">5. Using pkgsrc</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt>
<dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt>
<dt><span class="sect2"><a href="#using.pkgin_update">5.1.3. Updating packages</a></span></dt>
<dt><span class="sect2"><a href="#using.pkg_delete">5.1.4. Deinstalling packages</a></span></dt>
<dt><span class="sect2"><a href="#using.pkg_info">5.1.5. Getting information about installed packages</a></span></dt>
<dt><span class="sect2"><a href="#vulnerabilities">5.1.6. Checking for security vulnerabilities in installed packages</a></span></dt>
<dt><span class="sect2"><a href="#pkg_versions">5.1.7. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt>
<dt><span class="sect2"><a href="#using.pkg_admin">5.1.8. Other administrative functions</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt>
<dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt>
<dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#configuring">6. Configuring pkgsrc</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt>
<dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt>
<dt><span class="sect1"><a href="#native-or-pkgsrc-preference">6.3. Preferences for native or pkgsrc software</a></span></dt>
<dt><span class="sect1"><a href="#variables-affecting-installation">6.4. Variables affecting the installation process</a></span></dt>
<dt><span class="sect1"><a href="#conf.compiler">6.5. Selecting and configuring the compiler</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#selecting-the-compiler">6.5.1. Selecting the compiler</a></span></dt>
<dt><span class="sect2"><a href="#conf.cflags">6.5.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt>
<dt><span class="sect2"><a href="#conf.ldflags">6.5.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#developer-advanced-settings">6.6. Developer/advanced settings</a></span></dt>
<dt><span class="sect1"><a href="#selecting-build-options">6.7. Selecting Build Options</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#binary">7. Creating binary packages</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt>
<dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk
builds)</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt>
<dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a bulk build</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd>
<dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt>
<dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.builderr">8.4.3. Force compiler options only in the build phase</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt>
<dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt>
<dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt>
<dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt>
<dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt>
<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>
<dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt>
<dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt>
<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>
<dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt>
<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
/usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt>
<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>
<dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' or `priv` with pkgsrc</a></span></dt>
<dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt>
<dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt>
<dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt>
<dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt>
<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>
</dl></dd>
</dl></dd>
<dt><span class="part"><a href="#developers-guide">II. The pkgsrc developer's guide</a></span></dt>
<dd><dl>
<dt><span class="chapter"><a href="#help-devel">11. Getting help</a></span></dt>
<dt><span class="chapter"><a href="#components">12. Package components - files, directories and contents</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#components.Makefile">12.1. <code class="filename">Makefile</code></a></span></dt>
<dt><span class="sect1"><a href="#components.distinfo">12.2. <code class="filename">distinfo</code></a></span></dt>
<dt><span class="sect1"><a href="#components.patches">12.3. <code class="filename">patches/*</code></a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#components.patch.structure">12.3.1. Structure of a single patch file</a></span></dt>
<dt><span class="sect2"><a href="#components.patches.caveats">12.3.2. Creating patch files</a></span></dt>
<dt><span class="sect2"><a href="#components.patches.sources">12.3.3. Sources where the patch files come from</a></span></dt>
<dt><span class="sect2"><a href="#components.patches.guidelines">12.3.4. Patching guidelines</a></span></dt>
<dt><span class="sect2"><a href="#components.patches.feedback">12.3.5. Feedback to the author</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#other-mandatory-files">12.4. Other mandatory files</a></span></dt>
<dt><span class="sect1"><a href="#components.optional">12.5. Optional files</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#components.optional.bin">12.5.1. Files affecting the binary package</a></span></dt>
<dt><span class="sect2"><a href="#components.optional.build">12.5.2. Files affecting the build process</a></span></dt>
<dt><span class="sect2"><a href="#components.optional.none">12.5.3. Files affecting nothing at all</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#work-dir">12.6. <code class="filename">work*</code></a></span></dt>
<dt><span class="sect1"><a href="#files-dir">12.7. <code class="filename">files/*</code></a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#build">13. The build process</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#build.intro">13.1. Introduction</a></span></dt>
<dt><span class="sect1"><a href="#build.prefix">13.2. Program location</a></span></dt>
<dt><span class="sect1"><a href="#build.builddirs">13.3. Directories used during the build process</a></span></dt>
<dt><span class="sect1"><a href="#build.running">13.4. Running a phase</a></span></dt>
<dt><span class="sect1"><a href="#build.fetch">13.5. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#build.fetch.what">13.5.1. What to fetch and where to get it from</a></span></dt>
<dt><span class="sect2"><a href="#build.fetch.how">13.5.2. How are the files fetched?</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#build.checksum">13.6. The <span class="emphasis"><em>checksum</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.extract">13.7. The <span class="emphasis"><em>extract</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.patch">13.8. The <span class="emphasis"><em>patch</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.tools">13.9. The <span class="emphasis"><em>tools</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.wrapper">13.10. The <span class="emphasis"><em>wrapper</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.configure">13.11. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.build">13.12. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.test">13.13. The <span class="emphasis"><em>test</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.install">13.14. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.package">13.15. The <span class="emphasis"><em>package</em></span> phase</a></span></dt>
<dt><span class="sect1"><a href="#build.clean">13.16. Cleaning up</a></span></dt>
<dt><span class="sect1"><a href="#build.helpful-targets">13.17. Other helpful targets</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#creating">14. Creating a new pkgsrc package from scratch</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#creating.common">14.1. Common types of packages</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#creating.python-module">14.1.1. Python modules and programs</a></span></dt>
<dt><span class="sect2"><a href="#creating.R-package">14.1.2. R packages</a></span></dt>
<dt><span class="sect2"><a href="#creating.TeX-package">14.1.3. TeXlive packages</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#creating.examples">14.2. Examples</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#creating.nvu">14.2.1. How the www/nvu package came into pkgsrc</a></span></dt></dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#makefile">15. Programming in <code class="filename">Makefile</code>s</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#makefile.style">15.1. Caveats</a></span></dt>
<dt><span class="sect1"><a href="#makefile.variables">15.2. <code class="filename">Makefile</code> variables</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">15.2.1. Naming conventions</a></span></dt></dl></dd>
<dt><span class="sect1"><a href="#makefile.code">15.3. Code snippets</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#adding-to-list">15.3.1. Adding things to a list</a></span></dt>
<dt><span class="sect2"><a href="#echo-literal">15.3.2. Echoing a string exactly as-is</a></span></dt>
<dt><span class="sect2"><a href="#cflags-gnu-configure">15.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt>
<dt><span class="sect2"><a href="#empty-variables">15.3.4. Handling possibly empty variables</a></span></dt>
<dt><span class="sect2"><a href="#makefile.yesno">15.3.5. Testing yes/no variables in conditions</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#options">16. Options handling</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#global-default-options">16.1. Global default options</a></span></dt>
<dt><span class="sect1"><a href="#converting-to-options">16.2. Converting packages to use <code class="filename">bsd.options.mk</code></a></span></dt>
<dt><span class="sect1"><a href="#option-names">16.3. Option Names</a></span></dt>
<dt><span class="sect1"><a href="#option-build">16.4. Determining the options of dependencies</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#tools">17. Tools needed for building or running</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#pkgsrc-tools">17.1. Tools for pkgsrc builds</a></span></dt>
<dt><span class="sect1"><a href="#package-tools">17.2. Tools needed by packages</a></span></dt>
<dt><span class="sect1"><a href="#platform-tools">17.3. Tools provided by platforms</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#buildlink">18. Buildlink methodology</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#converting-to-buildlink3">18.1. Converting packages to use buildlink3</a></span></dt>
<dt><span class="sect1"><a href="#creating-buildlink3.mk">18.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#anatomy-of-bl3">18.2.1. Anatomy of a buildlink3.mk file</a></span></dt>
<dt><span class="sect2"><a href="#updating-buildlink-depends">18.2.2. Updating
<code class="varname">BUILDLINK_API_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
and
<code class="varname">BUILDLINK_ABI_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
in <code class="filename">buildlink3.mk</code> files</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#writing-builtin.mk">18.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#anatomy-of-builtin.mk">18.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</a></span></dt></dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#plist">19. PLIST issues</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#rcs-id">19.1. RCS ID</a></span></dt>
<dt><span class="sect1"><a href="#automatic-plist-generation">19.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt>
<dt><span class="sect1"><a href="#print-PLIST">19.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt>
<dt><span class="sect1"><a href="#plist.misc">19.4. Variable substitution in PLIST</a></span></dt>
<dt><span class="sect1"><a href="#manpage-compression">19.5. Man page compression</a></span></dt>
<dt><span class="sect1"><a href="#using-PLIST_SRC">19.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt>
<dt><span class="sect1"><a href="#platform-specific-plist">19.7. Platform-specific and differing PLISTs</a></span></dt>
<dt><span class="sect1"><a href="#build-plist">19.8. Build-specific PLISTs</a></span></dt>
<dt><span class="sect1"><a href="#faq.common-dirs">19.9. Sharing directories between packages</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#pkginstall">20. The pkginstall framework</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#files-and-dirs-outside-prefix">20.1. Files and directories outside the installation prefix</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#dirs-outside-prefix">20.1.1. Directory manipulation</a></span></dt>
<dt><span class="sect2"><a href="#files-outside-prefix">20.1.2. File manipulation</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#conf-files">20.2. Configuration files</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#conf-files-sysconfdir">20.2.1. How <code class="varname">PKG_SYSCONFDIR</code> is set</a></span></dt>
<dt><span class="sect2"><a href="#conf-files-configure">20.2.2. Telling the software where configuration files are</a></span></dt>
<dt><span class="sect2"><a href="#conf-files-patching">20.2.3. Patching installation</a></span></dt>
<dt><span class="sect2"><a href="#conf-files-declare">20.2.4. Declaring configuration files</a></span></dt>
<dt><span class="sect2"><a href="#conf-files-disable">20.2.5. Disabling handling of configuration files</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#rcd-scripts">20.3. System startup scripts</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#rcd-scripts-disable">20.3.1. Disabling handling of system startup scripts</a></span></dt></dl></dd>
<dt><span class="sect1"><a href="#users-and-groups">20.4. System users and groups</a></span></dt>
<dt><span class="sect1"><a href="#shells">20.5. System shells</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#shells-disable">20.5.1. Disabling shell registration</a></span></dt></dl></dd>
<dt><span class="sect1"><a href="#fonts">20.6. Fonts</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#fonts-disable">20.6.1. Disabling automatic update of the fonts databases</a></span></dt></dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#fixes">21. Making your package work</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#general-operation">21.1. General operation</a></span></dt>
<dd><dl>
<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>
<dt><span class="sect2"><a href="#user-interaction">21.1.2. User interaction</a></span></dt>
<dt><span class="sect2"><a href="#handling-licenses">21.1.3. Handling licenses</a></span></dt>
<dt><span class="sect2"><a href="#restricted-packages">21.1.4. Restricted packages</a></span></dt>
<dt><span class="sect2"><a href="#dependencies">21.1.5. Handling dependencies</a></span></dt>
<dt><span class="sect2"><a href="#conflicts">21.1.6. Handling conflicts with other packages</a></span></dt>
<dt><span class="sect2"><a href="#not-building-packages">21.1.7. Packages that cannot or should not be built</a></span></dt>
<dt><span class="sect2"><a href="#undeletable-packages">21.1.8. Packages which should not be deleted, once installed</a></span></dt>
<dt><span class="sect2"><a href="#security-handling">21.1.9. Handling packages with security problems</a></span></dt>
<dt><span class="sect2"><a href="#bumping-pkgrevision">21.1.10. How to handle incrementing versions when fixing an existing package</a></span></dt>
<dt><span class="sect2"><a href="#fixes.subst">21.1.11. Substituting variable text in the package files (the SUBST framework)</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#fixes.fetch">21.2. The <span class="emphasis"><em>fetch</em></span> phase</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#no-plain-download">21.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt>
<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>
<dt><span class="sect2"><a href="#build.fetch.github">21.2.3. Packages hosted on github.com</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#fixes.configure">21.3. The <span class="emphasis"><em>configure</em></span> phase</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#fixes.libtool">21.3.1. Shared libraries - libtool</a></span></dt>
<dt><span class="sect2"><a href="#using-libtool">21.3.2. Using libtool on GNU packages that already support libtool</a></span></dt>
<dt><span class="sect2"><a href="#autoconf-automake">21.3.3. GNU Autoconf/Automake</a></span></dt>
<dt><span class="sect2"><a href="#meson">21.3.4. Meson / ninja</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#programming-languages">21.4. Programming languages</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#basic-programming-languages">21.4.1. C, C++, and Fortran</a></span></dt>
<dt><span class="sect2"><a href="#java-programming-language">21.4.2. Java</a></span></dt>
<dt><span class="sect2"><a href="#go-programming-language">21.4.3. Go</a></span></dt>
<dt><span class="sect2"><a href="#rust-programming-language">21.4.4. Rust</a></span></dt>
<dt><span class="sect2"><a href="#perl-scripts">21.4.5. Packages containing Perl scripts</a></span></dt>
<dt><span class="sect2"><a href="#shell-scripts">21.4.6. Packages containing shell scripts</a></span></dt>
<dt><span class="sect2"><a href="#other-programming-languages">21.4.7. Other programming languages</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#fixes.build">21.5. The <span class="emphasis"><em>build</em></span> phase</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#fixes.build.cpp">21.5.1. Compiling C and C++ code conditionally</a></span></dt>
<dt><span class="sect2"><a href="#compiler-bugs">21.5.2. How to handle compiler bugs</a></span></dt>
<dt><span class="sect2"><a href="#fixes.build.header">21.5.3. No such file or directory</a></span></dt>
<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>
<dt><span class="sect2"><a href="#out-of-memory">21.5.5. Running out of memory</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#fixes.install">21.6. The <span class="emphasis"><em>install</em></span> phase</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#install-scripts">21.6.1. Creating needed directories</a></span></dt>
<dt><span class="sect2"><a href="#where-to-install-documentation">21.6.2. Where to install documentation</a></span></dt>
<dt><span class="sect2"><a href="#installing-score-files">21.6.3. Installing highscore files</a></span></dt>
<dt><span class="sect2"><a href="#destdir-support">21.6.4. Adding DESTDIR support to packages</a></span></dt>
<dt><span class="sect2"><a href="#hardcoded-paths">21.6.5. Packages with hardcoded paths to other interpreters</a></span></dt>
<dt><span class="sect2"><a href="#perl-modules">21.6.6. Packages installing Perl modules</a></span></dt>
<dt><span class="sect2"><a href="#faq.pkg-config-files">21.6.7. Packages installing pkg-config files</a></span></dt>
<dt><span class="sect2"><a href="#faq.info-files">21.6.8. Packages installing info files</a></span></dt>
<dt><span class="sect2"><a href="#manpages">21.6.9. Packages installing man pages</a></span></dt>
<dt><span class="sect2"><a href="#x11-fonts">21.6.10. Packages installing X11 fonts</a></span></dt>
<dt><span class="sect2"><a href="#sgml-xml-data">21.6.11. Packages installing SGML or XML data</a></span></dt>
<dt><span class="sect2"><a href="#mime-database">21.6.12. Packages installing extensions to the MIME database</a></span></dt>
<dt><span class="sect2"><a href="#intltool">21.6.13. Packages using intltool</a></span></dt>
<dt><span class="sect2"><a href="#startup-scripts">21.6.14. Packages installing startup scripts</a></span></dt>
<dt><span class="sect2"><a href="#tex-packages">21.6.15. Packages installing TeX modules</a></span></dt>
<dt><span class="sect2"><a href="#emulation-packages">21.6.16. Packages supporting running binaries in
emulation</a></span></dt>
<dt><span class="sect2"><a href="#hicolor-theme">21.6.17. Packages installing hicolor icons</a></span></dt>
<dt><span class="sect2"><a href="#desktop-files">21.6.18. Packages installing desktop files</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#punting">21.7. Marking packages as having problems</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#gnome">22. GNOME packaging and porting</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#meta-packages">22.1. Meta packages</a></span></dt>
<dt><span class="sect1"><a href="#new-package">22.2. Packaging a GNOME application</a></span></dt>
<dt><span class="sect1"><a href="#full-update">22.3. Updating GNOME to a newer version</a></span></dt>
<dt><span class="sect1"><a href="#patching">22.4. Patching guidelines</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#submit">23. Submitting and Committing</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#submitting-binary-packages">23.1. Submitting binary packages</a></span></dt>
<dt><span class="sect1"><a href="#submitting-your-package">23.2. Submitting source packages (for non-NetBSD-developers)</a></span></dt>
<dt><span class="sect1"><a href="#general-notes-for-changes">23.3. General notes when adding, updating, or removing packages</a></span></dt>
<dt><span class="sect1"><a href="#commit-messages">23.4. Commit Messages</a></span></dt>
<dt><span class="sect1"><a href="#committing-importing">23.5. Committing: Adding a package to CVS</a></span></dt>
<dt><span class="sect1"><a href="#updating-package">23.6. Updating a package to a newer version</a></span></dt>
<dt><span class="sect1"><a href="#renaming-package">23.7. Renaming a package in pkgsrc</a></span></dt>
<dt><span class="sect1"><a href="#moving-package">23.8. Moving a package in pkgsrc</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#devfaq">24. Frequently Asked Questions</a></span></dt>
</dl></dd>
<dt><span class="part"><a href="#infrastructure">III. The pkgsrc infrastructure internals</a></span></dt>
<dd><dl>
<dt><span class="chapter"><a href="#infr.design">25. Design of the pkgsrc infrastructure</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#infr.vardef">25.1. The meaning of variable definitions</a></span></dt>
<dt><span class="sect1"><a href="#infr.vardef.problems">25.2. Avoiding problems before they arise</a></span></dt>
<dt><span class="sect1"><a href="#infr.var">25.3. Variable evaluation</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#infr.var.load">25.3.1. At load time</a></span></dt>
<dt><span class="sect2"><a href="#infr.var.run">25.3.2. At runtime</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#infr.varspec">25.4. How can variables be specified?</a></span></dt>
<dt><span class="sect1"><a href="#infr.design.intf">25.5. Designing interfaces for Makefile fragments</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#infr.design.intf.proc">25.5.1. Procedures with parameters</a></span></dt>
<dt><span class="sect2"><a href="#infr.design.intf.action">25.5.2. Actions taken on behalf of parameters</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#infr.order">25.6. The order in which files are loaded</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#infr.order.prefs">25.6.1. The order in <code class="filename">bsd.prefs.mk</code></a></span></dt>
<dt><span class="sect2"><a href="#infr.order.pkg">25.6.2. The order in <code class="filename">bsd.pkg.mk</code></a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#regression">26. Regression tests</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#regression.run">26.1. Running the regression tests</a></span></dt>
<dt><span class="sect1"><a href="#regression.new">26.2. Adding a new regression test</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#regression.fun.override">26.2.1. Overridable functions</a></span></dt>
<dt><span class="sect2"><a href="#regression.fun.helper">26.2.2. Helper functions</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#porting">27. Porting pkgsrc</a></span></dt>
<dd><dl><dt><span class="sect1"><a href="#porting.opsys">27.1. Porting pkgsrc to a new operating system</a></span></dt></dl></dd>
</dl></dd>
<dt><span class="appendix"><a href="#examples">A. A simple example package: bison</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#example-files">A.1. files</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#example-Makefile">A.1.1. Makefile</a></span></dt>
<dt><span class="sect2"><a href="#example-descr">A.1.2. DESCR</a></span></dt>
<dt><span class="sect2"><a href="#example-plist">A.1.3. PLIST</a></span></dt>
<dt><span class="sect2"><a href="#checking-package-with-pkglint">A.1.4. Checking a package with pkglint</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. Steps for building, installing, packaging</a></span></dt>
</dl></dd>
<dt><span class="appendix"><a href="#hardening">B. Security hardening</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#hardening.mechanisms">B.1. Mechanisms</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#hardening.mechanisms.enabled">B.1.1. Enabled by default</a></span></dt>
<dt><span class="sect2"><a href="#hardening.mechanisms.disabled">B.1.2. Not enabled by default</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#hardening.caveats">B.2. Caveats</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#hardening.caveats.pie">B.2.1. Problems with PKGSRC_MKPIE</a></span></dt>
<dt><span class="sect2"><a href="#hardening.caveats.fortify">B.2.2. Problems with PKGSRC_USE_FORTIFY</a></span></dt>
<dt><span class="sect2"><a href="#hardening.caveats.relro">B.2.3. Problems with PKGSRC_USE_RELRO</a></span></dt>
<dt><span class="sect2"><a href="#hardening.caveats.ssp">B.2.4. Problems with PKGSRC_USE_SSP</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#hardening.audit">B.3. Auditing the system</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#hardening.audit.pie">B.3.1. Checking for PIE</a></span></dt>
<dt><span class="sect2"><a href="#hardening.audit.relropartial">B.3.2. Checking for partial RELRO</a></span></dt>
<dt><span class="sect2"><a href="#hardening.audit.relrofull">B.3.3. Checking for full RELRO</a></span></dt>
<dt><span class="sect2"><a href="#hardening.audit.ssp">B.3.4. Checking for SSP</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="appendix"><a href="#logs">C. Build logs</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#logs.building">C.1. Building figlet</a></span></dt>
<dt><span class="sect1"><a href="#logs.package">C.2. Packaging figlet</a></span></dt>
</dl></dd>
<dt><span class="appendix"><a href="#ftp-layout">D. Directory layout of the pkgsrc FTP server</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#ftp-distfiles">D.1. <code class="filename">distfiles</code>: The distributed source files</a></span></dt>
<dt><span class="sect1"><a href="#ftp-misc">D.2. <code class="filename">misc</code>: Miscellaneous things</a></span></dt>
<dt><span class="sect1"><a href="#ftp-packages">D.3. <code class="filename">packages</code>: Binary packages</a></span></dt>
<dt><span class="sect1"><a href="#ftp-reports">D.4. <code class="filename">reports</code>: Bulk build reports</a></span></dt>
<dt><span class="sect1"><a href="#ftp-source">D.5. <code class="filename">current</code>,
<code class="filename">stable</code>,
<code class="filename">pkgsrc-20<em class="replaceable"><code>xx</code></em>Q<em class="replaceable"><code>y</code></em></code>:
source packages</a></span></dt>
</dl></dd>
<dt><span class="appendix"><a href="#help-topics">E. Help topics</a></span></dt>
<dt><span class="appendix"><a href="#editing">F. Editing guidelines for the pkgsrc guide</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#targets">F.1. Make targets</a></span></dt>
<dt><span class="sect1"><a href="#procedure">F.2. Procedure</a></span></dt>
</dl></dd>
</dl>
</div>
<div class="list-of-tables">
<p><b>List of Tables</b></p>
<dl>
<dt>1.1. <a href="#supported-platforms">Platforms supported by pkgsrc</a>
</dt>
<dt>12.1. <a href="#patch-examples">Patching examples</a>
</dt>
<dt>22.1. <a href="#plist-handling">PLIST handling for GNOME packages</a>
</dt>
</dl>
</div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="introduction"></a>Chapter 1. What is pkgsrc?</h1></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="sect1"><a href="#introduction-section">1.1. Introduction</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#why-pkgsrc">1.1.1. Why pkgsrc?</a></span></dt>
<dt><span class="sect2"><a href="#intro.platforms">1.1.2. Supported platforms</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#overview">1.2. Overview</a></span></dt>
<dt><span class="sect1"><a href="#terminology">1.3. Terminology</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#term.roles">1.3.1. Roles involved in pkgsrc</a></span></dt></dl></dd>
<dt><span class="sect1"><a href="#typography">1.4. Typography</a></span></dt>
</dl>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="introduction-section"></a>1.1. Introduction</h2></div></div></div>
<p>There is a lot of software freely available for Unix-based
systems, which is usually available in form of the source code. Before
such software can be used, it needs to be configured to the local
system, compiled and installed, and this is exactly what The NetBSD
Packages Collection (pkgsrc) does. pkgsrc also has some basic commands
to handle binary packages, so that not every user has to build the
packages for himself, which is a time-costly task.</p>
<p>pkgsrc currently contains several thousand packages,
including:</p>
<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/www/apache24/index.html" target="_top"><code class="filename">www/apache24</code></a> - The Apache
web server</p></li>
<li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/www/firefox/index.html" target="_top"><code class="filename">www/firefox</code></a> - The Firefox
web browser</p></li>
<li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/gnome/index.html" target="_top"><code class="filename">meta-pkgs/gnome</code></a> - The GNOME
Desktop Environment</p></li>
<li class="listitem"><p><a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/meta-pkgs/kde4/index.html" target="_top"><code class="filename">meta-pkgs/kde4</code></a> - The K
Desktop Environment</p></li>
</ul></div>
<p>… just to name a few.</p>
<p>pkgsrc has built-in support for handling varying dependencies,
such as pthreads and X11, and extended features such as IPv6 support on
a range of platforms.</p>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="why-pkgsrc"></a>1.1.1. Why pkgsrc?</h3></div></div></div>
<p>
pkgsrc provides the following key features:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Easy building of software from source as well as the creation
and installation of binary packages. The source and latest
patches are retrieved from a master or mirror download site, checksum
verified, then built on your system. Support for binary-only
distributions is available for both native platforms and NetBSD
emulated platforms.</p></li>
<li class="listitem"><p>All packages are installed in a consistent directory tree,
including binaries, libraries, man pages and other
documentation.</p></li>
<li class="listitem"><p>Tracking of package dependencies automatically, including when
performing updates, to ensure required packages are installed. The
configuration files of various packages are handled automatically during
updates, so local changes are preserved.</p></li>
<li class="listitem"><p>Like NetBSD, pkgsrc is designed with portability in mind and
consists of highly portable code. This allows the greatest speed of
development when porting to a new platform. This portability also
ensures that pkgsrc is <span class="emphasis"><em>consistent across all
platforms</em></span>.</p></li>
<li class="listitem"><p>The installation prefix, acceptable software licenses,
international encryption requirements and build-time options for a
large number of packages are all set in a simple, central
configuration file.</p></li>
<li class="listitem"><p>The entire source (not including the distribution files) is
freely available under a BSD license, so you may extend and adapt
pkgsrc to your needs. Support for local packages and patches is
available right out of the box, so you can configure it specifically
for your environment.</p></li>
</ul></div>
<p>The following principles are basic to pkgsrc:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><span class="quote">“<span class="quote">It should only work if it's right.</span>”</span>
— That means, if a package contains bugs, it's better to find
them and to complain about them rather than to just install the package
and hope that it works. There are numerous checks in pkgsrc that try to
find such bugs: static analysis tools (<a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/pkglint/index.html" target="_top"><code class="filename">pkgtools/pkglint</code></a>), build-time checks (portability
of shell scripts), and post-installation checks (installed files,
references to shared libraries, script interpreters).</p></li>
<li class="listitem"><p><span class="quote">“<span class="quote">If it works, it should work everywhere</span>”</span>
— Like NetBSD has been ported to many hardware architectures,
pkgsrc has been ported to many operating systems. Care is taken that
packages behave the same on all platforms.</p></li>
</ul></div>
</div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="intro.platforms"></a>1.1.2. Supported platforms</h3></div></div></div>
<p>pkgsrc consists of both a source distribution and a binary
distribution for these operating systems. After retrieving the required
source or binaries, you can be up and running with pkgsrc in just
minutes!</p>
<p>pkgsrc was derived from FreeBSD's ports system, and
initially developed for NetBSD only. Since then, pkgsrc has
grown a lot, and now supports the following platforms:</p>
<div class="table">
<a name="supported-platforms"></a><p class="title"><b>Table 1.1. Platforms supported by pkgsrc</b></p>
<div class="table-contents"><table class="table" summary="Platforms supported by pkgsrc" border="1">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>Platform</th>
<th>Date Support Added</th>
<th>Notes</th>
</tr></thead>
<tbody>
<tr>
<td><a class="ulink" href="https://www.NetBSD.org/" target="_top">NetBSD</a></td>
<td align="center">Aug 1997</td>
<td class="auto-generated"> </td>
</tr>
<tr>
<td><a class="ulink" href="http://wwws.sun.com/software/solaris/" target="_top">Solaris</a></td>
<td align="center">Mar 1999</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Solaris" target="_top">README.Solaris</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.kernel.org/" target="_top">Linux</a></td>
<td align="center">Jun 1999</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Linux" target="_top">README.Linux</a></td>
</tr>
<tr>
<td>
<a class="ulink" href="https://developer.apple.com/macos/" target="_top">Darwin / Mac OS X / OS X / macOS</a>
</td>
<td align="center">Oct 2001</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.macOS" target="_top">README.macOS</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.freebsd.org/" target="_top">FreeBSD</a></td>
<td align="center">Nov 2002</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.FreeBSD" target="_top">README.FreeBSD</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.openbsd.org/" target="_top">OpenBSD</a></td>
<td align="center">Nov 2002</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OpenBSD" target="_top">README.OpenBSD</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.sgi.com/software/irix/" target="_top">IRIX</a></td>
<td align="center">Dec 2002</td>
<td>
<a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX" target="_top">README.IRIX</a>
</td>
</tr>
<tr>
<td>BSD/OS</td>
<td align="center">Dec 2003</td>
<td class="auto-generated"> </td>
</tr>
<tr>
<td><a class="ulink" href="https://www-1.ibm.com/servers/aix/" target="_top">AIX</a></td>
<td align="center">Dec 2003</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.AIX" target="_top">README.AIX</a></td>
</tr>
<tr>
<td>
<a class="ulink" href="https://www.microsoft.com/windows/sfu/" target="_top">Interix</a>
(Microsoft Windows Services for Unix)
</td>
<td align="center">Mar 2004</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Interix" target="_top">README.Interix</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.dragonflybsd.org/" target="_top">DragonFlyBSD</a></td>
<td align="center">Oct 2004</td>
<td class="auto-generated"> </td>
</tr>
<tr>
<td><a class="ulink" href="http://www.tru64.org/" target="_top">OSF/1</a></td>
<td align="center">Nov 2004</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OSF1" target="_top">README.OSF1</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.hp.com/products1/unix/" target="_top">HP-UX</a></td>
<td align="center">Apr 2007</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.HPUX" target="_top">README.HPUX</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.haiku-os.org/" target="_top">Haiku</a></td>
<td align="center">Sep 2010</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Haiku" target="_top">README.Haiku</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.mirbsd.org/" target="_top">MirBSD</a></td>
<td align="center">Jan 2011</td>
<td class="auto-generated"> </td>
</tr>
<tr>
<td><a class="ulink" href="https://www.minix3.org/" target="_top">Minix3</a></td>
<td align="center">Nov 2011</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Minix3" target="_top">README.Minix3</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://cygwin.com/" target="_top">Cygwin</a></td>
<td align="center">Mar 2013</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Cygwin" target="_top">README.Cygwin</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.debian.org/ports/kfreebsd-gnu/" target="_top">GNU/kFreeBSD</a></td>
<td align="center">Jul 2013</td>
<td><a class="ulink" href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.GNUkFreeBSD" target="_top">README.GNUkFreeBSD</a></td>
</tr>
<tr>
<td><a class="ulink" href="https://www.bitrig.org/" target="_top">Bitrig</a></td>
<td align="center">Jun 2014</td>
<td>Removed from pkgsrc Sep 2022</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="overview"></a>1.2. Overview</h2></div></div></div>
<p>This document is divided into three parts. The first,
<a class="link" href="#users-guide" title="Part I. The pkgsrc user's guide">The pkgsrc user's guide</a>,
describes how one can use one of the packages in the Package
Collection, either by installing a precompiled binary package,
or by building one's own copy using the NetBSD package system.
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
package so it can be easily built by other NetBSD users without
knowing about the package's building details. The third part,
<a class="link" href="#infrastructure" title="Part III. The pkgsrc infrastructure internals">The pkgsrc infrastructure internals</a>
is intended for those who want to understand how pkgsrc is
implemented.</p>
<p>This document is available in various formats:
<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>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="terminology"></a>1.3. Terminology</h2></div></div></div>
<p>There has been a lot of talk about <span class="quote">“<span class="quote">ports</span>”</span>,
<span class="quote">“<span class="quote">packages</span>”</span>, etc. so far. Here is a description of all the
terminology used within this document.</p>
<div class="variablelist"><dl class="variablelist">
<dt><span class="term">Package</span></dt>
<dd><p>A set of files and building instructions
that describe what's necessary
to build a certain piece of software using
pkgsrc. Packages are traditionally stored under
<code class="filename">/usr/pkgsrc</code>,
but may be stored in any location,
referred to as <code class="varname">PKGSRCDIR</code>.</p></dd>
<dt><span class="term">The NetBSD package system</span></dt>
<dd><p>This is the former name of <span class="quote">“<span class="quote">pkgsrc</span>”</span>. It
is part of the NetBSD operating system and can be bootstrapped
to run on non-NetBSD operating systems as well. It handles
building (compiling), installing, and removing of
packages.</p></dd>
<dt><span class="term">Distfile</span></dt>
<dd><p>This term describes the file or files that are
provided by the author of the piece of software to
distribute his work. All the changes necessary to build on
NetBSD are reflected in the corresponding package. Usually
the distfile is in the form of a compressed tar-archive,
but other types are possible, too. Distfiles are usually
stored below
<code class="filename">/usr/pkgsrc/distfiles</code>.</p></dd>
<dt><span class="term">Port</span></dt>
<dd><p>This is the term used by FreeBSD and OpenBSD people
for what we call a package.
In NetBSD terminology, <span class="quote">“<span class="quote">port</span>”</span> refers to a different
architecture.</p></dd>
<dt><span class="term">Precompiled/binary package</span></dt>
<dd>
<p>A set of binaries built with pkgsrc from a distfile
and stuffed together in a single <code class="filename">.tgz</code>
file so it can be installed on machines of the same
machine architecture without the need to
recompile. Packages are usually generated in
<code class="filename">/usr/pkgsrc/packages</code>; there is also
an archive on <a class="ulink" href="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/" target="_top">ftp.NetBSD.org</a>.</p>
<p>Sometimes, this is referred to by the term <span class="quote">“<span class="quote">package</span>”</span> too,
especially in the context of precompiled packages.</p>
</dd>
<dt><span class="term">Program</span></dt>
<dd><p>The piece of software to be installed which will be
constructed from all the files in the distfile by the
actions defined in the corresponding package.</p></dd>
</dl></div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="term.roles"></a>1.3.1. Roles involved in pkgsrc</h3></div></div></div>
<div class="variablelist"><dl class="variablelist">
<dt><span class="term">pkgsrc users</span></dt>
<dd>
<p>The
pkgsrc users are people who use the packages provided by pkgsrc.
Typically they are system administrators. The people using the
software that is inside the packages (maybe called <span class="quote">“<span class="quote">end
users</span>”</span>) are not covered by the pkgsrc guide.</p>
<p>There are two kinds of pkgsrc users: Some only want to
install pre-built binary packages. Others build the pkgsrc
packages from source, either for installing them directly or for
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
documentation.</p>
</dd>
<dt><span class="term">package maintainers</span></dt>
<dd><p>A
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>
<dt><span class="term">infrastructure developers</span></dt>
<dd><p>These people are involved in all those files
that live in the <code class="filename">mk/</code> directory and below.
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,
too.</p></dd>
</dl></div>
</div>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="typography"></a>1.4. Typography</h2></div></div></div>
<p>When giving examples for commands, shell prompts are used to
show if the command should/can be issued as root, or if
<span class="quote">“<span class="quote">normal</span>”</span> user privileges are sufficient. We use a
<code class="prompt">#</code> for root's shell prompt, a <code class="prompt">%</code> for users'
shell prompt, assuming they use the C-shell or tcsh and a <code class="prompt">$</code> for
Bourne shell and derivatives.</p>
</div>
</div>
<div class="part">
<div class="titlepage"><div><div><h1 class="title">
<a name="users-guide"></a>Part I. The pkgsrc user's guide</h1></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="chapter"><a href="#help-user">2. Getting help</a></span></dt>
<dt><span class="chapter"><a href="#getting">3. Where to get pkgsrc and how to keep it up-to-date</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#getting-first">3.1. Getting pkgsrc for the first time</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#getting-via-tar">3.1.1. As tar archive</a></span></dt>
<dt><span class="sect2"><a href="#getting-via-cvs">3.1.2. Via anonymous CVS</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#uptodate">3.2. Keeping pkgsrc up-to-date</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#uptodate-tar">3.2.1. Via tar files</a></span></dt>
<dt><span class="sect2"><a href="#uptodate-cvs">3.2.2. Via CVS</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#platforms">4. Using pkgsrc on systems other than NetBSD</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#binarydist">4.1. Binary distribution</a></span></dt>
<dt><span class="sect1"><a href="#bootstrapping-pkgsrc">4.2. Bootstrapping pkgsrc</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#using">5. Using pkgsrc</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#using-pkg">5.1. Using binary packages</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#finding-binary-packages">5.1.1. Finding binary packages</a></span></dt>
<dt><span class="sect2"><a href="#installing-binary-packages">5.1.2. Installing binary packages</a></span></dt>
<dt><span class="sect2"><a href="#using.pkgin_update">5.1.3. Updating packages</a></span></dt>
<dt><span class="sect2"><a href="#using.pkg_delete">5.1.4. Deinstalling packages</a></span></dt>
<dt><span class="sect2"><a href="#using.pkg_info">5.1.5. Getting information about installed packages</a></span></dt>
<dt><span class="sect2"><a href="#vulnerabilities">5.1.6. Checking for security vulnerabilities in installed packages</a></span></dt>
<dt><span class="sect2"><a href="#pkg_versions">5.1.7. Finding if newer versions of your installed packages are in pkgsrc</a></span></dt>
<dt><span class="sect2"><a href="#using.pkg_admin">5.1.8. Other administrative functions</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#building-packages-from-source">5.2. Building packages from source</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#requirements">5.2.1. Requirements</a></span></dt>
<dt><span class="sect2"><a href="#fetching-distfiles">5.2.2. Fetching distfiles</a></span></dt>
<dt><span class="sect2"><a href="#how-to-build-and-install">5.2.3. How to build and install</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#configuring">6. Configuring pkgsrc</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#general-configuration">6.1. General configuration</a></span></dt>
<dt><span class="sect1"><a href="#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt>
<dt><span class="sect1"><a href="#native-or-pkgsrc-preference">6.3. Preferences for native or pkgsrc software</a></span></dt>
<dt><span class="sect1"><a href="#variables-affecting-installation">6.4. Variables affecting the installation process</a></span></dt>
<dt><span class="sect1"><a href="#conf.compiler">6.5. Selecting and configuring the compiler</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#selecting-the-compiler">6.5.1. Selecting the compiler</a></span></dt>
<dt><span class="sect2"><a href="#conf.cflags">6.5.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt>
<dt><span class="sect2"><a href="#conf.ldflags">6.5.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#developer-advanced-settings">6.6. Developer/advanced settings</a></span></dt>
<dt><span class="sect1"><a href="#selecting-build-options">6.7. Selecting Build Options</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#binary">7. Creating binary packages</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#building-a-single-binary-package">7.1. Building a single binary package</a></span></dt>
<dt><span class="sect1"><a href="#settings-for-creationg-of-binary-packages">7.2. Settings for creation of binary packages</a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#bulk">8. Creating binary packages for everything in pkgsrc (bulk
builds)</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#bulk.pre">8.1. Preparations</a></span></dt>
<dt><span class="sect1"><a href="#bulk.pbulk">8.2. Running a bulk build</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#bulk.pbulk.conf">8.2.1. Configuration</a></span></dt></dl></dd>
<dt><span class="sect1"><a href="#bulk.req">8.3. Requirements of a full bulk build</a></span></dt>
<dt><span class="sect1"><a href="#bulk.var">8.4. Bulk build variants</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="#bulk.var.confopt">8.4.1. Detect unknown configure options</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.comperr">8.4.2. Detect classes of bugs by forcing compiler warnings</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.builderr">8.4.3. Force compiler options only in the build phase</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.dirs">8.4.4. Use custom directories</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.warn">8.4.5. Turn warnings into errors</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.pkglint">8.4.6. Reject packages for which pkglint reports errors</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.strings">8.4.7. Reject packages that contain forbidden strings</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.test">8.4.8. Reject packages whose self-test fails</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.shvar">8.4.9. Reject packages that use undefined shell variables</a></span></dt>
<dt><span class="sect2"><a href="#bulk.var.quiet">8.4.10. Turn off verbose logging</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="#creating-cdroms">8.5. Creating a multiple CD-ROM packages collection</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="#cdpack-example">8.5.1. Example of cdpack</a></span></dt></dl></dd>
</dl></dd>
<dt><span class="chapter"><a href="#files">9. Directory layout of the installed files</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#files.localbase">9.1. File system layout in <code class="literal">${LOCALBASE}</code></a></span></dt>
<dt><span class="sect1"><a href="#files.varbase">9.2. File system layout in <code class="literal">${VARBASE}</code></a></span></dt>
</dl></dd>
<dt><span class="chapter"><a href="#faq">10. Frequently Asked Questions</a></span></dt>
<dd><dl>
<dt><span class="sect1"><a href="#mailing-list-pointers">10.1. Are there any mailing lists for pkg-related discussion?</a></span></dt>
<dt><span class="sect1"><a href="#faq-pkgtools">10.2. Utilities for package management (pkgtools)</a></span></dt>
<dt><span class="sect1"><a href="#non-root-pkgsrc">10.3. How to use pkgsrc as non-root</a></span></dt>
<dt><span class="sect1"><a href="#resume-transfers">10.4. How to resume transfers when fetching distfiles?</a></span></dt>
<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>
<dt><span class="sect1"><a href="#fetch-behind-firewall">10.6. How to fetch files from behind a firewall</a></span></dt>
<dt><span class="sect1"><a href="#fetch-https">10.7. How to fetch files from HTTPS sites</a></span></dt>
<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>
<dt><span class="sect1"><a href="#fetching-all-distfiles">10.9. How to fetch all distfiles at once</a></span></dt>
<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
/usr/share/tmac/tmac.andoc</span>”</span> mean?</a></span></dt>
<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>
<dt><span class="sect1"><a href="#using-sudo-with-pkgsrc">10.12. Using 'sudo' or `priv` with pkgsrc</a></span></dt>
<dt><span class="sect1"><a href="#faq.conf">10.13. How do I change the location of configuration files?</a></span></dt>
<dt><span class="sect1"><a href="#audit-packages">10.14. Automated security checks</a></span></dt>
<dt><span class="sect1"><a href="#ufaq-cflags">10.15. Why do some packages ignore my <code class="varname">CFLAGS</code>?</a></span></dt>
<dt><span class="sect1"><a href="#ufaq-fail">10.16. A package does not build. What shall I do?</a></span></dt>
<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>
</dl></dd>
</dl>
</div>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
<a name="help-user"></a>Chapter 2. Getting help</h2></div></div></div>
<p>
To get help when using pkgsrc, the definitive source is this
document, the pkgsrc guide. If you don't find anything here,
there are alternatives:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The built-in pkgsrc help, which is available after bootstrapping
pkgsrc. Run <span class="command"><strong>bmake help topic=…</strong></span> to get
help for any topic, such as a variable name like
<code class="varname">BUILD_DEFS</code>, a make target like
<span class="command"><strong>do-build</strong></span>, a missing C or C++ function like
<span class="command"><strong>strcasecmp</strong></span> or any other topic.</p>
<p>The available help topics are listed in <a class="xref" href="#help-topics" title="Appendix E. Help topics">Appendix E, <i>Help topics</i></a>.</p>
</li>
<li class="listitem"><p>
To see the value of a single variable, run <span class="command"><strong>bmake
show-var VARNAME=<em class="replaceable"><code>X</code></em></strong></span>.
</p></li>
<li class="listitem"><p>
To see the values of the most common variables, run
<span class="command"><strong>bmake show-all</strong></span>. These variables are grouped by
topic. To see the variables for a single topic, run
<span class="command"><strong>bmake
show-all-<em class="replaceable"><code>topic</code></em></strong></span>, for example
<span class="command"><strong>bmake show-all-fetch</strong></span>.
</p></li>
<li class="listitem"><p>
The pkgsrc-users mailing list, to which
<a class="ulink" href="https://www.NetBSD.org/mailinglists/#pkgsrc-users" target="_top">you
can subscribe</a> and then <a class="ulink" href="mailto:[email protected]" target="_top">ask your
questions</a>.</p></li>
<li class="listitem"><p>The #pkgsrc IRC channel, which is accessible
<a class="ulink" href="https://webchat.freenode.net/" target="_top">via a web browser</a>
or by using a specialized chat program such as
<a class="ulink" href="http://xchat.org/" target="_top">XChat</a>.
Pick any user name and join the channel #pkgsrc.</p></li>
</ul></div>
</div>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
<a name="getting"></a>Chapter 3. Where to get pkgsrc and how to keep it up-to-date</h2></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">