X-Git-Url: https://gitweb.dragonflybsd.org/ikiwiki.git/blobdiff_plain/8fca40b1523753d8f80c31b7f78dc2d7c842f0f3..HEAD:/docs/howtos/HowToPkgsrc.mdwn diff --git a/docs/howtos/HowToPkgsrc.mdwn b/docs/howtos/HowToPkgsrc.mdwn index a202d9d3..6ae3f4bb 100644 --- a/docs/howtos/HowToPkgsrc.mdwn +++ b/docs/howtos/HowToPkgsrc.mdwn @@ -1,324 +1,356 @@ -[[!toc levels=3 ]]� -## History and Overview -Pkgsrc (http://www.pkgsrc.org) is a packaging system that was originally created by NetBSD (http://www.netbsd.org). It has also been ported to DragonFly, and many of the applications that are currently supported by pkgsrc are in the process of being built. +# Disclaimer -Pkgsrc is very alike to FreeBSD's ports mechanism, which was in use under NetBSD before pkgsrc, and is also used in OpenBSD and MirBSD. +DragonFly, up to and including version 3.4, used pkgsrc to manage third party software packages. DragonFly switched to dports at the 3.6 release. -## Installing pkgsrc +This page is still useful for anyone wanting to use pkgsrc, but the recommended packaging method is dports, which is covered in a similar document here: -In order for pkgsrc to be able to install applications, it must first be "bootstrapped" on the machine it is to run. This is basically equivalent to building the applications it requires to use. Since the 1.4 release, a -binary bootstrap is provided with the system. However, you still need to download the pkgsrc tree if you -want to build any applications. This can be done in one of two ways: through NetBSD's anonymous CVS access; or by downloading the pkgsrc tarball, which is updated weekly. +## Most of this page is obsolete; the instructions do not work -### Quick & Dirty Way +[http://www.dragonflybsd.org/docs/howtos/HowToDPorts/](http://www.dragonflybsd.org/docs/howtos/HowToDPorts/) -As of the 1.10 release, you can use the UsrMakefile to checkout & update the pkgsrc tree quickly. +---- -as root: +# pkgsrc on DragonFly - # cd /usr - # make pkgsrc-create +DragonFly uses a specially crafted Makefile in /usr and a git mirror +of the official pkgsrc repository to make pkgsrc distribution more user-friendly. -to fetch the intial pkgsrc repository from the net, or +The basics of the pkgsrc system can be found in NetBSD's [Pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/), and can be considered the canonical resource. - # cd /usr - # make pkgsrc-update -to update. +[[!toc levels=3 ]] -Please do edit the makefile to use an appropriately speedy CVS mirror for your location and to reduce -load on the main pkgsrc cvs server. +## Overview -### 'Custom' Way +### History +[Pkgsrc](http://www.pkgsrc.org) is a packaging system that was originally created for NetBSD. It has been ported to DragonFly, along with other operating systems. Pkgsrc is very similar to FreeBSD's ports mechanism. -In those cases where you wish to checkout pkgsrc manually, for example to track a specific pkgsrc branch, -a custom checkout may be desired. +### Overview -It is almost always faster for a first-time "whole source" checkout to FTP the tarballs and untar them locally because that makes best use of the network link. After that, using cvs checkout/update works to minimize the number of bytes coming over by sending only the changes. +The pkgsrc collection supplies a collection of files designed to automate the process of compiling an application from source code. Remember that there are a number of steps you would normally carry out if you compiled a program yourself (downloading, unpacking, patching, compiling, installing). The files that make up a pkgsrc source collection contain all the necessary information to allow the system to do this for you. You run a handful of simple commands and the source code for the application is automatically downloaded, extracted, patched, compiled, and installed for you. In fact, the pkgsrc source subsystem can also be used to generate packages which can later be manipulated with `pkg_add` and the other package management commands that will be introduced shortly. -The commands to fetch and install the tarball: +Pkgsrc understands ***dependencies***. Suppose you want to install an application that depends on a specific library being installed. Both the application and the library have been made available through the pkgsrc collection. If you use the `pkg_add` command or the pkgsrc subsystem to add the application, both will notice that the library has not been installed, and automatically install the library first. You might be wondering why pkgsrc® bothers with both. Binary packages and the source tree both have their own strengths, and which one you use will depend on your own preference. - # fetch -o /tmp/pkgsrc.tar.gz ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc.tar.gz - # cd /usr; tar -xzf /tmp/pkgsrc.tar.gz; chown -R root:wheel pkgsrc + **Binary Package Benefits** +* A compressed package tarball is typically smaller than the compressed tarball containing the source code for the application. -The commands to install via CVS: +* Packages do not require any additional compilation. For large applications, such as ***Mozilla***, ***KDE***, or ***GNOME*** this can be important, particularly if you are on a slow system. - # cd /usr - # cvs -d anoncvs@anoncvs.us.netbsd.org:/cvsroot co pkgsrc +* Packages do not require any understanding of the process involved in compiling software on DragonFly. -*Note*, you will have to be root in order for this to work. -Please check [NetBSD anoncvs mirrors](http://www.netbsd.org/mirrors/#anoncvs) for faster server. +**Pkgsrc source Benefits** -Either of these command sets will download the pkgsrc source tree to your local machine into the /usr/pkgsrc directory. -If you wish to perform your own bootstrap of pkgsrc (not needed since the 1.4 release), for example -to customize some of the pkgsrc default settings, use the following commands: +* Binary packages are normally compiled with conservative options, because they have to run on the maximum number of systems. By installing from the source, you can tweak the compilation options to (for example) generate code that is specific to a Pentium IV or Athlon processor. - # cd /usr/pkgsrc/bootstrap - # ./bootstrap --pkgdbdir /var/db/pkg --prefix /usr/pkg +* Some applications have compile time options relating to what they can and cannot do. For example, Apache can be configured with a wide variety of different built-in options. By building from the source you do not have to accept the default options, and can set them yourself. In some cases, multiple packages will exist for the same application to specify certain settings. For example, vim is available as a `vim` package and a `vim-gtk` package, depending on whether you have installed an X11 server. This sort of rough tweaking is possible with packages, but rapidly becomes impossible if an application has more than one or two different compile time options. -The directory you pass in for pkgdbdir will contain the list of applications you have installed on the system. The directory you supply to prefix is used as the root path for the applications you installed. The ports/packages of FreeBSD used a pkgdbdir of /var/db/pkg and a prefix of /usr/local. However, the ports system is deprecated for DragonFly and prebuilt packages will assume /var/db/pkg; so it is not recommended that the pkgdbdir be changed or that pkgsrc packages be used in combination with FreeBSD packages unless you really know what you are doing. +* The licensing conditions of some software distributions forbid binary distribution. They must be distributed as source code. -Note: The 1.4 errata http://www.dragonflybsd.org/community/errata1_4.cgi contains an example /etc/mk.conf file. It is recommend that you use that file instead of the ones generated by the following step on a 1.4 system. +* Some people do not trust binary distributions. With source code, it is possible to check for any vulnerabilities built into the program before installing it to an otherwise secure system. Few people perform this much review, however. -After the bootstrapping tools have been built, there will be a sample mk.conf file based on your system settings. This should be copied to /usr/pkg/etc. The command for this is: +* If you have local patches, you will need the source in order to apply them. - # cp work/mk.conf.example /usr/pkg/etc/mk.conf +* Some people like having code around, so they can read it if they get bored, hack it, debug crashes, borrow from it (license permitting, of course), and so on. -You are also strongly recommended to adjust the default path on your DragonFly machine to reflect the location of the bootstrapping tools. This is imperative as the program that makes/installs ports/packages from Free/DragonFly BSD are not compatible with pkgsrc (and vice-versa). To do this, you will need to add both /usr/pkg/bin and /usr/pkg/sbin to the front of your PATH environment variable. This is usually done by going to the line of your shell's startup configuration file and adding the appropriate directories to the front of the PATH line. It is also recommened that you adjust the appropriate files in /usr/share/skel/ so future users will also have to correct settings. After you have edited these files, you will need to get your shell to re-read the configurations. This is done by either calling source/export on the appropriate file, or by logging out and then back in. +To keep track of pkgsrc releases subscribe to the [NetBSD pkgsrc users mailing list](http://www.netbsd.org/MailingLists/pkgsrc-users) and the [NetBSD pkgsrc users mailing list](http://www.netbsd.org/MailingLists/tech-pkgsrc). It's also useful to watch the [DragonFly User related mailing list](http://leaf.dragonflybsd.org/mailarchive/) as errors with pkgsrc on DragonFly should be reported there. -Note: This path alteration step is still required on a 1.4_REL CD + **Warning:** Before installing any application, you should check http://www.pkgsrc.org/ for security issues related to your application. -## Building packages -Packages are built by going into the appropriate directory and issuing bmake install clean. For example, to build the screen package you need to issue the following commands. +Audit-packages will automatically check all installed applications for known vulnerabilities, a check will be also performed before any application build. Meanwhile, you can use the command `audit-packages -d` after you have installed some packages. - # cd /usr/pkgsrc/misc/screen - # bmake install clean +**Note:** Binary packages and source packages are effectively the same software and can be manipulated with the same pkg_* tools. -The above bmake command will build the package with its default compile-time options. Before building a package it is wise to first find out what compile-time options that package supports. To do this, use this bmake command. +## Installing pkgsrc - # bmake show-options +The basic pkgsrc tools are provided with every DragonFly system as part of installation. However, you still need to download the pkgsrc tree for building applications with these tools. -This will return back a message similar to the following... +Set GITHOST in /etc/make.conf or set it as an environment variable to select a different download location, if desired. See mirrors page for available mirrors. - Any of the following general options may be selected: - option1 - option2 Option2 description - option3 Option3 description - These options are enabled by default: - option1 - These options are currently enabled: - option3 +This downloads the stable version of the pkgsrc tree from the default mirror, if you didn't set GITHOST. As root: -If you are happy with the defaults, type bmake install clean. However, if you wish to make a change, you need to issue a make command similar to the following: + # cd /usr + # make pkgsrc-create - # bmake PKG_OPTIONS.="-option1 option2" install clean +to fetch the initial pkgsrc repository from the net, or -A minus sign '-' before an option removes that option from the compilation. To enable an option, you should list just the option name. should be substituted with name of the package you are installing, 'screen' for this example. + # cd /usr + # make pkgsrc-update -To add these to the /usr/pkg/etc/mk.conf (the file pkgsrc uses to track which options to enable during a build), you would insert a line similar to: +to update. - . PKG_OPTIONS.=-option1 option2 - - If you want to install and create binary packages (default location of built binary package is in /usr/pkgsrc/packages/All) which can then be later installed to another machine. issue the following commands. - - # cd /usr/pkgsrc/misc/screen - # bmake package clean +**Note**: If your DragonFly install is not up to date, you might have ended up with an old release of the pkgsrc tree. -Packages are usually placed into an appropriate category. To find out where the package you are seeking to build is located, try this command: + # cd /usr/pkgsrc + # git branch - # cd /usr/pkgsrc/ - # bmake search key='NameOfPackageYouWishToFind' +will show what release you are on. See Tracking the stable branch for more information. -## Pre-built pkgsrc packages -The pkgsrc section of the download page (http://www.dragonflybsd.org/main/download.cgi) contains a list of sites providing binary packages. +### Tracking the stable branch -Binary packages can be installed either by using the full URL +There are quarterly releases of pkgsrc that are specifically designed for stability. You should in general follow these, rather than the bleeding edge pkgsrc. When a new branch is out you need to set up a local branch tracking that one. 'make pkgsrc-update' will not do this for you. - # pkg_add ftp://packages.stura.uni-rostock.de/pkgsrc-current/DragonFly/DEVELOPMENT/i386/All/xorg-6.8.2nb1.tgz +To see the available remote branches: + # cd /usr/pkgsrc + # git pull + # git branch -r -or by setting PKG_PATH (example for csh) +To create a local branch, tracking the remote quarterly release: - # setenv PKG_PATH ftp://packages.stura.uni-rostock.de/pkgsrc-current/DragonFly/DEVELOPMENT/i386/All - # pkg_add xorg + # cd /usr/pkgsrc + # git branch pkgsrc-2010Q4 origin/pkgsrc-2010Q4 -Also note that the version can be omitted, in which case the newest package will be chosen. +Branch naming format is 'pkgsrc-YYYYQX', where YYYY is the year and QX is quarters 1-4 of the year. Check [pkgsrc.org](http://www.pkgsrc.org/) to see the name of the latest stable branch. -## Other pkgsrc commands -This section will cover the commands in pkgsrc that will allow a user to perform the suggested action. +After adding a new branch, it can be downloaded with: -### Get latest list of packages -To update the pkgsrc source hierarchy, you need to first change to the directory where you checked out the pkgsrc tree. Then, issue the command: + # cd /usr/pkgsrc + # git checkout pkgsrc-2010Q4 + # git pull - # cvs up -dP +## Dealing with pkgsrc packages -This will instruct the CVS program to download the latest version of pkgsrc from NetBSD. This will also update all of pkgsrc's build skeleton files. If you installed the pkgsrc from the tarball, you will need to manually download and extract new versions. +The following section explains how to find, install and remove pkgsrc packages. -There's also a RSS feed "NetBSD - Fresh Packages" available: http://www.netbsd.org/Changes/rss-netbsd-pkgs.xml +### Finding Your Application -### Tracking the stable branch +Before you can install any applications you need to know what you want, and what the application is called. DragonFly's list of available applications is growing all the time. Fortunately, there are a number of ways to find what you want: -If you don't want to go to the lastest, but get "actual" applications, you can track the stable branch. There are four releases per year; you can get the latest stable release from ["pkgsrc site"](http://www.pkgsrc.org) (www.pkgsrc.org), or you can update your pkgsrc directory: +Since DragonFly 1.11 [pkg_search(1)](http://leaf.dragonflybsd.org/cgi/web-man?command=pkg_search§ion1) is included in the base system. [pkg_search(1)](http://leaf.dragonflybsd.org/cgi/web-man?command=pkg_search§ion=1) searches an already installed pkgsrc INDEX for for a given package name. If pkgsrc is not installed or the INDEX file is missing, it fetches the [pkg_summary(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=pkg_summary§ion=5) file. - # cd /usr/pkgsrc - # cvs up -rpkgsrc-200XQY -dPA + # pkg_search fvwm + fvwm-2.4.20nb1 Newer version of X11 Virtual window manager + fvwm-2.5.24 Development version of X11 Virtual window manager + fvwm-themes-0.6.2nb8 Configuration framework for fvwm2 with samples + fvwm-wharf-1.0nb1 Copy of AfterStep's Wharf compatible with fvwm2 + fvwm1-1.24rnb1 Virtual window manager for X -Where 'X' is the year and 'Y' is the revision, with a number from 1 to 4 (for example -rpkgsrc-2006Q2). + # pkg_search -v fvwm-2.5 + Name : fvwm-2.5.24-50 + Dir : wm/fvwm-devel + Desc : Development version of X11 Virtual window manager + URL : any + Deps : perl>#5.0 gettext-lib>0.14.5 [...] -The stable branch will update the buggy applications, so update it frequently. +Its also possible to issue the command -More information in the official documentation: ["uptodate-cvs"](http://www.netbsd.org/Documentation/pkgsrc/getting.html#uptodate-cvs) (www.netbsd.org/Documentation/pkgsrc/getting.html#uptodate-cvs) + # cd /usr/pkgsrc/ + # bmake search key='package you are looking for' -### List all installed packages -To obtain a list of all the packages that are installed on your system, the user can perform the following command: +from the `/usr/pkgsrc` directory. - # pkg_info +It's also possible to browse website that show all the available pkgsrc packages, such as [http://pkgsrc.se/](http://pkgsrc.se) . -The output from pkg_info can also be piped to other commands such as more/less, and grep. The latter is useful to see which version of a particular package has been installed. For example: +### Installing applications - # pkg_info | grep xorg +Downloading a binary package is almost always faster than building from source, but not all programs in pkgsrc can be redistributed as a binary. In most cases, you will want to download a binary package if possible, and otherwise build from source if it's not available. -will return a list of all the xorg related packages installed on the system. +The `bin-install` target on DragonFly (with pkgsrc from 2011/02/07 and later) will do just that: -### Search available packages -Packages can be found using one of two ways. You can issue the command + # cd /usr/pkgsrc/misc/screen + # bmake bin-install clean - # bmake search key='package you are looking for' +This will download and install the appropriate `screen` binary package if it exists, and try building from source if it can't complete the download. -from the /usr/pkgsrc directory. +### Installing applications, source only -There is also the pkglocate tool that comes with pkgsrc. It is invoked in the following manner: +Packages are built by going into the appropriate directory and issuing `bmake install clean`. For example, to build the *screen* package you need to issue the following commands. - # /usr/pkgsrc/pkglocate 'package name' + # cd /usr/pkgsrc/misc/screen + # bmake install clean -You can also utilize the UNIX file finding commands (whereis, locate, or find). +To find out the options that can affect how a program is built: -### Upgrade all Installed packages + # bmake show-options -Note: Up to date information about this can be found in this web page: http://wiki.netbsd.se/index.php/How_to_upgrade_packages +To change options: -pkgsrc comes with a list of utilities that make package management easier. These files are located in /usr/pkgsrc/pkgtools. One of the items in this directory is pkg_chk which is similar to FreeBSD's portupgrade. Some commands that are worth noting while using pkg_chk are: + # bmake PKG_OPTIONS.="-option1 option2" install clean -Make initial list of installed packages: +Listing an option enables it. Listing an option with a "-" before it disables the option. - # pkg_chk -g +To make these option changes permanent for every future build or upgrade of this package, put a similar line in `/usr/pkg/etc/mk.conf`: -Remove all packages that are not up to date and packages that depend on them: + . PKG_OPTIONS.=-option1 option2 + +### Installing applications, binary only - # pkg_chk -r +Binary packages can be installed using *pkg_radd*: -Install all missing packages (use binary packages, this is the default): + # pkg_radd screen - # pkg_chk -a +This program works by setting the `PKG_PATH` environment variable to the appropriate path for the operating system and architecture to a remote repository of binary packages, and then using *pkg_add* to get packages. This will install most packages, but will not upgrade packages that are already installed. -Install all missing packages (build from source): +You can manually set `BINPKG_BASE` and use *pkg_add* to get the same effect, using a different server. - pkg_chk -as + # setenv BINPKG_BASE http://mirror-master.dragonflybsd.org/packages + # pkg_add screen -If you want to see a list of upgradeable packages, you can use the pkglint tool. Install the package pkgtools/pkglint and do a: - lintpkgsrc -i +#### Issues with pre-built packages -It will list the packages, which could be updated. +* The default remote repository for binary packages tracks quarterly pkgsrc releases, so your local install of pkgsrc should be the same quarterly release. +* Some packages are not licensed for distribution in binary form, so they may be able to build on DragonFly but won't be available with *pkg_radd*. If it fails, try going to that package's directory and install the package manually as described above. +* If you upgrade to an new DEVELOPMENT version of DragonFly very early (i.e. shortly after the branch), it might be possible that *pkg_radd* fails to install packages. This is due the fact, that it takes some time to built binary packages and thus, there are no binary packages available on the mirrors yet. Usually you'll see an announcement on the lists once the first packages for DEVELOPMENT are ready. -### Quick binary upgrades with pkgsrc -A disadvantage of using pkg_chk is that it deletes old packages before upgrading to newer versions of those packages. If the upgrades need to be built from source, or downloaded, this makes the packaged software unavailable during the potentially long time of the upgrade. +### List all installed applications -A solution is to download binary packages ahead of time and install from those local files, keeping downtime to a minimum. The steps to accomplish that with pkg_chk are as follows: +To obtain a list of all the packages that are installed on your system: -This step creates the pkg_chk.conf file, which lists the packages installed on your system. This only needs to be run the first time this process is followed. + # pkg_info - - pkg_chk -P ftp://binary/url -abg +To see if certain packages have been installed, filter for the name of the package. This example will show all *xorg*-related packages currently installed on the system: -This command downloads all the binary packages needed to upgrade pkgsrc. + # pkg_info | grep xorg - - pkg_chk -P ftp://binary/url -abf +### Removing packages + +If a program was installed as a package: + + # pkg_delete packagename + +If a package was installed from the source files, you can also change to the directory they were installed from and issue the command: + + # bmake deinstall + +Note that these methods are effectively interchangeable. Either will work whether the package was originally installed from source or binary. + +#### Remove associated files needed for building a package + +To remove the work file from building a package, and the package's dependencies: -This final step removes old packages and installs the already-downloaded up-to-date versions. It is during this step that pkgsrc packages are unavailable. + # bmake clean clean-depends +This can be combined with other steps: + + # bmake install clean clean-depends + +## Upgrading packages + +There's a number of ways to upgrade pkgsrc; some of these are built in and some are packages installable with pkgsrc. This list is not necessarily comprehensive. + +### Update pkgsrc system packages + +**Note**: Sometimes basic pkgsrc tools; *bmake*, *pkg_install* and *bootstrap-mk-files* need to be upgraded. However, they can't be deleted and replaced since you need that tool to accomplish replacement. The solution is to build a separate package before deletion, and install that package. + + # cd /usr/pkgsrc/devel/bmake + or + # cd /usr/pkgsrc/pkgtools/pkg_install + or + # cd /usr/pkgsrc/pkgtools/bootstrap-mk-files - pkg_chk -P /wherever/previous/step/put/binaries -abu + # env USE_DESTDIR=yes bmake package + # bmake clean-depends clean +And go to the packages directory and install the binary package with -Note that ftp://binary/url represents the URL to an online binary pkgsrc repository, such as in the PKG_PATH example on this page. + # cd /usr/pkgsrc/packages/All + # pkg_add -u (i.e. the name of the .tgz file). -If the first command returns an error, try creating a blank file called 'Makefile' in the directory where these commands are run. 'touch Makefile' will create this empty file. -## Deinstall a package -The command pkg_delete will remove any package that has been previously installed on a system. If a package was installed from the source files, you can also change to the directory they were installed from and issue the command: +### bmake replace +Performed in the `/usr/pkgsrc` directory that correlates with the installed package, the software is first built and then replaced. - # bmake deinstall + # cd /usr/pkgsrc/chat/ircII + # bmake replace -### Remove associated files needed for building a package -To remove the temporary source/object files that are associated with a package, you can issue the bmake clean command. This can also be performed on the same stage as the installation by using the following make command bmake install clean. The latter is more commonly done for simplicity reasons. +### pkg_rolling-replace -## Additional mk.conf notes +*pkg_rolling-replace* replaces packages one by one and you can use it for a better way of package management. Actually it does `bmake replace` on one package at a time, sorting the packages being replaced according to their interdependencies, which avoids most duplicate rebuilds. Once *pkg_rolling-replace* is installed you can update the packages through the following steps. -The default location of mk.conf is /usr/pkg/etc - -To specify where the rc.d scripts from the installed packages should go: + # cd /usr && make pkgsrc-update + # pkg_rolling-replace -u - RCD_SCRIPTS_DIR=/etc/rc.d +### pkgin -To enable the automatic installation of rc.d scripts into the $RCD_SCRIPTS_DIR directory: +Downloads and installs binary packages. Check the [[mirrors]] page for sites carrying binary packages to use with pkgin. You can run the following commands to get the packages updated. This assumes that *pkgin* is already configured. Please consult the documentation and the man page on how to do so. - PKG_RCD_SCRIPTS=YES + # pkgin update + # pkgin full-upgrade -This option can be set in the environment to activate it for binary packages. +### pkg_chk -If you have already partially downloaded a file, this option makes it resume the transfer: +It updates packages by removing them and rebuilding them. Warning: programs are unavailable until a rebuild finishes. If they don't rebuild, it won't work. *pkg_chk* requires a few steps in order to work correctly. They are listed here. - PKG_RESUME_TRANSFERS=YES + # pkg_chk -g # make initial list of installed packages + # pkg_chk -r # remove all packages that are not up to date and packages that depend on them + # pkg_chk -a # install all missing packages (use binary packages, this is the default) + # pkg_chk -as # install all missing packages (build from source) -If the checksum is not correct, automatically download from the next download site: +The above process removes all packages at once and installs the missing packages one by one. This can cause longer disruption of services when the removed package has to wait a long time for its turn to get installed. - FAILOVER_FETCH=YES +### pkg_add -u -To enable suffixing work directories with the machine's hostname (needed for PKGSRC_LOCKTYPE): +Point at a local or online binary archive location to download and update packages. - OBJHOSTNAME= +### rpkgmanager -To enable locking (so that only one process is working on the same package at the same time - sleep means that it should sleep for 5 seconds and try again (5 seconds is by default)): - - PKGSRC_LOCKTYPE=sleep +This requires that you've set up rpkgmanager first. Read more about rpkgmanager [[here|docs/howtos/rpkgmanager/]]. -To enable sending of MESSAGE file upon installation of a package to a specific user: + # yes | rpkgmanager.rb - PKGSRC_MESSAGE_RECIPIENTS=username +## Start pkgsrc applications on system startup -To clean easly the dependencies after compiling: +Packages often install rc.d scripts to control software running on startup. To specify where the rc.d scripts from the installed packages should go, add the following lines to your `/usr/pkg/etc/mk.conf` file: - CLEANDEPENDS=YES + RCD_SCRIPTS_DIR=/etc/rc.d + PKG_RCD_SCRIPTS=YES -## Speed up compilation with ccache -It is possible to speed up the recompilation of packages by using ccache. -The first thing is to install ccache: +This option can be set in the environment to activate it for binary packages. These packages will still have to be enabled in `/etc/rc.conf/` to run at boot. If these options aren't set, the rc file will be placed in `/usr/pkg/share/examples/rc.d/` and will need to be manually copied over to `/etc/rc.d`. - # cd /usr/pkgsrc/devel/ccache && bmake install +Many other options can be set in this file; see `/usr/pkgsrc/mk/defaults/mk.conf` for examples. -To use it the PKGSRC_COMPILER option must be set in your mk.conf must be set: +## Miscellaneous topics - PKGSRC_COMPILER = ccache gcc # if you are using gcc +### Post-installation Activities -It's also a good idea to set a high enough size for your cache: - - # ccache -M 5G +After installing a new application you will normally want to read any documentation it may have included, edit any configuration files that are required, ensure that the application starts at boot time (if it is a daemon), and so on. + The exact steps you need to take to configure each application will obviously be different. However, if you have just installed a new application and are wondering *What now?* These tips might help: -More infomration can be found in [ccaches manual page](http://ccache.samba.org/ccache-man.html) and the [pkgsrc Guide](http://www.netbsd.org/docs/pkgsrc/configuring.html#selecting-the-compiler). +Use [pkg_info(1)](http://leaf.dragonflybsd.org/cgi/web-man?command=pkg_info§ion=1) to find out which files were installed, and where. For example, if you have just installed Foo_Package version 1.0.0, then this command -## Where is my http://pkgsrc.se/wip dir? -[[http://pkgsrc.se/wip]] shows some interessting ports, especially if you are into java, but you will not find them in your default pkgsrc dir. Take a look at [[http://pkgsrc-wip.sourceforge.net]], there is a description how to get and update. + # pkg_info -L foopackage-1.0.0 | less -## Where to go for more help +will show all the files installed by the package. Pay special attention to files in `man/` directories, which will be manual pages, `etc/` directories, which will be configuration files, and `doc/`, which will be more comprehensive documentation. If you are not sure which version of the application was just installed, a command like this -* The NetBSD pkgsrc developers have a lot of pkgsrc documentation on this website (http://www.netbsd.org/Documentation/pkgsrc/). + # pkg_info | grep -i foopackage +will find all the installed packages that have *foopackage* in the package name. Replace *foopackage* in your command line as necessary. -* To find packages or updates, look at http://www.pkgsrc.se. +Once you have identified where the application's manual pages have been installed, review them using [man(1)](http://leaf.dragonflybsd.org/cgi/web-man?command=man§ion=1). Similarly, look over the sample configuration files, and any additional documentation that may have been provided. If the application has a web site, check it for additional documentation, frequently asked questions, and so forth. If you are not sure of the web site address it may be listed in the output from + # pkg_info foopackage-1.0.0 -* To query and/or report bugs against packages in pkgsrc, look at http://www.netbsd.org/support/send-pr.html category 'pkg'. +A `WWW:` line, if present, should provide a URL for the application's web site. +### Dealing with Broken Packages -* To get and update wip, look at http://pkgsrc-wip.sourceforge.net. +If you come across a package that does not work for you, there are a few things you can do, including: + 1. Fix it! The [pkgsrc Guide](http://www.netbsd.org/Documentation/pkgsrc/) includes detailed information on the ***pkgsrc®*** infrastructure so that you can fix the occasional broken package or even submit your own! -* This wiki has a list of some quick pkgsrc hacks to get the one or the other package building. + 1. Send email to the maintainer of the package first. Type `bmake maintainer` or read the `Makefile` to find the maintainer's email address. Remember to include the name and version of the port (send the `$NetBSD:` line from the `Makefile`) and the output leading up to the error when you email the maintainer. If you do not get a response from the maintainer, you can try [users](http://leaf.dragonflybsd.org/mailarchive/) . + 1. Grab a pre-built package from an [[mirror|mirrors]] site near you. -* The pkgsrc IRC channel on Freenode (http://www.freenode.net) (#pkgsrc) is another resource for pkgsrc users and devleopers. +### What is WIP? +Packages that can be built within the pkgsrc framework but are not yet necessarily ready for production use can be found in [http://pkgsrc-wip.sourceforge.net](http://pkgsrc-wip.sourceforge.net). These packages need to be downloaded separately; check the website for details. Packages in this collection are in development and may not build successfully. -* The DragonFlyBSD IRC channel on EFnet (http://www.efnet.org) (#dragonflybsd) is frequented by DragonFly users and developers using pkgsrc. +### Links +* More information: The pkgsrc guide [http://www.netbsd.org/Documentation/pkgsrc/](http://www.netbsd.org/Documentation/pkgsrc/) -* Google (http://www.google.com/search?q#pkgsrc&sourceidopera&num=0&ie=utf-8&oe=utf-8) also has a wealth of information. +* Web interface for searching packages: [http://www.pkgsrc.se](http://www.pkgsrc.se) ----- -CategoryHowTo +* Ways to upgrade packages [http://wiki-static.aydogan.net/How_to_upgrade_packages](http://wiki-static.aydogan.net/How_to_upgrade_packages) + +* To search and/or report bugs against packages in pkgsrc, look at [http://www.netbsd.org/support/send-pr.html](http://www.netbsd.org/support/send-pr.html) - use category 'pkg'. + +* The #pkgsrc IRC channel on Freenode + +* The #dragonflybsd IRC channel on EFnet