Difference between revisions of "Pkgsrc in PC-BSD®"

From PC-BSD Wiki
Jump to: navigation, search
m
m (currently complete, though pkg_add is not yet proven to work.)
Line 5: Line 5:
 
# The NetBSD pkg tools and FreeBSD pkg tools have identical names. It is recommended to change the name of the NetBSD set to match 'bmake' by prepending a 'b' to each, as follows:<br><br><nowiki>#</nowiki> cd /usr/pkg/sbin/<br><nowiki>#</nowiki> mv pkg_add bpkg_add<br><nowiki>#</nowiki> mv pkg_create bpkg_create<br><nowiki>#</nowiki> mv pkg_delete bpkg_delete<br><nowiki>#</nowiki> mv pkg_info bpkg_info<br><br>If you do not intend to use the FreeBSD ports tools, they can be moved out of the way as follows:<br><br><nowiki>#</nowiki> cd /usr/sbin/<br><nowiki>#</nowiki> mv pkg_add pkg_add.orig<br><nowiki>#</nowiki> mv pkg_create pkg_create.orig<br><nowiki>#</nowiki> mv pkg_delete pkg_delete.orig<br><nowiki>#</nowiki> mv pkg_info pkg_info.orig<br><br>An example mk.conf file will be placed in /etc/mk.conf.example file when you use the bootstrap script.<br><br>
 
# The NetBSD pkg tools and FreeBSD pkg tools have identical names. It is recommended to change the name of the NetBSD set to match 'bmake' by prepending a 'b' to each, as follows:<br><br><nowiki>#</nowiki> cd /usr/pkg/sbin/<br><nowiki>#</nowiki> mv pkg_add bpkg_add<br><nowiki>#</nowiki> mv pkg_create bpkg_create<br><nowiki>#</nowiki> mv pkg_delete bpkg_delete<br><nowiki>#</nowiki> mv pkg_info bpkg_info<br><br>If you do not intend to use the FreeBSD ports tools, they can be moved out of the way as follows:<br><br><nowiki>#</nowiki> cd /usr/sbin/<br><nowiki>#</nowiki> mv pkg_add pkg_add.orig<br><nowiki>#</nowiki> mv pkg_create pkg_create.orig<br><nowiki>#</nowiki> mv pkg_delete pkg_delete.orig<br><nowiki>#</nowiki> mv pkg_info pkg_info.orig<br><br>An example mk.conf file will be placed in /etc/mk.conf.example file when you use the bootstrap script.<br><br>
 
# Add the location of bmake (/usr/pkg/bin) and NetBSD pkg tools (/usr/pkg/sbin) to the user's search path variable.<br>Edit the file .cshrc in the user's home directory to modify the following line:<br><br>set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin '''/usr/pkg/sbin /usr/pkg/bin''' $HOME/bin)<br><br>
 
# Add the location of bmake (/usr/pkg/bin) and NetBSD pkg tools (/usr/pkg/sbin) to the user's search path variable.<br>Edit the file .cshrc in the user's home directory to modify the following line:<br><br>set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin '''/usr/pkg/sbin /usr/pkg/bin''' $HOME/bin)<br><br>
# Add the PKG_PATH definition for the current version of pkgsrc (5.1_2011Q3) to the user's .cshrc file with the following line:<br><br><nowiki>setenv PKG_PATH ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname -m`/5.1_2011Q3/All/</nowiki><br><br>
+
# Add the PKG_PATH definition for the current version of pkgsrc (5.1) to the user's .cshrc file with the following line:<br><br><nowiki>setenv PKG_PATH ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname -m`/5.1/All/</nowiki><br><br>
 
# Obtain the vulnerabilities file:<br><nowiki>#</nowiki> /usr/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities<br><br>
 
# Obtain the vulnerabilities file:<br><nowiki>#</nowiki> /usr/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities<br><br>
 
# The vulnerabilities of some ports (ie Firefox) may prevent them from being built.<br>Adjust /usr/pkg/etc/mk.conf to allow vulnerable programs to be built by adding the following line:<br><br>ALLOW_VULNERABLE_PACKAGES=TRUE
 
# The vulnerabilities of some ports (ie Firefox) may prevent them from being built.<br>Adjust /usr/pkg/etc/mk.conf to allow vulnerable programs to be built by adding the following line:<br><br>ALLOW_VULNERABLE_PACKAGES=TRUE
Line 14: Line 14:
  
 
==Adding a NetBSD pkg==
 
