#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2019-03-17 16:34-0300\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Put one translator per line, in the form NAME , YEAR1, YEAR2 msgctxt "_" msgid "translator-credits" msgstr "" #. (itstool) path: info/title #: book.translate.xml:39 msgid "FreeBSD Porter's Handbook" msgstr "" #. (itstool) path: authorgroup/author #: book.translate.xml:42 msgid "The FreeBSD Documentation Project" msgstr "" #. (itstool) path: info/pubdate #. (itstool) path: info/releaseinfo #: book.translate.xml:47 book.translate.xml:134 msgid "$FreeBSD$" msgstr "" #. (itstool) path: info/copyright #: book.translate.xml:49 msgid "" "2000 2001 2002 2003 " "2004 2005 2006 2007 " "2008 2009 2010 2011 " "2012 2013 2014 2015 " "2016 2017 2018 2019 " "The FreeBSD Documentation Project" msgstr "" #. (itstool) path: legalnotice/title #: book.translate.xml:76 msgid "Copyright" msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:78 msgid "" "Redistribution and use in source (XML DocBook) and 'compiled' forms (XML, " "HTML, PDF, PostScript, RTF and so forth) with or without modification, are " "permitted provided that the following conditions are met:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:85 msgid "" "Redistributions of source code (XML DocBook) must retain the above copyright " "notice, this list of conditions and the following disclaimer as the first " "lines of this file unmodified." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:91 msgid "" "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." msgstr "" #. (itstool) path: important/para #: book.translate.xml:100 msgid "" "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." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:117 msgid "FreeBSD is a registered trademark of the FreeBSD Foundation." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:119 msgid "" "UNIX is a registered trademark of The Open Group in the United States and " "other countries." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:121 msgid "" "Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, " "Netra, OpenJDK, Solaris, StarOffice, SunOS and VirtualBox are trademarks or " "registered trademarks of Sun Microsystems, Inc. in the United States and " "other countries." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:126 msgid "" "Many of the designations used by manufacturers and sellers to distinguish " "their products are claimed as trademarks. Where those designations appear in " "this document, and the FreeBSD Project was aware of the trademark claim, the " "designations have been followed by the or the ® symbol." msgstr "" #. (itstool) path: chapter/title #. (itstool) path: sect2/title #. (itstool) path: sect1/title #: book.translate.xml:145 book.translate.xml:11016 book.translate.xml:14893 #: book.translate.xml:15383 book.translate.xml:19696 msgid "Introduction" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:147 msgid "" "The FreeBSD Ports Collection is the way almost everyone installs " "applications (\"ports\") on FreeBSD. Like everything else about FreeBSD, it " "is primarily a volunteer effort. It is important to keep this in mind when " "reading this document." msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:152 msgid "" "In FreeBSD, anyone may submit a new port, or volunteer to maintain an " "existing unmaintained port. No special commit privilege is needed." msgstr "" #. (itstool) path: chapter/title #: book.translate.xml:167 msgid "Making a New Port" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:169 msgid "Interested in making a new port, or upgrading existing ports? Great!" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:172 msgid "" "What follows are some guidelines for creating a new port for FreeBSD. To " "upgrade an existing port, read this, then read ." msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:176 msgid "" "When this document is not sufficiently detailed, refer to /usr/" "ports/Mk/bsd.port.mk, which is included by all port " "Makefiles. Even those not hacking Makefiles daily can gain much knowledge from it. Additionally, specific " "questions can be sent to the FreeBSD ports mailing list." msgstr "" #. (itstool) path: note/para #: book.translate.xml:184 msgid "" "Only a fraction of the variables (VAR) that can be overridden are mentioned in this document. Most (if " "not all) are documented at the start of /usr/ports/Mk/bsd.port.mk; the others probably ought to be. Note that this file uses a non-" "standard tab setting: Emacs and Vim will recognize the setting on loading the file. Both " "vi1 and ex1 can be set to use the " "correct value by typing :set tabstop=4 once the file has " "been loaded." msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:198 msgid "" "Looking for something easy to start with? Take a look at the list of requested ports " "and see if you can work on one (or more)." msgstr "" #. (itstool) path: chapter/title #: book.translate.xml:213 msgid "Quick Porting" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:215 msgid "" "This section describes how to quickly create a new port. For applications " "where this quick method is not adequate, the full Slow Porting process is described in ." msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:220 msgid "" "First, get the original tarball and put it into DISTDIR, " "which defaults to /usr/ports/distfiles." msgstr "" #. (itstool) path: note/para #: book.translate.xml:225 msgid "" "These steps assume that the software compiled out-of-the-box. In other " "words, absolutely no changes were required for the application to work on a " "FreeBSD system. If anything had to be changed, refer to ." msgstr "" #. (itstool) path: note/para #: book.translate.xml:232 msgid "" "It is recommended to set the DEVELOPER " "make1 variable in /etc/make.conf before getting " "into porting." msgstr "" #. (itstool) path: note/screen #: book.translate.xml:236 #, no-wrap msgid "" "# echo DEVELOPER=yes >> /etc/make.conf" msgstr "" #. (itstool) path: note/para #: book.translate.xml:238 msgid "" "This setting enables the developer mode that displays " "deprecation warnings and activates some further quality checks on calling " "make." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:244 msgid "Writing the Makefile" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:246 msgid "" "The minimal Makefile would look something like this:" msgstr "" #. (itstool) path: sect1/programlisting #: book.translate.xml:249 #, no-wrap msgid "" "# $FreeBSD$\n" "\n" "PORTNAME= oneko\n" "DISTVERSION= 1.1b\n" "CATEGORIES= games\n" "MASTER_SITES= ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/\n" "\n" "MAINTAINER= youremail@example.com\n" "COMMENT= Cat chasing a mouse all over the screen\n" "\n" ".include <bsd.port.mk>" msgstr "" #. (itstool) path: note/para #: book.translate.xml:262 msgid "" "In some cases, the Makefile of an existing port may " "contain additional lines in the header, such as the name of the port and the " "date it was created. This additional information has been declared obsolete, " "and is being phased out." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:269 msgid "" "Try to figure it out. Do not worry about the contents of the " "$FreeBSD$ line, it will be filled in automatically by " "Subversion when the port is imported to our main " "ports tree. A more detailed example is shown in the sample Makefile section." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:280 msgid "Writing the Description Files" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:282 msgid "" "There are two description files that are required for any port, whether they " "actually package or not. They are pkg-descr and " "pkg-plist. Their pkg- prefix " "distinguishes them from other files." msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:290 msgid "pkg-descr" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:292 msgid "" "This is a longer description of the port. One to a few paragraphs concisely " "explaining what the port does is sufficient." msgstr "" #. (itstool) path: note/para #: book.translate.xml:297 msgid "" "This is not a manual or an in-depth description on how " "to use or compile the port! Please be careful when copying from " "the README or manpage. Too often they are " "not a concise description of the port or are in an awkward format. For " "example, manpages have justified spacing, which looks particularly bad with " "monospaced fonts." msgstr "" #. (itstool) path: note/para #: book.translate.xml:306 msgid "" "On the other hand, the content of pkg-descr must be " "longer than the COMMENT line from the Makefile. It must explain in more depth what " "the port is all about." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:312 msgid "" "A well-written pkg-descr describes the port completely " "enough that users would not have to consult the documentation or visit the " "website to understand what the software does, how it can be useful, or what " "particularly nice features it has. Mentioning certain requirements like a " "graphical toolkit, heavy dependencies, runtime environment, or " "implementation languages help users decide whether this port will work for " "them." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:321 msgid "" "Include a URL to the official WWW homepage. Prepend one " "of the websites (pick the most common one) with WWW: " "(followed by single space) so that automated tools will work correctly. If " "the URI is the root of the website or directory, it must be terminated with " "a slash." msgstr "" #. (itstool) path: note/para #: book.translate.xml:329 msgid "" "If the listed webpage for a port is not available, try to search the " "Internet first to see if the official site moved, was renamed, or is hosted " "elsewhere." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:334 msgid "This example shows how pkg-descr looks:" msgstr "" #. (itstool) path: sect2/programlisting #: book.translate.xml:337 #, no-wrap msgid "" "This is a port of oneko, in which a cat chases a poor mouse all over\n" "the screen.\n" " :\n" "(etc.)\n" "\n" "WWW: http://www.oneko.org/" msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:346 msgid "pkg-plist" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:348 msgid "" "This file lists all the files installed by the port. It is also called the " "packing list because the package is generated by packing the " "files listed here. The pathnames are relative to the installation prefix " "(usually /usr/local)." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:354 msgid "Here is a small example:" msgstr "" #. (itstool) path: sect2/programlisting #: book.translate.xml:356 #, no-wrap msgid "" "bin/oneko\n" "man/man1/oneko.1.gz\n" "lib/X11/app-defaults/Oneko\n" "lib/X11/oneko/cat1.xpm\n" "lib/X11/oneko/cat2.xpm\n" "lib/X11/oneko/mouse.xpm" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:363 msgid "" "Refer to the pkg-create8 manual page for " "details on the packing list." msgstr "" #. (itstool) path: note/para #: book.translate.xml:367 msgid "" "It is recommended to keep all the filenames in this file sorted " "alphabetically. It will make verifying changes when upgrading the port much " "easier." msgstr "" #. (itstool) path: tip/para #: book.translate.xml:373 msgid "" "Creating a packing list manually can be a very tedious task. If the port " "installs a large numbers of files, creating the packing list automatically might save time." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:379 msgid "" "There is only one case when pkg-plist can be omitted " "from a port. If the port installs just a handful of files, list them in " "PLIST_FILES, within the port's Makefile. For instance, we could get along without pkg-plist in the above oneko port by adding these lines " "to the Makefile:" msgstr "" #. (itstool) path: sect2/programlisting #: book.translate.xml:388 #, no-wrap msgid "" "PLIST_FILES= bin/oneko \\\n" " man/man1/oneko.1.gz \\\n" " lib/X11/app-defaults/Oneko \\\n" " lib/X11/oneko/cat1.xpm \\\n" " lib/X11/oneko/cat2.xpm \\\n" " lib/X11/oneko/mouse.xpm" msgstr "" #. (itstool) path: note/para #: book.translate.xml:396 msgid "" "Usage of PLIST_FILES should not be abused. When looking " "for the origin of a file, people usually try to grep through the pkg-plist files in the ports " "tree. Listing files in PLIST_FILES in the " "Makefile makes that search more difficult." msgstr "" #. (itstool) path: tip/para #: book.translate.xml:406 msgid "" "If a port needs to create an empty directory, or creates directories outside " "of ${PREFIX} during installation, refer to for more information." msgstr "" #. (itstool) path: tip/para #: book.translate.xml:413 msgid "" "As PLIST_FILES is a make1 variable, any entry " "with spaces must be quoted. For example, if using keywords described in " "pkg-create8 and , the entry " "must be quoted." msgstr "" #. (itstool) path: tip/programlisting #: book.translate.xml:417 #, no-wrap msgid "PLIST_FILES= \"@sample ${ETCDIR}/oneko.conf.sample\"" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:420 msgid "" "Later we will see how pkg-plist and " "PLIST_FILES can be used to fulfill more sophisticated tasks." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:428 msgid "Creating the Checksum File" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:430 msgid "" "Just type make makesum. The ports framework will " "automatically generate distinfo. Do not try to generate " "the file manually." msgstr "" #. (itstool) path: sect1/title #. (itstool) path: chapter/title #: book.translate.xml:437 book.translate.xml:17930 msgid "Testing the Port" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:439 msgid "" "Make sure that the port rules do exactly what is desired, including " "packaging up the port. These are the important points to verify:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:445 msgid "" "pkg-plist does not contain anything not installed by " "the port." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:450 msgid "" "pkg-plist contains everything that is installed by the " "port." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:456 book.translate.xml:742 book.translate.xml:6597 #: book.translate.xml:6650 book.translate.xml:8875 book.translate.xml:9824 msgid "install" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:455 msgid "" "The port can be installed using the <_:buildtarget-1/> target. This verifies " "that the install script works correctly." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:462 msgid "deinstall" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:461 msgid "" "The port can be deinstalled properly using the <_:buildtarget-1/> target. " "This verifies that the deinstall script works correctly." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:468 book.translate.xml:664 book.translate.xml:665 #: book.translate.xml:668 book.translate.xml:6739 msgid "fetch" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:467 msgid "" "The port only has access to network resources during the <_:buildtarget-1/> " "target phase. This is important for package builders, such as ports-mgmt/poudriere." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:473 msgid "" "Make sure that make package can be run as a normal user " "(that is, not as root). If that " "fails, the software may need to be patched. See also and ." msgstr "" #. (itstool) path: procedure/title #: book.translate.xml:481 msgid "Recommended Test Ordering" msgstr "" #. (itstool) path: step/para #: book.translate.xml:484 msgid "make stage" msgstr "" #. (itstool) path: step/para #: book.translate.xml:488 msgid "make stage-qa" msgstr "" #. (itstool) path: step/para #: book.translate.xml:492 msgid "make package" msgstr "" #. (itstool) path: step/para #: book.translate.xml:496 msgid "make install" msgstr "" #. (itstool) path: step/para #: book.translate.xml:500 msgid "make deinstall" msgstr "" #. (itstool) path: step/para #: book.translate.xml:504 msgid "make package (as user)" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:508 msgid "Make certain no warnings are shown in any of the stages." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:511 msgid "" "Thorough automated testing can be done with ports-" "mgmt/poudriere from the Ports Collection, see for more information. It maintains jails where all of the steps shown above can be tested without affecting " "the state of the host system." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:520 msgid "Checking the Port with portlint" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:523 msgid "" "Please use portlint to see if the port conforms to our " "guidelines. The ports-mgmt/portlint program " "is part of the ports collection. In particular, check that the Makefile is in the right shape and the package is named appropriately." msgstr "" #. (itstool) path: important/para #: book.translate.xml:534 msgid "" "Do not blindly follow the output of portlint. It is a " "static lint tool and sometimes gets things wrong." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:541 msgid "Submitting the New Port" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:543 msgid "" "Before submitting the new port, read the DOs " "and DON'Ts section." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:547 msgid "" "Once happy with the port, the only thing remaining is to put it in the main " "FreeBSD ports tree and make everybody else happy about it too." msgstr "" #. (itstool) path: important/para #: book.translate.xml:552 msgid "" "We do not need the work directory or the " "pkgname.txz package, so delete them now." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:557 msgid "" "Next, either create a patch1, or a " "shar1 file. Assuming the port is called oneko and " "is in the games category." msgstr "" #. (itstool) path: example/title #: book.translate.xml:562 msgid "Creating a .diff for a New Port" msgstr "" #. (itstool) path: example/para #: book.translate.xml:565 msgid "" "Add all the files with svn add. cd to " "the base of the ports tree so full paths to the changed files are included " "in the diff, then generate the diff with svn diff. For " "example:" msgstr "" #. (itstool) path: example/screen #: book.translate.xml:571 #, no-wrap msgid "" "% svn add .\n" "% cd ../..\n" "% svn diff games/oneko > oneko.diff" msgstr "" #. (itstool) path: important/para #: book.translate.xml:576 msgid "" "To make it easier for committers to apply the patch on their working copy of " "the ports tree, please generate the .diff from the base " "of your ports tree." msgstr "" #. (itstool) path: example/title #: book.translate.xml:584 msgid "Creating a .shar for a New Port" msgstr "" #. (itstool) path: example/para #: book.translate.xml:587 msgid "" "cd to the directory above where the port directory is " "located, and use shar to create the archive:" msgstr "" #. (itstool) path: example/screen #: book.translate.xml:591 #, no-wrap msgid "" "% cd ..\n" "% shar `find oneko` " "> oneko.shar" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:595 msgid "" "Submit one of oneko.shar or oneko.diff with the bug " "submission form. Use product Ports & Packages, " "component Individual Port(s), and follow the guidelines shown " "there. Add a short description of the program to the Description field of " "the PR (perhaps a short version of COMMENT), and remember " "to add oneko.shar or oneko.diff as " "an attachment." msgstr "" #. (itstool) path: note/para #: book.translate.xml:607 msgid "" "Giving a good description in the summary of the problem report makes the " "work of port committers a lot easier. We prefer something like New " "port: category/portname short description of the port for new ports. Using this scheme makes it easier and faster to begin " "the work of committing the new port." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:617 msgid "" "After submitting the port, please be patient. The time needed to include a " "new port in FreeBSD can vary from a few days to a few months. A simple " "search form of the Problem Report database can be searched at ." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:622 msgid "" "To get a listing of open port PRs, " "select Open and Ports & Packages in the search form, then click [ Search ]." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:627 msgid "" "After looking at the new port, we will reply if necessary, and commit it to " "the tree. The submitter's name will also be added to the list of Additional FreeBSD Contributors and other files." msgstr "" #. (itstool) path: chapter/title #: book.translate.xml:642 msgid "Slow Porting" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:644 msgid "" "Okay, so it was not that simple, and the port required some modifications to " "get it to work. In this section, we will explain, step by step, how to " "modify it to get it to work with the ports paradigm." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:650 msgid "How Things Work" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:652 msgid "" "First, this is the sequence of events which occurs when the user first types " "make in the port's directory. Having bsd.port." "mk in another window while reading this really helps to " "understand it." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:658 msgid "" "But do not worry, not many people understand exactly how bsd.port." "mk is working... :-)" msgstr "" #. (itstool) path: step/para #: book.translate.xml:664 msgid "" "The <_:buildtarget-1/> target is run. The <_:buildtarget-2/> target is " "responsible for making sure that the tarball exists locally in " "DISTDIR. If <_:buildtarget-3/> cannot find the required " "files in DISTDIR it will look up the URL " "MASTER_SITES, which is set in the Makefile, as well as " "our FTP mirrors where we put distfiles as backup. It will then attempt to " "fetch the named distribution file with FETCH, assuming " "that the requesting site has direct access to the Internet. If that " "succeeds, it will save the file in DISTDIR for future use " "and proceed." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:681 book.translate.xml:782 book.translate.xml:788 #: book.translate.xml:6717 book.translate.xml:6760 msgid "extract" msgstr "" #. (itstool) path: step/para #: book.translate.xml:681 msgid "" "The <_:buildtarget-1/> target is run. It looks for the port's distribution " "file (typically a compressed tarball) in DISTDIR and " "unpacks it into a temporary subdirectory specified by WRKDIR (defaults to work)." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:690 book.translate.xml:5011 book.translate.xml:6787 #: book.translate.xml:24068 msgid "patch" msgstr "" #. (itstool) path: step/para #: book.translate.xml:690 msgid "" "The <_:buildtarget-1/> target is run. First, any patches defined in " "PATCHFILES are applied. Second, if any patch files named " "patch-* are found in " "PATCHDIR (defaults to the files " "subdirectory), they are applied at this time in alphabetical order." msgstr "" #. (itstool) path: para/buildtarget #. (itstool) path: entry/buildtarget #: book.translate.xml:700 book.translate.xml:783 book.translate.xml:5012 #: book.translate.xml:11515 book.translate.xml:22551 book.translate.xml:22553 msgid "configure" msgstr "" #. (itstool) path: step/para #: book.translate.xml:700 msgid "" "The <_:buildtarget-1/> target is run. This can do any one of many different " "things." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:705 msgid "If it exists, scripts/configure is run." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:710 msgid "" "If HAS_CONFIGURE or GNU_CONFIGURE is " "set, WRKSRC/configure is run." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:718 book.translate.xml:5013 book.translate.xml:6596 #: book.translate.xml:24070 msgid "build" msgstr "" #. (itstool) path: step/para #: book.translate.xml:718 msgid "" "The <_:buildtarget-1/> target is run. This is responsible for descending " "into the port's private working directory (WRKSRC) and " "building it." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:725 book.translate.xml:737 msgid "stage" msgstr "" #. (itstool) path: step/para #: book.translate.xml:725 msgid "" "The <_:buildtarget-1/> target is run. This puts the final set of built files " "into a temporary directory (STAGEDIR, see ). The hierarchy of this directory mirrors that of the system " "on which the package will be installed." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:734 book.translate.xml:744 msgid "package" msgstr "" #. (itstool) path: step/para #: book.translate.xml:734 msgid "" "The <_:buildtarget-1/> target is run. This creates a package using the files " "from the temporary directory created during the <_:buildtarget-2/> target " "and the port's pkg-plist." msgstr "" #. (itstool) path: step/para #: book.translate.xml:742 msgid "" "The <_:buildtarget-1/> target is run. This installs the package created " "during the <_:buildtarget-2/> target into the host system." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:751 msgid "pre-something" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:753 msgid "post-something" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:749 msgid "" "The above are the default actions. In addition, define targets <_:" "buildtarget-1/> or <_:buildtarget-2/>, or put scripts with those names, in " "the scripts subdirectory, and they will be run before " "or after the default actions are done." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:759 book.translate.xml:763 book.translate.xml:976 #: book.translate.xml:3864 book.translate.xml:4242 book.translate.xml:8588 msgid "post-extract" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:758 msgid "" "For example, if there is a <_:buildtarget-1/> target defined in the " "Makefile, and a file pre-build in " "the scripts subdirectory, the <_:buildtarget-2/> target " "will be called after the regular extraction actions, and pre-" "build will be executed before the default build rules are done. " "It is recommended to use Makefile targets if the " "actions are simple enough, because it will be easier for someone to figure " "out what kind of non-default action the port requires." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:772 book.translate.xml:777 msgid "do-something" msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:775 book.translate.xml:787 book.translate.xml:1233 #: book.translate.xml:8584 book.translate.xml:19900 msgid "do-extract" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:771 msgid "" "The default actions are done by the <_:buildtarget-1/> targets from " "bsd.port.mk. For example, the commands to extract a " "port are in the target <_:buildtarget-2/>. If the default target does not do " "the job right, redefine the <_:buildtarget-3/> target in the " "Makefile." msgstr "" #. (itstool) path: para/buildtarget #: book.translate.xml:790 msgid "post-deinstall" msgstr "" #. (itstool) path: note/para #: book.translate.xml:781 msgid "" "The main targets (for example, <_:buildtarget-1/>, <_:" "buildtarget-2/>, etc.) do nothing more than make sure all the stages up to " "that one are completed and call the real targets or scripts, and they are " "not intended to be changed. To fix the extraction, fix <_:buildtarget-3/>, " "but never ever change the way <_:buildtarget-4/> operates! Additionally, the " "target <_:buildtarget-5/> is invalid and is not run by the ports " "infrastructure." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:794 msgid "" "Now that what goes on when the user types make install is " "better understood, let us go through the recommended steps to create the " "perfect port." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:800 msgid "Getting the Original Sources" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:802 msgid "" "Get the original sources (normally) as a compressed tarball (foo." "tar.gz or foo.tar.bz2) and copy it into DISTDIR. Always use " "mainstream sources when and where possible." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:809 msgid "" "Set the variable MASTER_SITES to reflect where the " "original tarball resides. Shorthand definitions exist for most mainstream " "sites in bsd.sites.mk. Please use these sites—and the " "associated definitions—if at all possible, to help avoid the problem of " "having the same information repeated over again many times in the source " "base. As these sites tend to change over time, this becomes a maintenance " "nightmare for everyone involved. See for details." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:820 msgid "" "If there is no FTP/HTTP site that is well-connected to the net, or can only " "find sites that have irritatingly non-standard formats, put a copy on a " "reliable FTP or HTTP server (for example, a home page)." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:826 msgid "" "If a convenient and reliable place to put the distfile cannot be found, we " "can house it ourselves on ftp.FreeBSD.org; however, this is the least-preferred solution. The distfile " "must be placed into ~/public_distfiles/ of someone's " "freefall account. Ask the person who commits the " "port to do this. This person will also set MASTER_SITES " "to LOCAL/username where " "username is their FreeBSD " "cluster login." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:838 msgid "" "If the port's distfile changes all the time without any kind of version " "update by the author, consider putting the distfile on a home page and " "listing it as the first MASTER_SITES. Try to talk the " "port author out of doing this; it really does help to establish some kind of " "source code control. Hosting a specific version will prevent users from " "getting checksum mismatch errors, and also reduce the " "workload of maintainers of our FTP site. Also, if there is only one master " "site for the port, it is recommended to house a backup on a home page and " "list it as the second MASTER_SITES." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:851 msgid "" "If the port requires additional patches that are available on the Internet, " "fetch them too and put them in DISTDIR. Do not worry if " "they come from a site other than where the main source tarball comes, we " "have a way to handle these situations (see the description of PATCHFILES below)." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:859 msgid "Modifying the Port" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:861 msgid "" "Unpack a copy of the tarball in a private directory and make whatever " "changes are necessary to get the port to compile properly under the current " "version of FreeBSD. Keep careful track of steps, as " "they will be needed to automate the process shortly. Everything, including " "the deletion, addition, or modification of files has to be doable using an " "automated script or patch file when the port is finished." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:870 msgid "" "If the port requires significant user interaction/customization to compile " "or install, take a look at one of Larry Wall's classic " "Configure scripts and perhaps do something " "similar. The goal of the new ports collection is to make each port as " "plug-and-play as possible for the end-user while using a " "minimum of disk space." msgstr "" #. (itstool) path: note/para #: book.translate.xml:880 msgid "" "Unless explicitly stated, patch files, scripts, and other files created and " "contributed to the FreeBSD ports collection are assumed to be covered by the " "standard BSD copyright conditions." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:888 msgid "Patching" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:890 msgid "" "In the preparation of the port, files that have been added or changed can be " "recorded with diff1 for later feeding to " "patch1. Doing this with a typical file involves saving a copy of the " "original file before making any changes using a .orig " "suffix." msgstr "" #. (itstool) path: sect1/screen #: book.translate.xml:896 #, no-wrap msgid "" "% cp file " "file.orig" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:898 msgid "" "After all changes have been made, cd back to the port " "directory. Use make makepatch to generate updated patch " "files in the files directory." msgstr "" #. (itstool) path: tip/para #: book.translate.xml:904 msgid "" "Use BINARY_ALIAS to substitute hardcoded commands during " "the build and avoid patching build files. See for more information." msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:911 msgid "General Rules for Patching" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:913 msgid "" "Patch files are stored in PATCHDIR, usually " "files/, from where they will be automatically applied. " "All patches must be relative to WRKSRC. Typically " "WRKSRC is a subdirectory of WRKDIR, " "the directory where the distfile is extracted. Use make -V WRKSRC to see the actual path. The patch names are to follow these rules:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:925 msgid "" "Avoid having more than one patch modify the same file. For example, having " "both patch-foobar.c and patch-foobar.c2 making changes to ${WRKSRC}/foobar.c makes " "them fragile and difficult to debug." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:934 msgid "" "When creating names for patch files, replace each underscore (_) with two underscores (__) and each slash " "(/) with one underscore (_). For " "example, to patch a file named src/freeglut_joystick.c, " "name the corresponding patch patch-src_freeglut__joystick.c. Do not name patches like patch-aa or " "patch-ab. Always use the path and file name in patch " "names. Using make makepatch automatically generates the " "correct names." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:950 msgid "" "A patch may modify multiple files if the changes are related and the patch " "is named appropriately. For example, patch-add-missing-stdlib.h." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:957 msgid "" "Only use characters [-+._a-zA-Z0-9] for naming patches. " "In particular, do not use :: as a path " "separator, use _ instead." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:965 msgid "" "Minimize the amount of non-functional whitespace changes in patches. It is " "common in the Open Source world for projects to share large amounts of a " "code base, but obey different style and indenting rules. When taking a " "working piece of functionality from one project to fix similar areas in " "another, please be careful: the resulting patch may be full of non-" "functional changes. It not only increases the size of the ports repository " "but makes it hard to find out what exactly caused the problem and what was " "changed at all." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:975 msgid "" "If a file must be deleted, do it in the <_:buildtarget-1/> target rather " "than as part of the patch." msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:982 msgid "Manual Patch Generation" msgstr "" #. (itstool) path: note/para #: book.translate.xml:985 msgid "" "Manual patch creation is usually not necessary. Automatic patch generation " "as described earlier in this section is the preferred method. However, " "manual patching may be required occasionally." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:991 msgid "" "Patches are saved into files named patch-* where " "* indicates the pathname of the file that is " "patched, such as patch-Imakefile or patch-src-" "config.h." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:998 msgid "" "After the file has been modified, diff1 is used to record the " "differences between the original and the modified version. is used to " "tell diff1 to treat the non-existent original file as if it " "existed but was empty:" msgstr "" #. (itstool) path: sect2/screen #: book.translate.xml:1010 #, no-wrap msgid "" "% diff -u -N newfile." "orig newfile > patch-pathname-" "newfile" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1012 msgid "" "Do not add $FreeBSD$ RCS strings in patches. When patches " "are added to the Subversion repository with " "svn add, the fbsd:nokeywords property " "is set to yes automatically so keywords in the patch are " "not modified when committed. The property can be added manually with " "svn propset fbsd:nokeywords yes files...." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1022 msgid "" "Using the recurse () option to " "diff1 to generate patches is fine, but please look at the resulting " "patches to make sure there is no unnecessary junk in there. In particular, " "diffs between two backup files, Makefiles when the port " "uses Imake or GNU configure, etc., are " "unnecessary and have to be deleted. If it was necessary to edit " "configure.in and run autoconf to " "regenerate configure, do not take the diffs of " "configure (it often grows to a few thousand lines!). " "Instead, define USES=autoreconf and take the diffs of " "configure.in." msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:1040 msgid "Simple Automatic Replacements" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1042 msgid "" "Simple replacements can be performed directly from the port " "Makefile using the in-place mode of " "sed1. This is useful when changes use the value of a variable:" msgstr "" #. (itstool) path: sect2/programlisting #: book.translate.xml:1047 #, no-wrap msgid "" "post-patch:\n" " @${REINPLACE_CMD} -e 's|for Linux|for FreeBSD|g' ${WRKSRC}/README" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1050 msgid "" "Quite often, software being ported uses the CR/LF convention in source files." " This may cause problems with further patching, compiler warnings, or script " "execution (like /bin/sh^M not found.) To quickly convert " "all files from CR/LF to just LF, add this entry to the port " "Makefile:" msgstr "" #. (itstool) path: sect2/programlisting #: book.translate.xml:1057 #, no-wrap msgid "USES= dos2unix" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1059 msgid "A list of specific files to convert can be given:" msgstr "" #. (itstool) path: sect2/programlisting #: book.translate.xml:1061 #, no-wrap msgid "USES= dos2unix\n" "DOS2UNIX_FILES= util.c util.h" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1064 msgid "" "Use DOS2UNIX_REGEX to convert a group of files across " "subdirectories. Its argument is a find1-compatible regular " "expression. More on the format is in re_format7. This option is useful " "for converting all files of a given extension. For example, convert all " "source code files, leaving binary files intact:" msgstr "" #. (itstool) path: sect2/programlisting #: book.translate.xml:1072 #, no-wrap msgid "USES= dos2unix\n" "DOS2UNIX_REGEX= .*\\.([ch]|cpp)" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1075 msgid "" "A similar option is DOS2UNIX_GLOB, which runs " "find for each element listed in it." msgstr "" #. (itstool) path: sect2/programlisting #: book.translate.xml:1079 #, no-wrap msgid "USES= dos2unix\n" "DOS2UNIX_GLOB= *.c *.cpp *.h" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1083 msgid "" "The base directory for the conversion can be set. This is useful when there " "are multiple distfiles and several contain files which require line-ending " "conversion." msgstr "" #. (itstool) path: sect2/programlisting #: book.translate.xml:1087 #, no-wrap msgid "USES= dos2unix\n" "DOS2UNIX_WRKSRC= ${WRKDIR}" msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:1092 msgid "Patching Conditionally" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1094 msgid "" "Some ports need patches that are only applied for specific FreeBSD versions " "or when a particular option is enabled or disabled. Conditional patches are " "specified by placing the full paths to the patch files in " "EXTRA_PATCHES." msgstr "" #. (itstool) path: example/title #: book.translate.xml:1101 msgid "Applying a Patch for a Specific FreeBSD Version" msgstr "" #. (itstool) path: example/programlisting #: book.translate.xml:1103 #, no-wrap msgid "" ".include <bsd.port.options.mk>\n" "\n" "# Patch in the iconv const qualifier before this\n" ".if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100069\n" "EXTRA_PATCHES= ${PATCHDIR}/extra-patch-fbsd10\n" ".endif\n" "\n" ".include <bsd.port.mk>" msgstr "" #. (itstool) path: example/title #: book.translate.xml:1114 msgid "Optionaly Applying a Patch" msgstr "" #. (itstool) path: example/para #: book.translate.xml:1116 msgid "" "When an option requires a patch, " "use opt_EXTRA_PATCHES and " "opt_EXTRA_PATCHES_OFF to make " "the patch conditional on the opt option. See for more " "information." msgstr "" #. (itstool) path: example/programlisting #: book.translate.xml:1126 #, no-wrap msgid "" "OPTIONS_DEFINE= FOO BAR\n" "FOO_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-foo\n" "BAR_EXTRA_PATCHES_OFF= ${PATCHDIR}/extra-patch-bar.c \\\n" " ${PATCHDIR}/extra-patch-bar.h" msgstr "" #. (itstool) path: example/title #: book.translate.xml:1133 msgid "Using EXTRA_PATCHES With a Directory" msgstr "" #. (itstool) path: example/para #: book.translate.xml:1136 msgid "" "Sometime, there are many patches that are needed for a feature, in this " "case, it is possible to point EXTRA_PATCHES to a " "directory, and it will automatically apply all files named patch-" "* in it." msgstr "" #. (itstool) path: example/para #: book.translate.xml:1143 msgid "" "Create a subdirectory in ${PATCHDIR}, and move the " "patches in it. For example:" msgstr "" #. (itstool) path: example/screen #: book.translate.xml:1147 #, no-wrap msgid "" "% ls -l files/foo-patches\n" "-rw-r--r-- 1 root wheel 350 Jan 16 01:27 patch-Makefile.in\n" "-rw-r--r-- 1 root wheel 3084 Jan 18 15:37 patch-configure" msgstr "" #. (itstool) path: example/para #: book.translate.xml:1151 msgid "Then add this to the Makefile:" msgstr "" #. (itstool) path: example/programlisting #: book.translate.xml:1153 #, no-wrap msgid "OPTIONS_DEFINE= FOO\n" "FOO_EXTRA_PATCHES= ${PATCHDIR}/foo-patches" msgstr "" #. (itstool) path: example/para #: book.translate.xml:1156 msgid "" "The framework will then use all the files named patch-" "* in that directory." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:1164 msgid "Configuring" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:1166 msgid "" "Include any additional customization commands in the configure script and save it in the scripts " "subdirectory. As mentioned above, it is also possible do this with " "Makefile targets and/or scripts with the name " "pre-configure or post-configure." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:1176 msgid "Handling User Input" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:1178 msgid "" "If the port requires user input to build, configure, or install, set " "IS_INTERACTIVE in the Makefile. This " "will allow overnight builds to skip it. If the user sets the " "variable BATCH in their environment (and if the user sets the " "variable INTERACTIVE, then only those " "ports requiring interaction are built). This will save a lot of wasted time " "on the set of machines that continually build ports (see below)." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:1188 msgid "" "It is also recommended that if there are reasonable default answers to the " "questions, PACKAGE_BUILDING be used to turn off the " "interactive script when it is set. This will allow us to build the packages " "for CDROMs and FTP." msgstr "" #. (itstool) path: chapter/title #: book.translate.xml:1204 msgid "Configuring the Makefile" msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:1206 msgid "" "Configuring the Makefile is pretty simple, and again we " "suggest looking at existing examples before starting. Also, there is a sample Makefile in this handbook, so take " "a look and please follow the ordering of variables and sections in that " "template to make the port easier for others to read." msgstr "" #. (itstool) path: chapter/para #: book.translate.xml:1214 msgid "" "Consider these problems in sequence during the design of the new " "Makefile:" msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:1218 msgid "The Original Source" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:1220 msgid "" "Does it live in DISTDIR as a standard gzipped tarball named something like foozolix-1.2.tar.gz? If so, go on to the next step. If not, the distribution file " "format might require overriding one or more of DISTVERSION, DISTNAME, EXTRACT_CMD, " "EXTRACT_BEFORE_ARGS, EXTRACT_AFTER_ARGS, EXTRACT_SUFX, or DISTFILES." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:1232 msgid "" "In the worst case, create a custom <_:buildtarget-1/> target to override the " "default. This is rarely, if ever, necessary." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:1238 msgid "Naming" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:1240 msgid "" "The first part of the port's Makefile names the port, " "describes its version number, and lists it in the correct category." msgstr "" #. (itstool) path: sect2/title #. (itstool) path: row/entry #: book.translate.xml:1245 book.translate.xml:1971 msgid "PORTNAME" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1247 msgid "" "Set PORTNAME to the base name of the software. It is used " "as the base for the FreeBSD package, and for DISTNAME." msgstr "" #. (itstool) path: important/para #: book.translate.xml:1252 msgid "" "The package name must be unique across the entire ports tree. Make sure that " "the PORTNAME is not already in use by an existing port, " "and that no other port already has the same PKGBASE. If " "the name has already been used, add either PKGNAMEPREFIX or " "PKGNAMESUFFIX." msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:1262 msgid "" "Versions, DISTVERSION or " "PORTVERSION" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1265 msgid "" "Set DISTVERSION to the version number of the software." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1268 msgid "" "PORTVERSION is the version used for the FreeBSD package. " "It will be automatically derived from DISTVERSION to be " "compatible with FreeBSD's package versioning scheme. If the version contains " "letters, it might be needed to set " "PORTVERSION and not DISTVERSION." msgstr "" #. (itstool) path: important/para #: book.translate.xml:1277 msgid "" "Only one of PORTVERSION and DISTVERSION can be set at a time." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:1281 msgid "" "From time to time, some software will use a version scheme that is not " "compatible with how DISTVERSION translates in " "PORTVERSION." msgstr "" #. (itstool) path: tip/para #: book.translate.xml:1287 msgid "" "When updating a port, it is possible to use pkg-" "version8's