FreeBSD-PortersHandbook.pdf
(
1284 KB
)
Pobierz
FreeBSD Porter’s Handbook
The FreeBSD Documentation Project
FreeBSD Porter’s Handbook
by The FreeBSD Documentation Project
Published April 2000
Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The FreeBSD Documentation Project
FreeBSD is a registered trademark of The FreeBSD Foundation.
UNIX is a registered trademark of The Open Group in the US and other countries.
Sun, Sun Microsystems, SunOS, Solaris, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and
other countries.
Apple and QuickTime are trademarks of Apple Computer, Inc., registered in the U.S. and other countries.
Macromedia and Flash are trademarks or registered trademarks of Macromedia, Inc. in the United States and/or other countries.
Microsoft, Windows, and Windows Media are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
PartitionMagic is a registered trademark of PowerQuest Corporation in the United States and/or other countries.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations
appear in this book, and the FreeBSD Project was aware of the trademark claim, the designations have been followed by the ’™’ symbol.
Redistribution and use in source (SGML DocBook) and ’compiled’ forms (SGML, HTML, PDF, PostScript, RTF and so forth) with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code (SGML DocBook) must retain the above copyright notice, this list of conditions
and the following disclaimer as the first lines of this file unmodified.
2. Redistributions in compiled form (transformed to other DTDs, converted to PDF, PostScript, RTF and other
formats) must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Important:
THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
Table of Contents
1 Introduction................................................................................................................................................................1
2 Making a port yourself ..............................................................................................................................................2
3 Quick Porting .............................................................................................................................................................3
3.1 Writing the
Makefile
....................................................................................................................................3
3.2 Writing the description files ............................................................................................................................3
3.2.1
pkg-descr
.........................................................................................................................................3
3.2.2
pkg-plist
.........................................................................................................................................4
3.3 Creating the checksum file ..............................................................................................................................5
3.4 Testing the port................................................................................................................................................5
3.5 Checking your port with
portlint
...............................................................................................................6
3.6 Submitting the port..........................................................................................................................................6
4 Slow Porting................................................................................................................................................................7
4.1 How things work .............................................................................................................................................7
4.2 Getting the original sources.............................................................................................................................8
4.3 Modifying the port ..........................................................................................................................................8
4.4 Patching ...........................................................................................................................................................9
4.5 Configuring....................................................................................................................................................10
4.6 Handling user input .......................................................................................................................................10
5 Configuring the Makefile.........................................................................................................................................11
5.1 The original source........................................................................................................................................11
5.2 Naming ..........................................................................................................................................................11
5.2.1
PORTNAME
and
PORTVERSION
.........................................................................................................11
5.2.2
PORTREVISION
and
PORTEPOCH
.....................................................................................................11
5.2.3
PKGNAMEPREFIX
and
PKGNAMESUFFIX
..........................................................................................13
5.2.4
LATEST_LINK
...................................................................................................................................13
5.2.5 Package Naming Conventions ..........................................................................................................14
5.3 Categorization ...............................................................................................................................................15
5.3.1
CATEGORIES
.....................................................................................................................................16
5.3.2 Current list of categories...................................................................................................................16
5.3.3 Choosing the right category..............................................................................................................20
5.3.4 Proposing a new category .................................................................................................................20
5.3.5 Proposing reorganizing all the categories .........................................................................................21
5.4 The distribution files......................................................................................................................................22
5.4.1
DISTVERSION/DISTNAME
...............................................................................................................22
5.4.2
MASTER_SITES
................................................................................................................................22
5.4.3
EXTRACT_SUFX
................................................................................................................................23
5.4.4
DISTFILES
.......................................................................................................................................23
5.4.5
EXTRACT_ONLY
................................................................................................................................23
5.4.6
PATCHFILES
.....................................................................................................................................24
5.4.7 Multiple distribution files or patches from different sites and subdirectories (
MASTER_SITES:n
) 24
5.4.8
DIST_SUBDIR
...................................................................................................................................29
5.4.9
ALWAYS_KEEP_DISTFILES
.............................................................................................................30
5.5
MAINTAINER
.................................................................................................................................................30
5.6
COMMENT
........................................................................................................................................................31
iii
5.7 Dependencies ................................................................................................................................................31
5.7.1
LIB_DEPENDS
...................................................................................................................................31
5.7.2
RUN_DEPENDS
...................................................................................................................................31
5.7.3
BUILD_DEPENDS
..............................................................................................................................32
5.7.4
FETCH_DEPENDS
..............................................................................................................................32
5.7.5
EXTRACT_DEPENDS
..........................................................................................................................33
5.7.6
PATCH_DEPENDS
..............................................................................................................................33
5.7.7
USE_
*
................................................................................................................................................33
5.7.8 Minimal version of a dependency.....................................................................................................34
5.7.9 Notes on dependencies .....................................................................................................................34
5.7.10 Circular dependencies are fatal.......................................................................................................35
5.8
MASTERDIR
...................................................................................................................................................35
5.9 Manpages ......................................................................................................................................................36
5.10 Info files.......................................................................................................................................................37
5.11 Makefile Options .........................................................................................................................................37
5.11.1 Knobs..............................................................................................................................................37
5.11.2
OPTIONS
.........................................................................................................................................38
5.11.3 Feature auto-activation....................................................................................................................40
5.12 Specifying the working directory ................................................................................................................40
5.12.1
WRKSRC
...........................................................................................................................................40
5.12.2
NO_WRKSUBDIR
..............................................................................................................................41
5.13
CONFLICTS
.................................................................................................................................................41
5.14 Installing files ..............................................................................................................................................41
5.14.1 INSTALL_* macros .......................................................................................................................41
5.14.2 Stripping Binaries ...........................................................................................................................41
5.14.3 Installing a whole tree of files.........................................................................................................42
5.14.4 Install additional documentation.....................................................................................................42
5.14.5 Subdirectories under PREFIX ........................................................................................................44
6 Special considerations..............................................................................................................................................45
6.1 Shared Libraries ............................................................................................................................................45
6.2 Ports with distribution restrictions ................................................................................................................45
6.2.1
NO_PACKAGE
.....................................................................................................................................45
6.2.2
NO_CDROM
.........................................................................................................................................46
6.2.3
NOFETCHFILES
................................................................................................................................46
6.2.4
RESTRICTED
.....................................................................................................................................46
6.2.5
RESTRICTED_FILES
........................................................................................................................46
6.3 Building mechanisms ....................................................................................................................................47
6.3.1 Parallel ports building.......................................................................................................................47
6.3.2
make
,
gmake
, and
imake
.................................................................................................................47
6.3.3
configure
script .............................................................................................................................47
6.3.4 Using
scons
.....................................................................................................................................48
6.4 Using GNU autotools ....................................................................................................................................48
6.4.1 Introduction.......................................................................................................................................48
6.4.2
libtool
...........................................................................................................................................49
6.4.3
libltdl
...........................................................................................................................................49
6.4.4
autoconf
and
autoheader
............................................................................................................49
6.4.5
automake
and
aclocal
..................................................................................................................50
iv
6.5 Using GNU
gettext
....................................................................................................................................50
6.5.1 Basic usage .......................................................................................................................................50
6.5.2 Optional usage ..................................................................................................................................51
6.5.3 Handling message catalog directories ..............................................................................................51
6.6 Using
perl
....................................................................................................................................................51
6.7 Using X11 .....................................................................................................................................................52
6.7.1 X.Org components ............................................................................................................................53
6.7.2 Ports that require Motif.....................................................................................................................54
6.7.3 X11 fonts ..........................................................................................................................................54
6.7.4 Getting fake
DISPLAY
using Xvfb ...................................................................................................54
6.7.5 Desktop entries .................................................................................................................................55
6.8 Using GNOME..............................................................................................................................................55
6.9 Using KDE ....................................................................................................................................................55
6.9.1 Variable definitions ...........................................................................................................................55
6.9.2 Ports that require Qt..........................................................................................................................56
6.9.3 Component selection (Qt 4.x only)...................................................................................................57
6.9.4 Additional considerations .................................................................................................................58
6.10 Using Java ...................................................................................................................................................58
6.10.1 Variable definitions .........................................................................................................................59
6.10.2 Building with Ant ...........................................................................................................................61
6.10.3 Best practices ..................................................................................................................................61
6.11 Web applications, Apache and PHP ............................................................................................................62
6.11.1 Apache ............................................................................................................................................62
6.11.2 Web applications.............................................................................................................................63
6.11.3 PHP .................................................................................................................................................63
6.11.4 PEAR modules................................................................................................................................64
6.12 Using Python ...............................................................................................................................................64
6.13 Using
Tcl/Tk...............................................................................................................................................65
6.14 Using Emacs................................................................................................................................................66
6.15 Using Ruby..................................................................................................................................................66
6.16 Using SDL...................................................................................................................................................67
6.17 Using
wxWidgets........................................................................................................................................68
6.17.1 Introduction.....................................................................................................................................68
6.17.2 Version selection.............................................................................................................................68
6.17.3 Component selection ......................................................................................................................69
6.17.4 Unicode...........................................................................................................................................70
6.17.5 Detecting installed versions ............................................................................................................71
6.17.6 Defined variables ............................................................................................................................71
6.17.7 Processing in
bsd.port.pre.mk
.................................................................................................72
6.17.8 Additional
configure
arguments .................................................................................................72
6.18 Using
Lua
...................................................................................................................................................73
6.18.1 Introduction.....................................................................................................................................73
6.18.2 Version selection.............................................................................................................................73
6.18.3 Component selection ......................................................................................................................74
6.18.4 Detecting installed versions ............................................................................................................75
6.18.5 Defined variables ............................................................................................................................76
6.18.6 Processing in
bsd.port.pre.mk
.................................................................................................76
6.19 Using Xfce...................................................................................................................................................77
v
Plik z chomika:
musli_com
Inne pliki z tego folderu:
FreeBSD-Handbook.pdf
(11453 KB)
FreeBSD-ArchitectureHandbook.pdf
(1170 KB)
FreeBSD-PortersHandbook.pdf
(1284 KB)
FreeBSD-FAQ.pdf
(1016 KB)
FreeBSD-DevelopersHandbook.pdf
(1312 KB)
Inne foldery tego chomika:
articles
Zgłoś jeśli
naruszono regulamin