Practice building an SPK that contains two useful packages: boot
and MASS, which you can install from the repository.
Before you begin
You must have access to the
TERR
engine, either through your
Spotfire
installation, or the stand-alone
TERR
console.
About this task
This example builds an SPK for distributing a package to other
Spotfire Analyst
users. For an example of building an SPK for distributing a package for use by
the
TIBCO®
Enterprise Runtime for R - Server Edition
Installation and Administration Guide on the
TIBCO Docsite.
Note: The survival R
package is compatible with
TERR;
however, note that some of its examples might use the
plot
function, which is not supported in version
6.0.
When you prepare an SPK to be deployed to the
Spotfire Server,
remember the following rules:
- The
Spotfire
SPK can contain as many R packages as you need.
- You can have as many SPK
files in a deployment area as needed.
- You can have different SPK
files in different deployment areas.
- To distribute an updated
Spotfire
SPK to the
Spotfire Analyst
installations using the server, the
Spotfire
SPK must have its
BuiltVersion
incremented.
This example walks you through installing a package, generating the
list, installing your package. and making sure it works as expected.
Procedure
-
Load the Spotfire SPK package.
library(SpotfireSPK)
-
Install a package to be in your Spotfire SPK file.
install.packages(c("boot","MASS"))
The package survival is downloaded from the repository.
-
Generate the Debian Control File (DCF).
The DCF contains the package list to build into the Spotfire
SPK.
writeLines("Packages: boot,MASS",
"MySpotfireSPK1.dcf")
-
Build the SPK.
Note: In this example,
you are building the SPK without passing any arguments for certificates or
passwords, and the resulting output specifies that your resulting SPK is
unsigned. If you do not include the arguments
certificate
and
password
in your
buildSPK
function, when the package is
distributed,
Spotfire Analyst
users see a message warning of an unsigned file, and they are prompted to
accept or reject the installation. This message appears for every update of the
unsigned package. See your server administrator for a certificate and password
to include.
buildSPK("MySpotfireSPK1.dcf",
"MySpotfireSPK1.spk")
Note that "MySpotfireSPK1.spk" will not be signed.
Status information
Done.
-
Print the new list file.
cat(readLines("MySpotfireSPK1.dcf"),
sep="\n")
Packages: boot,MASS
Built: TERR 6.0.0; (includes date and time)
BuiltFile: MySpotfireSPK1.spk
BuiltName: TIBCO Enterprise Runtime for R Packages
BuiltId: F13B9A7E-783A-432a-8676-42FCD3022D70
BuiltVersion: 1.0.0.0
BuiltPackages: MASS (>=7.3-51.5),boot (>=1.3-24)
-
Browse your computer for the SPK file and the DCF file.
By default, both of these files are written to the your
Users\user name directory.
As of
TERR
5.1.0, you can have multiple SPK packages deployed to your
Spotfire Server.
Use the SPK's DCF list to keep track of the packages in the SPK. We recommend
you keep the lists where you can update them as necessary. See
Packages
deployed for a small group for more information.