tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

R packages

I end up using a lot of R packages and tend to find that they are not
yet in pkgsrc.  Over the years I have either added them or created
them privately, but that has become tedious enough that I have now
written a tool to automatically create them (see the current version
of the man page below).  I would like to commit this as pkgtools/R2pkg
at some point in the future.  However, I would like to seek some
consensus on how we wish to handle R packages into the future, because
this tool will (I hope) make it easier to import and maintain R
packages within pkgsrc so there may very well be _many_ new ones.

First, all R packages are currently under the "math" category.  I
propose creating a new category "R" and moving them all.  This will
better separate R packages (which are in fact not all math related)
and will prevent overwhelming the legitimate math packages with more R

Second, I would appreciate help on license handling for R packages.
Most R packages have an indication of the license that applies.  I
have built into the tool a map between those descriptions and the
known licenses in pkgsrc.  In some cases, however, the mapping is
unclear.  For example, how would "BSD" map given the several variants
of the BSD license?  And, how would "GPL (>= 2)" map?  Please see the
current set of known licenses below and offer any suggestions.

Finally, as the command line arguments are currently set up, the
normal case is to use both --fetch and --recurse.  Should I make these
the default cases and have corresponding --no-* options to turn them

I would appreciate any comments on the wisdom and design of this
tool.  Thank you very much.


R2PKG(8)                NetBSD System Manager's Manual                R2PKG(8)

     R2pkg -- create pkgsrc(7) package(s) for R package(s)

     R2pkg [--help] [--category category | -c category] [--debug level]
           [--fetch | -f] [--licenses] [--pkgsrc-path path | -p path]
           [--recurse | -r] [--update | -u] [--URL url | -U url] [package ...]

     The purpose of R2pkg is to create pkgsrc(7) packages for R (http://www.r- packages, much in the same way as url2pkg(8) does for more
     general packages.  In addition, a summary of the DESCRIPTION files for
     each created package is produced on the standard output.  Although the
     pkgsrc(7) files that are created are intended to be as correct as possi-
     ble, they should be reviewed and edited as necessary.

     Every package listed on the command line should correspond to the name of
     an R package found on the Comprehensive R Archive Network (CRAN; see  For each one, R2pkg downloads the corre-
     sponding DESCRIPTION file, parses it, and recursively does the same for
     all dependencies.  Subsequently, R2pkg creates or updates the pkgsrc(7)
     packages for each of the listed packages.  If a package already exists,
     the corresponding files are renamed with .orig extensions prior to creat-
     ing new ones.  As a result, the two version may be compared to make cer-
     tain that no manual edits are lost in the process.  Note that pre-exist-
     ing files with .orig extensions will be silently overwritten.

     The following options are available:

     -c category

     --category category
             Set the pkgsrc(7) category for R packages to category, which by
             default is math.

     --debug level
             Set the level of debugging output to level.  Increasingly posi-
             tive levels generate more detailed output.


             Fetch each R package and run 'make makesum' to create the dis-
             tinfo file.  This may not be successful unless used with the
             --recurse option because of missing dependencies.  If this option
             is not used, then the distinfo file must be created manually.

     --help  Produce a brief help message outlining the command line options.

             Generate a table of known licenses instead of creating packages.
             The table includes each known R license as described in a
             DESCRIPTION file and its corresponding pkgsrc(7) license, if any.
             If a pkgsrc(7) license is known when a package is created it will
             be used in the LICENSE clause of the package Makefile; otherwise,
             a commented clause using the license from the DESCRIPTION file
             will be used.

     -p path

     --pkgsrc-path path
             Set the path to the pkgsrc(7) source code to path, which by
             default is /usr/pkgsrc.


             In addition to creating R packages for those listed on the com-
             mand line, create R packages for all of the dependencies of them.


             Update existing R packages in addition to any listed on the com-
             mand line.

     -U url

     --URL url
             Add url to the head of the list of URLs from which R packages
             will be downloaded.  When downloading an R package, each element
             of the list will be tried in order until a succussful download
             occurs, an empty string is encountered in the list, or all ele-
             ments have been tried.  This option may be used multiple times.
             By default the list is

     The list of known correspondences between R license descriptions and
     pkgsrc(7) licenses may be incomplete.  Please send updates to be included
     in future releases.

     pkgsrc(7), and

     Brook Milligan <>

NetBSD 5.1_STABLE               October 7, 2011              NetBSD 5.1_STABLE
                 R license : pkgsrc license
        Apache License 2.0 : apache-2.0
                       BSD : no corresponding pkgsrc license
GNU General Public License : no corresponding pkgsrc license
                       GPL : no corresponding pkgsrc license
                GPL (>= 2) : gnu-gpl-v2
                     GPL-2 : gnu-gpl-v2
             GPL-2 | GPL-3 : gnu-gpl-v2 OR gnu-gpl-v3
               LGPL (>= 2) : gnu-lgpl-v2
                  LGPL-2.1 : gnu-lgpl-v2.1
                       MIT : mit
                 Unlimited : no corresponding pkgsrc license
              file LICENSE : no corresponding pkgsrc license

Home | Main Index | Thread Index | Old Index