pkgsrc/doc/guide/files/introduction.xml

396 lines
15 KiB
XML

<!-- $NetBSD: introduction.xml,v 1.45 2020/04/29 23:54:10 gutteridge Exp $ -->
<chapter id="introduction">
<title>What is pkgsrc?</title>
<sect1 id="introduction-section">
<title>Introduction</title>
<para>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.</para>
<para>pkgsrc currently contains several thousand packages,
including:</para>
<itemizedlist>
<listitem>
<para><filename role="pkg">www/apache24</filename> - The Apache
web server</para>
</listitem>
<listitem>
<para><filename role="pkg">www/firefox</filename> - The Firefox
web browser</para>
</listitem>
<listitem>
<para><filename role="pkg">meta-pkgs/gnome</filename> - The GNOME
Desktop Environment</para>
</listitem>
<listitem>
<para><filename role="pkg">meta-pkgs/kde4</filename> - The K
Desktop Environment</para>
</listitem>
</itemizedlist>
<para>&#x2026; just to name a few.</para>
<para>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.</para>
<sect2 id="why-pkgsrc">
<title>Why pkgsrc?</title>
<para>
pkgsrc provides the following key features:
</para>
<itemizedlist>
<listitem><para>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.</para></listitem>
<listitem><para>All packages are installed in a consistent directory tree,
including binaries, libraries, man pages and other
documentation.</para></listitem>
<listitem><para>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.</para></listitem>
<listitem><para>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 <emphasis>consistent across all
platforms</emphasis>.</para></listitem>
<listitem><para>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.</para></listitem>
<listitem><para>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.</para></listitem>
</itemizedlist>
<para>The following principles are basic to pkgsrc:</para>
<itemizedlist>
<listitem><para><quote>It should only work if it's right.</quote>
&mdash; 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 (<filename
role="pkg">pkgtools/pkglint</filename>), build-time checks (portability
of shell scripts), and post-installation checks (installed files,
references to shared libraries, script interpreters).</para></listitem>
<listitem><para><quote>If it works, it should work everywhere</quote>
&mdash; 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.</para></listitem>
</itemizedlist>
</sect2>
<sect2 id="intro.platforms">
<title>Supported platforms</title>
<para>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!</para>
<para>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:</para>
<table id="supported-platforms">
<title>Platforms supported by pkgsrc</title>
<tgroup cols = "3">
<thead>
<row>
<entry>Platform</entry>
<entry>Date Support Added</entry>
<entry>Notes</entry>
</row>
</thead>
<tbody>
<row>
<entry><ulink url="https://www.NetBSD.org/">NetBSD</ulink></entry>
<entry align="center">Aug 1997</entry>
</row>
<row>
<entry><ulink url="http://wwws.sun.com/software/solaris/">Solaris</ulink></entry>
<entry align="center">Mar 1999</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Solaris">README.Solaris</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.kernel.org/">Linux</ulink></entry>
<entry align="center">Jun 1999</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Linux">README.Linux</ulink></entry>
</row>
<row>
<entry>
<ulink url="https://developer.apple.com/macos/">Darwin / Mac OS X / OS X / macOS</ulink>
</entry>
<entry align="center">Oct 2001</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.MacOSX">README.MacOSX</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.freebsd.org/">FreeBSD</ulink></entry>
<entry align="center">Nov 2002</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.FreeBSD">README.FreeBSD</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.openbsd.org/">OpenBSD</ulink></entry>
<entry align="center">Nov 2002</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OpenBSD">README.OpenBSD</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.sgi.com/software/irix/">IRIX</ulink></entry>
<entry align="center">Dec 2002</entry>
<entry>
<ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX">README.IRIX</ulink>
<ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.IRIX5.3">README.IRIX5.3</ulink>
</entry>
</row>
<row>
<entry>BSD/OS</entry>
<entry align="center">Dec 2003</entry>
</row>
<row>
<entry><ulink url="https://www-1.ibm.com/servers/aix/">AIX</ulink></entry>
<entry align="center">Dec 2003</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.AIX">README.AIX</ulink></entry>
</row>
<row>
<entry>
<ulink url="https://www.microsoft.com/windows/sfu/">Interix</ulink>
(Microsoft Windows Services for Unix)
</entry>
<entry align="center">Mar 2004</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Interix">README.Interix</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.dragonflybsd.org/">DragonFlyBSD</ulink></entry>
<entry align="center">Oct 2004</entry>
</row>
<row>
<entry><ulink url="http://www.tru64.org/">OSF/1</ulink></entry>
<entry align="center">Nov 2004</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.OSF1">README.OSF1</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.hp.com/products1/unix/">HP-UX</ulink></entry>
<entry align="center">Apr 2007</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.HPUX">README.HPUX</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.haiku-os.org/">Haiku</ulink></entry>
<entry align="center">Sep 2010</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Haiku">README.Haiku</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.mirbsd.org/">MirBSD</ulink></entry>
<entry align="center">Jan 2011</entry>
</row>
<row>
<entry><ulink url="https://www.minix3.org/">Minix3</ulink></entry>
<entry align="center">Nov 2011</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Minix3">README.Minix3</ulink></entry>
</row>
<row>
<entry><ulink url="https://cygwin.com/">Cygwin</ulink></entry>
<entry align="center">Mar 2013</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Cygwin">README.Cygwin</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.debian.org/ports/kfreebsd-gnu/">GNU/kFreeBSD</ulink></entry>
<entry align="center">Jul 2013</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.GNUkFreeBSD">README.GNUkFreeBSD</ulink></entry>
</row>
<row>
<entry><ulink url="https://www.bitrig.org/">Bitrig</ulink></entry>
<entry align="center">Jun 2014</entry>
<entry><ulink url="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/bootstrap/README.Bitrig">README.Bitrig</ulink></entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1>
<sect1 id="overview">
<title>Overview</title>
<para>This document is divided into three parts. The first,
<link linkend="users-guide" endterm="users-guide.title"/>,
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 &os; package system.
The second part, <link linkend="developers-guide"
endterm="developers-guide.title"/>, explains how to prepare a
package so it can be easily built by other &os; users without
knowing about the package's building details. The third part,
<link linkend="infrastructure" endterm="infrastructure.title"/>
is intended for those who want to understand how pkgsrc is
implemented.</para>
<para>This document is available in various formats:
<simplelist type="inline">
<member><ulink url="index.html">HTML</ulink></member>
<member><ulink url="pkgsrc.pdf">PDF</ulink></member>
<member><ulink url="pkgsrc.ps">PS</ulink></member>
<member><ulink url="pkgsrc.txt">TXT</ulink></member>
</simplelist>.</para>
</sect1>
<sect1 id="terminology">
<title>Terminology</title>
<para>There has been a lot of talk about <quote>ports</quote>,
<quote>packages</quote>, etc. so far. Here is a description of all the
terminology used within this document.</para>
<variablelist>
<varlistentry>
<term>Package</term>
<listitem>
<para>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
<filename>/usr/pkgsrc</filename>,
but may be stored in any location,
referred to as <varname>PKGSRCDIR</varname>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>The &os; package system</term>
<listitem>
<para>This is the former name of <quote>pkgsrc</quote>. It
is part of the &os; operating system and can be bootstrapped
to run on non-&os; operating systems as well. It handles
building (compiling), installing, and removing of
packages.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Distfile</term>
<listitem>
<para>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
&os; 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
<filename>/usr/pkgsrc/distfiles</filename>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Port</term>
<listitem>
<para>This is the term used by FreeBSD and OpenBSD people
for what we call a package.
In &os; terminology, <quote>port</quote> refers to a different
architecture.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Precompiled/binary package</term>
<listitem>
<para>A set of binaries built with pkgsrc from a distfile
and stuffed together in a single <filename>.tgz</filename>
file so it can be installed on machines of the same
machine architecture without the need to
recompile. Packages are usually generated in
<filename>/usr/pkgsrc/packages</filename>; there is also
an archive on <ulink
url="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/">ftp.NetBSD.org</ulink>.</para>
<para>Sometimes, this is referred to by the term <quote>package</quote> too,
especially in the context of precompiled packages.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Program</term>
<listitem>
<para>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.</para>
</listitem>
</varlistentry>
</variablelist>
<sect2 id="term.roles">
<title>Roles involved in pkgsrc</title>
<variablelist>
<varlistentry><term>pkgsrc users</term><listitem><para>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 <quote>end
users</quote>) are not covered by the pkgsrc guide.</para>
<para>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 <xref
linkend="users-guide"/> should provide all necessary
documentation.</para></listitem></varlistentry>
<varlistentry><term>package maintainers</term><listitem><para>A
package maintainer creates packages as described in <xref
linkend="developers-guide"/>.</para></listitem></varlistentry>
<varlistentry><term>infrastructure developers</term>
<listitem><para>These people are involved in all those files
that live in the <filename>mk/</filename> directory and below.
Only these people should need to read through <xref
linkend="infrastructure"/>, though others might be curious,
too.</para></listitem></varlistentry>
</variablelist>
</sect2>
</sect1>
<sect1 id="typography">
<title>Typography</title>
<para>When giving examples for commands, shell prompts are used to
show if the command should/can be issued as root, or if
<quote>normal</quote> user privileges are sufficient. We use a
&rprompt; for root's shell prompt, a &cprompt; for users'
shell prompt, assuming they use the C-shell or tcsh and a &uprompt; for
bourne shell and derivatives.</para>
</sect1>
</chapter>