For instance, we could get along without pkg-plist in the above oneko port by adding these lines to the Makefile :. When looking for the origin of a file, people usually try to grep through the pkg-plist files in the ports tree. For example, if using keywords described in pkg-create 8 and Expanding Package List with Keywords , the entry must be quoted. Just type make makesum.
The ports framework will automatically generate distinfo. Do not try to generate the file manually. Make sure that the port rules do exactly what is desired, including packaging up the port. These are the important points to verify:. The port can be installed using the install target.
This verifies that the install script works correctly. The port can be deinstalled properly using the deinstall target. This verifies that the deinstall script works correctly. The port only has access to network resources during the fetch target phase. 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 fakeroot and uidfix. 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. In particular, check that the Makefile is in the right shape and the package is named appropriately.
Do not blindly follow the output of portlint. It is a static lint tool and sometimes gets things wrong. 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. We do not need the work directory or the pkgname. Next, create a patch 1 , file.
Assuming the port is called oneko and is in the games category. Add all the files with git add. For example:. Make sure that all required files are included, then commit the change to your local branch and generate a patch with git format-patch. If finding a particular application becomes challenging, try searching a site like SourceForge.
Package names include the version number and, in the case of ports based on python, the version number of the version of python the package was built with. Some ports also have multiple versions available. In the case of Subversion, there are different versions available, as well as different compile options.
In this case, the statically linked version of Subversion. When indicating which package to install, it is best to specify the application by the port origin, which is the path in the ports tree. Repeat the pkg search with -o to list the origin of each package:. Searching by shell globs, regular expressions, exact match, by description, or any other field in the repository database is also supported by pkg search.
If the Ports Collection is already installed, there are several methods to query the local version of the ports tree. To find out which category a port is in, type whereis file , where file is the program to be installed:. Alternately, an echo 1 statement can be used:. For example, to search for lsof :. The built-in search mechanism uses a file of index information. If a message indicates that the INDEX is required, run make fetchindex to download the current index file.
The text can be in comments, descriptions, or dependencies in order to find ports which relate to a particular subject when the name of the program is unknown. When using search or quicksearch , the search string is case-insensitive.
Searching for "LSOF" will yield the same results as searching for "lsof". For sites wishing to only use prebuilt binary packages from the FreeBSD mirrors, managing packages with pkg can be sufficient. However, for those sites building from source or using their own repositories, a separate port management tool will be needed.
Since pkg only works with binary packages, it is not a replacement for such tools. Those tools can be used to install software from both binary packages and the Ports Collection, while pkg installs only binary packages.
FreeBSD includes a bootstrap utility which can be used to download and install pkg and its manual pages. This utility is designed to work with versions of FreeBSD starting with Not all FreeBSD versions and architectures support this bootstrap process. For other cases, pkg must instead be installed from the Ports Collection or as a binary package. Once pkg has been installed, the package database must be converted from the traditional format to the new format by running this command:.
This step is not required for new installations that do not yet have any third-party software installed. This step is not reversible. The package database conversion may emit errors as the contents are converted to the new version. Generally, these errors can be safely ignored. However, a list of software that was not successfully converted is shown after pkg2ng finishes. These applications must be manually reinstalled. To ensure that the Ports Collection registers new software with pkg instead of the traditional packages database, FreeBSD versions earlier than By default, pkg uses the binary packages from the FreeBSD package mirrors the repository.
For information about building a custom package repository, see Building Packages with Poudriere. Additional pkg configuration options are described in pkg. Usage information for pkg is available in the pkg 8 manual page or by running pkg without additional arguments.
Each pkg command argument is documented in a command-specific manual page. To read the manual page for pkg install , for example, run either of these commands:.
The rest of this section demonstrates common binary package management tasks which can be performed using pkg. Each demonstrated command provides many switches to customize its use. The Quarterly branch provides users with a more predictable and stable experience for port and package installation and upgrades.
This is done essentially by only allowing non-feature updates. Quarterly branches aim to receive security fixes that may be version updates, or backports of commits , bug fixes and ports compliance or framework changes.
For example, the quarterly branch created in January , is named Q1. And the Latest branch provides the latest versions of the packages to the users. Information about the packages installed on a system can be viewed by running pkg info which, when run without any switches, will list the package version for either all installed packages or the specified package.
To install a binary package use the following command, where packagename is the name of the package to install:. This command uses repository data to determine which version of the software to install and if it has any uninstalled dependencies. For example, to install curl:. The new package and any additional packages that were installed as dependencies can be seen in the installed packages list:.
This command will compare the installed versions with those available in the repository catalogue and upgrade them from the repository. Software vulnerabilities are regularly discovered in third-party applications.
To address this, pkg includes a built-in auditing mechanism. To determine if there are any known vulnerabilities for the software installed on the system, run:. Removing a package may leave behind dependencies which are no longer required. Unneeded packages that were installed as dependencies leaf packages can be automatically detected and removed using:. Packages installed as dependencies are called automatic packages.
Non-automatic packages, i. There are many others that can be used to query the package database of the system. For instance, command pkg prime-origins can be used to get the origin port directory of the list mentioned above:. Once a package is a leaf package and is marked as automatic, it gets selected by pkg autoremove. Unlike the traditional package management system, pkg includes its own package database backup mechanism.
This functionality is enabled by default. If restoring a backup taken by the periodic script, it must be decompressed prior to being restored. Only copies of the latest installed packages are kept. Older versions of pkg kept all previous packages. To remove these outdated binary packages, run:. To address this, pkg has a built-in command to update package origins. When changing package origins, it is important to reinstall packages that are dependent on the package with the modified origin.
To force a reinstallation of dependent packages, run:. The Ports Collection is a set of Makefile s, patches, and description files. Each set of these files is used to compile and install an individual application on FreeBSD, and is called a port. Before installing and using the Ports Collection, please be aware that it is generally ill-advised to use the Ports Collection in conjunction with the binary packages provided via pkg to install software.
Dependencies could be different for a port in HEAD compared to its counterpart in a quarterly branch release and this could result in conflicts between dependencies installed by pkg and those from the Ports Collection.
If the Ports Collection and pkg must be used in conjunction, then be sure that your Ports Collection and pkg are on the same branch release of the ports tree. The Ports Collection contains directories for software categories. Inside each category are subdirectories for individual applications. Each application subdirectory contains a set of files that tells FreeBSD how to compile and install that program, called a ports skeleton.
Each port skeleton includes these files and directories:. Makefile : contains statements that specify how the application should be compiled and where its components should be installed. This directory may also contain other files used to build the port. It also tells the ports system which files to remove upon deinstallation. Some ports include pkg-message or other files to handle special situations. The port does not include the actual source code, also known as a distfile.
Before an application can be compiled using a port, the Ports Collection must first be installed. If it was not installed during the installation of FreeBSD, use one of the following methods to install it:. The key is used to verify the integrity of all downloaded files.
Note that Portsnap updates are generated from a snapshot of the main branch of the Ports Collection and cannot be configured to use a different branch for example, quarterly. If it is necessary to use a different branch of the Ports Collection for instance as referenced earlier in conjunction with binary packages , then the Git method must be used. When using fetch , the extract or the update operation may be run consecutively, like so:.
Refer to the Git Primer for a detailed description of Git. Git must be installed before it can be used to check out the ports tree. If a copy of the ports tree is already present, install Git like this:. If the ports tree is not available, or pkg is being used to manage packages, Git can be installed as a package:.
This section provides basic instructions on using the Ports Collection to install or remove software. The detailed description of available make targets and environment variables is available in ports 7. Before compiling any port, be sure to update the Ports Collection as described in the previous section. Alternately, run pkg audit -F before installing a new port.
This command can be configured to automatically perform a security audit and an update of the vulnerability database during the daily security system check. For more information, refer to pkg-audit 8 and periodic 8. Using the Ports Collection assumes a working Internet connection. It also requires superuser privilege. To compile and install the port, change to the directory of the port to be installed, then type make install at the prompt. Messages will indicate the progress:.
Since lsof is a program that runs with increased privileges, a security warning is displayed as it is installed. Once the installation is complete, the prompt will be returned. You should upgrade or use an alternative browser. Hi, folks: I have used portmaster for a long time, and feel it's a great tool for maintaining one's ports, flawlessly. Say, once I've fetched a single INDEX file from one mirror Maybe this , and I want to use this one instead of that in ports tree for portmaster to do searching and maintaining work.
So, have I skipped and misused some important options or variables? Thx in advance. What are you hoping to achieve by using a custom index file? Click to expand Ports are independent of the OS, but the index is not.
Look at the dates on those files.
0コメント