==Adding a NetBSD pkg==
(needs to be tried/tested)
+
:<nowiki>%</nowiki>su -m
it should be a simple matter of using bpkg_add but on NetBSD it expects an address to be defined when doing this, and undefined when building from pkgsrc as above.. if the location variable is defined by set in .cshrc or similar, then the following is all that is needed:
+
 
:<nowiki>#</nowiki> bpkg_add www/firefox
 
:<nowiki>#</nowiki> bpkg_add www/firefox
 +
 +
The above probably should simply work, or the NetBSD documentation would not mention renaming the FreeBSD pkg tools. However, for the moment, testing throws the following type of error:
 +
 +
:pkg_add: Warning: package `firefox-3.6.16' was built for a platform:
 +
:pkg_add: NetBSD/x86_64 5.1 (pkg) vs. FreeBSD/x86_64 9.0 (this host)
 +
:pkg_add: 1 package addition failed

Revision as of 02:40, 16 December 2011

Available to PC-BSD is its own PBI collection, FreeBSD ports, and FreeBSD packages. However, it is also possible to use the NetBSD pkgsrc system to build software. This is not (yet) a pre-configured feature, which means there are some special instructions to follow for this functionality to be enabled. This section will describe how to configure and use NetBSD pkgsrc from PC-BSD.

Setting things up

  1. Obtain the NetBSD pkgsrc tree by the following commands:

    # cd /usr/
    # env CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout pkgsrc

  2. FreeBSD stores its ports pkg database in /var/db/pkg/. It is therefore recommended that you use /usr/db/pkgsrc/ with the --pkgdbdir flag as below:

    # cd /usr/pkgsrc/bootstrap/
    # ./bootstrap --pkgdbdir /var/db/pkgsrc/

  3. The NetBSD pkg tools and FreeBSD pkg tools have identical names. It is recommended to change the name of the NetBSD set to match 'bmake' by prepending a 'b' to each, as follows:

    # cd /usr/pkg/sbin/
    # mv pkg_add bpkg_add
    # mv pkg_create bpkg_create
    # mv pkg_delete bpkg_delete
    # mv pkg_info bpkg_info

    If you do not intend to use the FreeBSD ports tools, they can be moved out of the way as follows:

    # cd /usr/sbin/
    # mv pkg_add pkg_add.orig
    # mv pkg_create pkg_create.orig
    # mv pkg_delete pkg_delete.orig
    # mv pkg_info pkg_info.orig

    An example mk.conf file will be placed in /etc/mk.conf.example file when you use the bootstrap script.

  4. Add the location of bmake (/usr/pkg/bin) and NetBSD pkg tools (/usr/pkg/sbin) to the user's search path variable.
    Edit the file .cshrc in the user's home directory to modify the following line:

    set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/pkg/sbin /usr/pkg/bin $HOME/bin)

  5. Add the PKG_PATH definition for the current version of pkgsrc (5.1) to the user's .cshrc file with the following line:

    setenv PKG_PATH ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname -m`/5.1/All/

  6. Obtain the vulnerabilities file:
    # /usr/pkg/sbin/pkg_admin fetch-pkg-vulnerabilities

  7. The vulnerabilities of some ports (ie Firefox) may prevent them from being built.
    Adjust /usr/pkg/etc/mk.conf to allow vulnerable programs to be built by adding the following line:

    ALLOW_VULNERABLE_PACKAGES=TRUE

Using pkgsrc to build

Much like using the FreeBSD ports system, building with the NetBSD pkgsrc system is a rather simple matter of going to the location of the application within the pkgsrc tree, and then using bmake, for example:

# cd /usr/pkgsrc/www/firefox/
# bmake install clean

Adding a NetBSD pkg

%su -m
# bpkg_add www/firefox

The above probably should simply work, or the NetBSD documentation would not mention renaming the FreeBSD pkg tools. However, for the moment, testing throws the following type of error:

pkg_add: Warning: package `firefox-3.6.16' was built for a platform:
pkg_add: NetBSD/x86_64 5.1 (pkg) vs. FreeBSD/x86_64 9.0 (this host)
pkg_add: 1 package addition failed
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox