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.
Download File »»» https://t.co/vW24EtynOW
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.
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.
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 vi(1) and ex(1) can be set to use the correct value by typing :set tabstop=4 once the file has been loaded.
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 Slow Porting.
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.
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.
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).
It is recommended to keep all the filenames in this file sorted alphabetically.It will make verifying changes when upgrading the port much easier.The sorting should be applied after variable expansion takes place.The framework does this correctly when the package list is generated automatically.
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.
As PLIST_FILES is a make(1) variable, any entry with spaces must be quoted.For example, if using keywords described in pkg-create(8) and Expanding Package List with Keywords, the entry must be quoted.
Thorough automated testing can be done with ports-mgmt/poudriere from the Ports Collection, see poudriere for more information.It maintains jails where all of the steps shown above can be tested without affecting the state of the host system.
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.
Submit 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.diff as an attachment.
Giving a good description in the summary of the problem report makes the work of port committers and triagers a lot easier.The expected format for new ports is "[NEW PORT] category/portname short description of the port".Using this scheme makes it easier and faster to begin the work of committing the new port.
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
The fetch target is run. The fetch target is responsible for making sure that the tarball exists locally in DISTDIR. If fetch 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.
The patch 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.
The stage target is run. This puts the final set of built files into a temporary directory (STAGEDIR, see Staging). The hierarchy of this directory mirrors that of the system on which the package will be installed.
The above are the default actions. In addition, define targets pre-something or post-something, or put scripts with those names, in the scripts subdirectory, and they will be run before or after the default actions are done.
For example, if there is a post-extract target defined in the Makefile,and a file pre-build in the scripts subdirectory, the post-extract 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.
The default actions are done by the do-something targets from bsd.port.mk.For example, the commands to extract a port are in the target do-extract.If the default target does not do the job right, redefine the do-something target in the Makefile.
The "main" targets (for example, extract, configure, 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 do-extract, but never ever change the way extract operates!Additionally, the target post-deinstall is invalid and is not run by the ports infrastructure.
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 MASTER_SITES for details.
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).
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).
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.
In the preparation of the port, files that have been added or changed can be recorded with diff(1) for later feeding to patch(1).Doing this with a typical file involves saving a copy of the original file before making any changes using a .orig suffix.
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:
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.
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.
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.Patches with file names which do not start with patch- will not be applied automatically.
Using the recurse (-r) option to diff(1) 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.
795a8134c1