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
|
<!-- $NetBSD: platforms.xml,v 1.54 2007/04/21 02:57:58 kano Exp $ -->
<chapter id="platforms">
<title>Using pkgsrc on systems other than &os;</title>
<sect1 id="binarydist">
<title>Binary distribution</title>
<para>
We provide a bootstrap kit in both source and binary form for other
platforms than &os;, consisting of the pkg administration tools and other
tools required to use pkgsrc and build packages.
</para>
<note><para>
Older binary snapshots are available in the
<ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/archive/">bootstrap-pkgsrc/archive</ulink>
directory on ftp.NetBSD.org.</para>
</note>
<table id="binary-kits">
<title>Binary kits and available packages</title>
<tgroup cols="4">
<thead>
<row>
<entry>Platform</entry>
<entry>Latest snapshot</entry>
<entry>Binary kit</entry>
<entry>Binary packages</entry>
</row>
</thead>
<tbody>
<row>
<entry role="osname">Darwin 5.5/powerpc (Mac OS X 10.1.5)</entry>
<entry role="date">20021209</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Darwin-5.5-powerpc-20021209.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Darwin 6.6/powerpc (Mac OS X 10.2.6)</entry>
<entry role="date">20030623</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Darwin-6.6-powerpc-20030623.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Darwin 7.6/powerpc (Mac OS X 10.3.6)</entry>
<entry role="date">20041219</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Darwin-7.6.0-powerpc-20041219.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/Darwin-7.6/">binary packages</ulink></entry>
</row>
<row>
<entry role="osname">Darwin 7.8/powerpc (Mac OS X 10.3.8)</entry>
<entry role="date">20050320</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Darwin-7.8.0-powerpc-20050320.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Darwin 8.1/powerpc (Mac OS X 10.4.1)</entry>
<entry role="date">20050625</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Darwin-8.1.0-powerpc-20050625.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/Darwin-8.1/powerpc/current/">binary packages</ulink></entry>
</row>
<row>
<entry role="osname">Debian GNU Linux/i386</entry>
<entry role="date">20031023</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Linux-2.4.22-debian-i386-20031023.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Fedora Core 2 Linux/i386</entry>
<entry role="date">20050618</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Linux-2.6.10-i386-fc2-20050618.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Fedora Core 4 Linux/i386</entry>
<entry role="date">20060105</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Linux-2.6.11-i386-fc4-20060105.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">FreeBSD 3.5/i386</entry>
<entry role="date">20030411</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-FreeBSD-3.5-STABLE-i386-20030411.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">FreeBSD 4.7/i386</entry>
<entry role="date">20021211</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-FreeBSD-4.7-RELEASE-i386-20021211.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">FreeBSD 5.0/i386</entry>
<entry role="date">20030411</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-FreeBSD-5.0-RELEASE-i386-20030411.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">FreeBSD 5.1/i386</entry>
<entry role="date">20030630</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-FreeBSD-5.1-RELEASE-i386-20030630.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">FreeBSD 5.2.1/i386</entry>
<entry role="date">20040227</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-FreeBSD-5.2.1-RELEASE-i386-20040227.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">FreeBSD 5.3/i386</entry>
<entry role="date">20050119</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-FreeBSD-5.3-RELEASE-i386-20050119.tar">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">HP-UX 11.11/hppa</entry>
<entry role="date">20070421</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-HPUX-B.11.11-hppa-20070421.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Interix 3.5</entry>
<entry role="date">20061106</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Interix-3.5-i386-20061106.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">IRIX 6.5 n32-bit ABI</entry>
<entry role="date">20040911</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-IRIX-6.5-mips-20040911.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/IRIX-6.5/n32/">binary packages</ulink></entry>
</row>
<row>
<entry role="osname">IRIX 6.5 64-bit ABI</entry>
<entry role="date">20040912</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-IRIX64-6.5-mips-20040912.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/IRIX-6.5/64/">binary packages</ulink></entry>
</row>
<row>
<entry role="osname">OpenBSD 3.2/i386</entry>
<entry role="date">20030420</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-OpenBSD-3.2-i386-20030420.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">OpenBSD 3.3/i386</entry>
<entry role="date">20030503</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-OpenBSD-3.3-i386-20030503.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">OpenBSD 3.5/i386</entry>
<entry role="date">20040703</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-OpenBSD-3.5-i386-20040703.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">OSF1 5.1/alpha</entry>
<entry role="date">20070420</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-OSF1-V5.1-alpha-20070420.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Slackware Linux 8.1/i386</entry>
<entry role="date">20030417</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Linux-2.4.18-slackware-20030417.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Slackware Linux 9/i386</entry>
<entry role="date">20040703</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-Linux-2.4.22-i386-slackware9-20040703.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Solaris 8/sparc</entry>
<entry role="date">20050220</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-SunOS-5.8-sparc-20050220.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Solaris 8/i386</entry>
<entry role="date">20050220</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-SunOS-5.8-i386-20050220.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Solaris 9/sparc</entry>
<entry role="date">20060713</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-SunOS-5.9-sparc-pkgsrc-2006Q2.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
<row>
<entry role="osname">Solaris 9/i386</entry>
<entry role="date">20030411</entry>
<entry role="kit-url"><ulink url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-SunOS-5.9-i386-20030411.tar.gz">binary kit</ulink></entry>
<entry role="binary-pkgs-url"></entry>
</row>
</tbody>
</tgroup>
</table>
<para>
Simply download the binary kit for your platform, and extract it into
<filename>/</filename> e.g.
</para>
<screen>&rprompt; <userinput>cd /</userinput>
&rprompt; <userinput>gzip -c -d /tmp/bootstrap-pkgsrc-SunOS-5.9-sparc-20031023.tar.gz \
| tar -xpf -</userinput></screen>
<para>
Of course, as with any binary distributions, you should verify the
checksum against the <ulink
url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/SUM">SUM</ulink>
or <ulink
url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/bootstrap-pkgsrc/CKSUM">CKSUM</ulink>
file and inspect the contents before extracting it.
</para>
</sect1>
<sect1 id="bootstrapping-pkgsrc">
<title>Bootstrapping pkgsrc</title>
<para>Installing the bootstrap kit from source should be as simple as:</para>
<screen>
&rprompt; <userinput>env CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout pkgsrc</userinput>
&rprompt; <userinput>cd pkgsrc/bootstrap</userinput>
&rprompt; <userinput>./bootstrap</userinput>
</screen>
<para>See <xref linkend="getting"/> for other ways to get
pkgsrc before bootstrapping. The given
<command>bootstrap</command> command will use the defaults of
<filename>/usr/pkg</filename> for the
<emphasis>prefix</emphasis> where programs will be installed in,
and <filename>/var/db/pkg</filename> for the package database
directory where pkgsrc will do its internal bookkeeping.
However, these can also be set using command-line
arguments.</para>
<para>Binary packages for the pkgsrc tools and an initial set of packages is
available for supported platforms. An up-to-date list of these can be
found on <ulink url="http://www.pkgsrc.org/">www.pkgsrc.org</ulink>.
Note that this only works for privileged builds that install
into <filename>/usr/pkg</filename>.</para>
<note>
<para>The bootstrap installs a <command>bmake</command> tool.
Use this <command>bmake</command> when building via pkgsrc.
For examples in this guide, use <command>bmake</command>
instead of <quote>make</quote>.</para>
</note>
</sect1>
<sect1 id="platform-specific-notes">
<title>Platform-specific notes</title>
<para>Here are some platform-specific notes you should be aware of.</para>
<sect2 id="darwin">
<title>Darwin (Mac OS X)</title>
<para>Darwin 5.x and up are supported. There are two methods of using
pkgsrc on Mac OS X, by using a <link linkend="platform.osx-image">disk
image</link>, or a <link linkend="platform.osx-part">UFS or HFSX
partition</link>.</para>
<para>Before you start, you will need to download and install the Mac OS X Developer
Tools from Apple's Developer Connection. See <ulink
url="http://developer.apple.com/macosx/">http://developer.apple.com/macosx/</ulink>
for details. Also, make sure you install X11 for Mac OS X and the X11 SDK
from <ulink
url="http://www.apple.com/macosx/x11/download/">http://www.apple.com/macosx/x11/download/</ulink>
if you intend to build packages that use the X11 Window System.</para>
<para>If you already have a UFS or HFSX partition, or have a spare partition
that you can format as UFS or HFSX, it is recommended to use that instead of
the disk image. It'll be somewhat faster and will mount automatically
at boot time, where you must manually mount a disk image.</para>
<note>
<para>You cannot use an ordinary HFS+ file system for pkgsrc, because pkgsrc currently
requires the file system to be case-sensitive. You can, however, use a case-sensitive HFS+ (aka HFSX) file system as found in Darwin 7.0 and newer.</para>
</note>
<sect3 id="platform.osx-image">
<title>Using a disk image</title>
<para>Create the disk image:</para>
<screen>&rprompt; <userinput>cd pkgsrc/bootstrap</userinput>
&rprompt; <userinput>./darwindiskimage create ~/Documents/NetBSD 1024</userinput> # megabytes - season to taste
&rprompt; <userinput>./darwindiskimage mount ~/Documents/NetBSD</userinput>
&rprompt; <userinput>sudo chown `id -u`:`id -g` /Volumes/NetBSD</userinput></screen>
<note>
<para>darwindiskimage will mount the filesystem nosuid, which will cause problems for packages that depend on setgid. In the case of UFS, it will also mount the filesystem asynchronous, which is somewhat dangerous according to the mount(8) man page. In the case of HFSX, it will disable journalling.</para>
</note>
<para>Allow suid:</para>
<screen>&rprompt; <userinput>sudo mount -u -o suid /Volumes/NetBSD</userinput></screen>
</sect3>
<sect3 id="platform.osx-part">
<title>Using a UFS or HFSX partition</title>
<para>By default, <filename>/usr</filename> will be on your root file
system, normally HFS+. It is possible to use the default
<emphasis>prefix</emphasis> of <filename>/usr/pkg</filename>
by symlinking <filename>/usr/pkg</filename> to a directory on a UFS
or HFSX file system. Obviously, another symlink is required if you want to
place the package database directory outside the
<emphasis>prefix</emphasis>. e.g.</para>
<screen>&rprompt; <userinput>./bootstrap --pkgdbdir /usr/pkg/pkgdb</userinput></screen>
<para>If you created your partitions at the time of installing Mac OS X
and formatted the target partition as UFS or HFSX, it should automatically
mount on <filename>/Volumes/<volume name></filename> when the
machine boots. If you are (re)formatting a partition as UFS or HFSX, you need
to ensure that the partition map correctly reflects
<quote>Apple_UFS</quote> or <quote>Apple_HFSX</quote> and not <quote>Apple_HFS</quote>.</para>
<para>The problem is that none of the disk tools will let you touch a
disk that is booted from. You can unmount the partition, but even if
you newfs it, the partition type will be incorrect and the
automounter won't mount it. It can be mounted manually, but it won't
appear in Finder.</para>
<para>You'll need to boot off of the OS X Installation (User) CD. When
the Installation program starts, go up to the menu and select Disk
Utility. Now, you will be able to select the partition you want
to be UFS or HFSX, and Format it Apple UFS or HFSX. Quit the Disk Utility, quit the
installer which will reboot your machine. The new UFS or HFSX file system
will appear in Finder.</para>
<para>Be aware that the permissions on the new file system will be writable
by root only.</para>
<para>This note is as of 10.2 (Jaguar) and applies to earlier versions.
Hopefully Apple will fix Disk Utility in 10.3 (Panther).</para>
</sect3>
</sect2>
<sect2 id="freebsd">
<title>FreeBSD</title>
<para>FreeBSD 4.7 and 5.0 have been tested and are supported,
other versions may work.</para>
<para>Care should be taken so that the tools that this kit installs do not conflict
with the FreeBSD userland tools. There are several steps:</para>
<orderedlist>
<listitem>
<para>FreeBSD stores its ports pkg database in
<filename>/var/db/pkg</filename>. It is therefore
recommended that you choose a different location (e.g.
<filename>/usr/pkgdb</filename>) by
using the --pkgdbdir option to the bootstrap script.</para>
</listitem>
<listitem>
<para>If you do not intend to use the FreeBSD ports tools, it's probably a
good idea to move them out of the way to avoid confusion, e.g.</para>
<screen>
&rprompt; <userinput>cd /usr/sbin</userinput>
&rprompt; <userinput>mv pkg_add pkg_add.orig</userinput>
&rprompt; <userinput>mv pkg_create pkg_create.orig</userinput>
&rprompt; <userinput>mv pkg_delete pkg_delete.orig</userinput>
&rprompt; <userinput>mv pkg_info pkg_info.orig</userinput>
</screen>
</listitem>
<listitem>
<para>An example <filename>/etc/mk.conf</filename> file will be placed in
<filename>/etc/mk.conf.example</filename> file
when you use the bootstrap script.</para>
</listitem>
</orderedlist>
</sect2>
<sect2 id="interix">
<title>Interix</title>
<para>Interix is a POSIX-compatible subsystem for the Windows NT kernel,
providing a Unix-like environment with a tighter kernel integration than
available with Cygwin. It is part of the Windows Services for Unix
package, available for free for any licensed copy of Windows 2000, XP
(not including XP Home), or 2003. SFU can be downloaded from <ulink
url="http://www.microsoft.com/windows/sfu/">http://www.microsoft.com/windows/sfu/</ulink>.</para>
<para>Services for Unix 3.5 has been tested. 3.0 or 3.1 may work, but
are not officially supported. (The main difference in 3.0/3.1 is lack
of pthreads, but other parts of libc may also be lacking.)</para>
<para>Services for Unix Applications (aka SUA) is an integrated component
of Windows Server 2003 R2 and Windows Vista. As of this writing, SUA's
Interix 5.x subsystem has not yet been tested with pkgsrc.</para>
<sect3 id="platform.interix-sfu-install">
<title>When installing Interix/SFU</title>
<para>At an absolute minimum, the following packages must be installed from
the Windows Services for Unix 3.5 distribution in order to use pkgsrc:</para>
<itemizedlist>
<listitem><para>Utilities -> Base Utilities</para></listitem>
<listitem><para>Interix GNU Components -> (all)</para></listitem>
<listitem><para>Remote Connectivity</para></listitem>
<listitem><para>Interix SDK</para></listitem>
</itemizedlist>
<para>When using pkgsrc on Interix, DO NOT install the Utilities subcomponent
"UNIX Perl". That is Perl 5.6 without shared module support, installed to
/usr/local, and will only cause confusion. Instead, install Perl 5.8 from
pkgsrc (or from a binary package).</para>
<para>The Remote Connectivity subcomponent "Windows Remote Shell Service" does
not need to be installed, but Remote Connectivity itself should be
installed in order to have a working inetd.</para>
<para>During installation you may be asked whether to enable setuid
behavior for Interix programs, and whether to make pathnames default to
case-sensitive. Setuid should be enabled, and case-sensitivity MUST be
enabled. (Without case-sensitivity, a large number of packages including
perl will not build.)</para>
<para>NOTE: Newer Windows service packs change the way binary execution
works (via the Data Execution Prevention feature). In order to use
pkgsrc and other gcc-compiled binaries reliably, a hotfix containing
POSIX.EXE, PSXDLL.DLL, PSXRUN.EXE, and PSXSS.EXE (899522 or newer)
must be installed. Hotfixes are available from Microsoft through a
support contract; however, a NetBSD developer has made most Interix
hotfixes available for personal use from <ulink
url="http://www.duh.org/interix/hotfixes.php">http://www.duh.org/interix/hotfixes.php</ulink>.</para>
<para>In addition to the hotfix noted above, it may be necessary to
disable Data Execution Prevention entirely to make Interix functional.
This may happen only with certain types of CPUs; the cause is not fully
understood at this time. If gcc or other applications still segfault
repeatedly after installing one of the hotfixes note above, the
following option can be added to the appropriate "boot.ini" line on the
Windows boot drive: /NoExecute=AlwaysOff
(WARNING, this will disable DEP completely, which may be a security
risk if applications are often run as a user in the Administrators
group!)</para>
</sect3>
<sect3 id="platform.interix-sfu-postinstall">
<title>What to do if Interix/SFU is already installed</title>
<para>If SFU is already installed and you wish to alter these settings to work
with pkgsrc, note the following things.</para>
<itemizedlist>
<listitem>
<para>To uninstall UNIX Perl, use Add/Remove Programs, select Microsoft
Windows Services for UNIX, then click Change. In the installer, choose
Add or Remove, then uncheck Utilities->UNIX Perl.</para>
</listitem>
<listitem>
<para>To enable case-sensitivity for the file system, run REGEDIT.EXE, and
change the following registry key:</para>
<para>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel</para>
<para>Set the DWORD value "obcaseinsensitive" to 0; then reboot.</para>
</listitem>
<listitem>
<para>To enable setuid binaries (optional), run REGEDIT.EXE, and change the
following registry key:</para>
<para>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Services for UNIX</para>
<para>Set the DWORD value "EnableSetuidBinaries" to 1; then reboot.</para>
</listitem>
</itemizedlist>
</sect3>
<sect3 id="platform.interix-notes">
<title>Important notes for using pkgsrc</title>
<para>The package manager (either the pkgsrc "su" user, or the user
running "pkg_add") must be a member of the local Administrators
group. Such a user must also be used to run the bootstrap. This is
slightly relaxed from the normal pkgsrc requirement of "root".</para>
<para>The package manager should use a umask of 002. "make install" will
automatically complain if this is not the case. This ensures that
directories written in /var/db/pkg are Administrators-group writeable.</para>
<para>The popular Interix binary packages from http://www.interopsystems.com/
use an older version of pkgsrc's pkg_* tools. Ideally, these should
NOT be used in conjunction with pkgsrc. If you choose to use them at
the same time as the pkgsrc packages, ensure that you use the proper
pkg_* tools for each type of binary package.</para>
<para>The TERM setting used for DOS-type console windows (including those
invoked by the csh and ksh startup shortcuts) is "interix". Most systems
don't have a termcap/terminfo entry for it, but the following .termcap
entry provides adequate emulation in most cases:</para>
<programlisting>
interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi:
</programlisting>
</sect3>
<sect3 id="platform.interix-limits">
<title>Limitations of the Interix platform</title>
<para>Though Interix suffices as a familiar and flexible substitute
for a full Unix-like platform, it has some drawbacks that should
be noted for those desiring to make the most of Interix.</para>
<itemizedlist>
<listitem><para><emphasis role="strong">X11:</emphasis></para>
<para>Interix comes with the standard set of X11R6 client libraries,
and can run X11 based applications, but it does
<emphasis>not</emphasis> come with an X server. Some options are
<ulink url="http://www.starnet.com/products/xwin32/">StarNet X-Win32</ulink>,
<ulink url="http://connectivity.hummingbird.com/products/nc/exceed/">Hummingbird Exceed</ulink>
(available in a trimmed version for Interix from Interop Systems as the
<ulink url="http://www.interopsystems.com/InteropXserver.htm">Interop X Server</ulink>),
and the free X11 server included with
<ulink url="http://x.cygwin.com/">Cygwin</ulink>.</para>
</listitem>
<listitem><para><emphasis role="strong">X11 acceleration:</emphasis></para>
<para>Because Interix runs in a completely different NT subsystem from
Win32 applications, it does not currently support various X11
protocol extensions for acceleration (such as MIT-SHM or DGA).
Most interactive applications to a local X server will run
reasonably fast, but full motion video and other graphics
intensive applications may require a faster-than-expected CPU.</para></listitem>
<listitem><para><emphasis role="strong">Audio:</emphasis></para>
<para>Interix has no native support for audio output. For audio
support, pkgsrc uses the <command>esound</command> client/server
audio system on Interix. Unlike on most platforms, the
<filename role="pkg">audio/esound</filename> package does
<emphasis>not</emphasis> contain the <command>esd</command>
server component. To output audio via an Interix host, the
<filename role="pkg">emulators/cygwin_esound</filename> package
must also be installed.</para></listitem>
<listitem><para><emphasis role="strong">CD/DVDs, USB, and SCSI:</emphasis></para>
<para>Direct device access is not currently supported in Interix, so it
is not currently possible to access CD/DVD drives, USB devices,
or SCSI devices through non-filesystem means. Among other things,
this makes it impossible to use Interix directly for CD/DVD
burning.</para></listitem>
<listitem><para><emphasis role="strong">Tape drives:</emphasis></para>
<para>Due to the same limitations as for CD-ROMs and SCSI devices, tape
drives are also not directly accessible in Interix. However,
support is in work to make tape drive access possible by using
Cygwin as a bridge (similarly to audio bridged via Cygwin's
esound server).</para></listitem>
</itemizedlist>
</sect3>
<sect3 id="platform.interix-knownissues">
<title>Known issues for pkgsrc on Interix</title>
<para>It is not necessary, in general, to have a "root" user on the
Windows system; any member of the local Administrators group will
suffice. However, some packages currently assume that the user
named "root" is the privileged user. To accommodate these, you
may create such a user; make sure it is in the local group
Administrators (or your language equivalent).</para>
<para><command>pkg_add</command> creates directories of mode
0755, not 0775, in <filename>$PKG_DBDIR</filename>. For the
time being, install packages as the local Administrator (or
your language equivalent), or run the following command after
installing a package to work around the issue:</para>
<screen>
&rprompt; <userinput>chmod -R g+w $PKG_DBDIR</userinput>
</screen>
</sect3>
</sect2>
<sect2 id="irix">
<title>IRIX</title>
<para>You will need a working C compiler, either gcc or SGI's MIPS and MIPSpro
compiler (cc/c89). Please set the <varname>CC</varname> environment variable
according to your preference. If you do not have a license for the MIPSpro
compiler suite, you can download a gcc tardist file from <ulink
url="http://freeware.sgi.com/">http://freeware.sgi.com/</ulink>.</para>
<para>Please note that you will need IRIX 6.5.17 or higher, as this is the earliest
version of IRIX providing support for &man.if.indextoname.3;, &man.if.nametoindex.3;,
etc.</para>
<para>At this point in time, pkgsrc only supports one ABI at a time. That is, you cannot
switch between the old 32-bit ABI, the new 32-bit ABI and the 64-bit ABI. If
you start out using "abi=n32", that's what all your packages will be built
with.</para>
<para>Therefore, please make sure that you have no conflicting
<varname>CFLAGS</varname> in your environment or the
<filename>/etc/mk.conf</filename>. Particularly, make sure that you do not
try to link n32 object files with lib64 or vice versa. Check your
<filename>/etc/compiler.defaults</filename>!</para>
<para>If you have the actual pkgsrc tree mounted via NFS from a different host,
please make sure to set <varname>WRKOBJDIR</varname> to a local directory,
as it appears that IRIX linker occasionally runs into issues when trying to
link over a network-mounted file system.</para>
<para>The bootstrapping process should set all the right options for programs such
as imake(1), but you may want to set some options depending on your local
setup. Please see <filename>pkgsrc/mk/defaults/mk.conf</filename> and, of
course, your compiler's man pages for details.</para>
<para>If you are using SGI's MIPSPro compiler, please set
<programlisting>
PKGSRC_COMPILER= mipspro
</programlisting>
in <filename>/etc/mk.conf</filename>. Otherwise, pkgsrc will assume you
are using gcc and may end up passing invalid flags to the compiler. Note that
bootstrap should create an appropriate <filename>mk.conf.example</filename> by
default.</para>
<para>If you have both the MIPSPro compiler chain installed as well as gcc,
but want to make sure that MIPSPro is used, please set your <varname>PATH</varname>
to <emphasis>not</emphasis> include the location of gcc (often
<filename>/usr/freeware/bin</filename>), and (important) pass the
'--preserve-path' flag.</para>
</sect2>
<sect2 id="linux">
<title>Linux</title>
<para>Some versions of Linux (for example Debian GNU/Linux) need
either libtermcap or libcurses (libncurses). Installing the
distributions libncurses-dev package (or equivalent) should fix
the problem.</para>
<para>pkgsrc supports both gcc (GNU Compiler Collection) and icc
(Intel C++ Compiler). gcc is the default. icc 8.0 and 8.1 on
i386 have been tested.</para>
<para>To bootstrap using icc, assuming the default icc installation
directory:</para>
<programlisting>
env CC=/opt/intel_cc_80/bin/icc LDFLAGS=-static-libcxa \
ac_cv___attribute__=yes ./bootstrap
</programlisting>
<note>
<para>icc 8.1 needs the `-i-static' argument instead of -static-libcxa.</para>
</note>
<para>icc supports __attribute__, but the GNU configure test uses a nested
function, which icc does not support. #undef'ing __attribute__ has the
unfortunate side-effect of breaking many of the Linux header files, which
cannot be compiled properly without __attribute__. The test must be
overridden so that __attribute__ is assumed supported by the
compiler.</para>
<para>After bootstrapping, you should set <varname>PKGSRC_COMPILER</varname>
in <filename>/etc/mk.conf</filename>:</para>
<programlisting>
PKGSRC_COMPILER= icc
</programlisting>
<para>The default installation directory for icc is
<filename>/opt/intel_cc_80</filename>, which
is also the pkgsrc default. If you have installed it into a different
directory, set <varname>ICCBASE</varname> in
<filename>/etc/mk.conf</filename>:</para>
<programlisting>
ICCBASE= /opt/icc
</programlisting>
<para>pkgsrc uses the static linking method of the runtime libraries
provided by icc, so binaries can be run on other systems which do not
have the shared libraries installed.</para>
<para>Libtool, however, extracts a list of libraries from the
&man.ld.1; command run when linking a C++ shared library and
records it, throwing away the -Bstatic and -Bdynamic options
interspersed between the libraries. This means that
libtool-linked C++ shared libraries will have a runtime
dependency on the icc libraries until this is fixed in
libtool.</para>
</sect2>
<sect2 id="openbsd">
<title>OpenBSD</title>
<para>OpenBSD 3.0 and 3.2 are tested and supported.</para>
<para>Care should be taken so that the tools that this kit installs do not conflict
with the OpenBSD userland tools. There are several steps:</para>
<orderedlist>
<listitem>
<para>OpenBSD stores its ports pkg database in
<filename>/var/db/pkg</filename>. It is therefore
recommended that you choose a different location (e.g.
<filename>/usr/pkgdb</filename>) by
using the --pkgdbdir option to the bootstrap script.</para>
</listitem>
<listitem>
<para>If you do not intend to use the OpenBSD ports tools, it's probably a
good idea to move them out of the way to avoid confusion, e.g.</para>
<screen>
&rprompt; <userinput>cd /usr/sbin</userinput>
&rprompt; <userinput>mv pkg_add pkg_add.orig</userinput>
&rprompt; <userinput>mv pkg_create pkg_create.orig</userinput>
&rprompt; <userinput>mv pkg_delete pkg_delete.orig</userinput>
&rprompt; <userinput>mv pkg_info pkg_info.orig</userinput>
</screen>
</listitem>
<listitem>
<para>An example <filename>/etc/mk.conf</filename> file will be placed in
<filename>/etc/mk.conf.example</filename> file
when you use the bootstrap script. OpenBSD's make program uses
<filename>/etc/mk.conf</filename>
as well. You can work around this by enclosing all the pkgsrc-specific parts
of the file with:</para>
<programlisting>
.ifdef BSD_PKG_MK
# pkgsrc stuff, e.g. insert defaults/mk.conf or similar here
.else
# OpenBSD stuff
.endif
</programlisting>
</listitem>
</orderedlist>
</sect2>
<sect2 id="solaris">
<title>Solaris</title>
<para>Solaris 2.6 through 9 are supported on both x86 and sparc.
You will need a working C compiler. Both gcc 2.95.3 and
Sun WorkShop 5 have been tested.</para>
<para>The following packages are required on Solaris 8 for the bootstrap
process and to build packages.</para>
<itemizedlist>
<listitem><para>SUNWsprot</para></listitem>
<listitem><para>SUNWarc</para></listitem>
<listitem><para>SUNWbtool</para></listitem>
<listitem><para>SUNWtoo</para></listitem>
<listitem><para>SUNWlibm</para></listitem>
</itemizedlist>
<para>Please note that the use of GNU binutils on Solaris is
<emphasis>not</emphasis> supported, as of June 2006.</para>
<para>Whichever compiler you use, please ensure the compiler tools and
your $prefix are in your <varname>PATH</varname>. This includes
<filename>/usr/ccs/{bin,lib}</filename>
and e.g. <filename>/usr/pkg/{bin,sbin}</filename>.</para>
<sect3 id="solaris-gcc-note">
<title>If you are using gcc</title>
<para>It makes life much simpler if you only use the same gcc consistently
for building all packages.</para>
<para>It is recommended that an external gcc be used only for bootstrapping,
then either build gcc from
<filename role="pkg">lang/gcc</filename> or install a binary gcc
package, then remove gcc used during bootstrapping.</para>
<para>Binary packages of gcc can be found through <ulink
url="http://www.sunfreeware.com/"/>.</para>
</sect3>
<sect3 id="solaris-sun-workshop-note">
<title>If you are using Sun WorkShop</title>
<para>You will need at least the following packages installed (from WorkShop
5.0)</para>
<itemizedlist>
<listitem><para>SPROcc
- Sun WorkShop Compiler C 5.0</para></listitem>
<listitem><para>SPROcpl
- Sun WorkShop Compiler C++ 5.0</para></listitem>
<listitem><para>SPROild
- Sun WorkShop Incremental Linker</para></listitem>
<listitem><para>SPROlang
- Sun WorkShop Compilers common components</para></listitem>
</itemizedlist>
<para>You should set the following variables in your
<filename>mk.conf</filename> file:</para>
<programlisting>
CC= cc
CXX= CC
CPP= cc -E
CXXCPP= CC -E
</programlisting>
<note><para>The <varname>CPP</varname> setting might break some
packages that use the C preprocessor for processing things other
than C source code.</para></note>
</sect3>
<sect3 id="solaris-sunpro-64">
<title>Building 64-bit binaries with SunPro</title>
<para>To build 64-bit packages, you just need to have the
following lines in your <filename>mk.conf</filename>
file:</para>
<programlisting>
PKGSRC_COMPILER= sunpro
ABI= 64
</programlisting>
<note><para>This setting has been tested for the SPARC
architecture. Intel and AMD machines need some more
work.</para></note>
</sect3>
<sect3 id="plat.sunos.problems"><title>Common problems</title>
<para>Sometimes, when using <command>libtool</command>,
<filename>/bin/ksh</filename> crashes with a segmentation fault.
The workaround is to use another shell for the configure
scripts, for example by installing <filename
role="pkg">shells/bash</filename> and adding the following lines
to your <filename>mk.conf</filename>:</para>
<programlisting>
CONFIG_SHELL= ${LOCALBASE}/bin/bash
WRAPPER_SHELL= ${LOCALBASE}/bin/bash
</programlisting>
<para>Then, rebuild the <filename
role="pkg">devel/libtool-base</filename> package.</para>
</sect3>
</sect2>
</sect1>
</chapter>
|