summaryrefslogtreecommitdiff
path: root/pkgtools/libnbcompat/files/README
blob: 0117f5b2734a8678f23bd98404ac7681f37bd0b9 (plain)
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
$NetBSD: README,v 1.15 2007/05/22 18:06:39 tnn Exp $

 0 Introduction
 ==============

libnbcompat builds and installs a portable NetBSD-compatibility library
that supplies routines missing on operating systems that are used by
the family of pkgsrc bootstrap tools.  Note that libnbcompat is very
much a work-in-progress.  Only the functions that are directly used
by the bootstrap tools are implemented in the library.  At the moment,
this includes the following packages:

	archivers/pax
	pkgtools/mtree
	pkgtools/pkg_install
	textproc/nbsed

A script, src2nbcompat, is also included in the sources that simplifies
importing software from the NetBSD src module into pkgsrc.


 1 Updating this package
 =======================

Please take care when updating this package.  Do *not* simply commit
changes to this package and ask for testers.  This package is too
fundamental to the proper bootstrapping of pkgsrc to let accidental
breakage seep in.  Proper methodology for updating this package is:

    (1) Post a tarball at a publicly accessible URL containing the
	pkgtools/libnbcompat directory.

    (2) Ask on the tech-pkg@NetBSD.org mailing list for testers.

    (3) Fix any breakage on non-NetBSD operating systems before
	committing.


 2 Tested operating systems
 ==========================

*NOTE*
*NOTE* This section should be kept up-to-date with the results for
*NOTE* the most recent libnbcompat.
*NOTE*

libnbcompat-20040911 has been tested to build and install correctly
on the following operating systems:

	FreeBSD-4.8/i386		<jlam@NetBSD.org>
	NetBSD-1.6.2/i386		<jlam@NetBSD.org>
	Solaris 9/sparc			<salo@NetBSD.org>

libnbcompat-20041024 has been tested to build and install correctly
on the following operating systems:

	FreeBSD-4.11/i386		<jschauma@NetBSD.org>
	FreeBSD-6.1/amd64		<jschauma@NetBSD.org>
	Darwin-8.3/powerpc		<schwarz@NetBSD.org>
	IRIX-5.3/mipseb			<schwarz@NetBSD.org>
	IRIX-6.5/mipseb			<jschauma@NetBSD.org>
	Linux/i386			<schwarz@NetBSD.org>
	RHEL4 Linux 2.6/i386		<jschauma@NetBSD.org>

libnbcompat-20070507 has been tested to build and install correctly
on the following operating systems:

	DragonFly-1.8/i386		<joerg@NetBSD.org>
	HPUX-11.11/hppa			<tnn@NetBSD.org>
	OSF1-5.1B/alpha			<tnn@NetBSD.org>
	Solaris 10/sparc		<tnn@NetBSD.org>

 3 Usage
 =======

This library is intended to simplify porting NetBSD software.  To that
end, the changes to NetBSD sources to use libnbcompat are minor.  The
procedure is:

    (1) Add #include <nbcompat.h> at the top of the source files that
	include system headers, but below the inclusion of any
	"config.h".

    (2) Surround each system header file included in the source file
	with #if HAVE_<header_name>_H ... #endif.

You may need to add additional headers present on other operating
systems that define any system-supplied functions, e.g. <sys/vfs.h>.

The src2nbcompat script included in the libncompat sources can be used
to automate this process to some extent.  It is intended to import
sources from a NetBSD src checkout into pkgsrc.  It will copy the
sources from a directory and automatically insert the proper lines
into the files.  For example, to import the pkg_install sources into
pkgsrc, run:

	src2nbcompat \
		/usr/src/usr.sbin/pkg_install \
		/usr/pkgsrc/pkgtools/pkg_install/files

You will need to run a "cvs diff" on the imported files to check that
any local changes are preserved across imports.