Skip to content
jordansissel edited this page Jun 15, 2011 · 3 revisions

Building solaris packages

Works just like the rest of fpm. Set your target to "solaris" (flag: -t solaris)

The use case covered here is for Jenkins. This is useful because Jenkins doesn't appear to release Solaris packages.

pre-install and post-install scripts are supported.

Simple overview:

# Download jenkins
wget http://mirrors.jenkins-ci.org/war/1.415/jenkins.war

# Package it up
fpm -s dir -t solaris -a all -n jenkins -v 1.415 --prefix /opt/local/jenkins jenkins.war 

# Install it.
pkgadd -d jenkins_1.415_all.solaris

# Run jenkins like you normally would
% java -jar /opt/local/jenkins/jenkins.war
Running from: /opt/local/jenkins/jenkins.war
webroot: $user.home/.jenkins
[Winstone 2011/06/15 07:36:09] - Beginning extraction from war file
...

More details

Building the package

% fpm -s dir -t solaris -a all -n jenkins -v 1.415 \
      --prefix /opt/local/jenkins ./jenkins.war
...
## Building pkgmap from package prototype file.
## Processing pkginfo file.
WARNING: parameter <PSTAMP> set to "gps73tbu20110615071710"
## Attempting to volumize 5 entries in pkgmap.
part  1 -- 76045 blocks, 15 entries
## Packaging one part.
/home/jill/fpm/build-solaris-jenkins_1.415_all.solaris/jenkins/pkgmap
/home/jill/fpm/build-solaris-jenkins_1.415_all.solaris/jenkins/pkginfo
/home/jill/fpm/build-solaris-jenkins_1.415_all.solaris/jenkins/root/opt/local/jenkins/jenkins.war
## Validating control scripts.
## Packaging complete.
Transferring <jenkins> package instance
Created /home/jill/fpm/jenkins_1.415_all.solaris

Installing it

% sudo pkgadd -d jenkins_1.415_all.solaris

The following packages are available:
  1  jenkins     jenkins
                 (all) 1.415

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 

...

## Installing part 1 of 1.
/opt/local/jenkins/jenkins.war
[ verifying class <none> ]

Installation of <jenkins> was successful.

Query

% pkginfo -l jenkins
   PKGINST:  jenkins
      NAME:  jenkins
  CATEGORY:  application
      ARCH:  all
   VERSION:  1.415
   BASEDIR:  /
    VENDOR:  <jill@gps73tbu>
      DESC:  no description given
    PSTAMP:  gps73tbu20110615072103
  INSTDATE:  Jun 15 2011 07:23
     EMAIL:  jill@gps73tbu
    STATUS:  completely installed
     FILES:        3 installed pathnames
                   1 shared pathnames
                   2 directories
               75623 blocks used (approx)

Removing it

% sudo pkgrm jenkins

The following package is currently installed:
   jenkins  jenkins
            (all) 1.415

Do you want to remove this package? [y,n,?,q] y

## Removing installed package instance <jenkins>
## Verifying package <jenkins> dependencies in global zone
## Processing package information.
## Removing pathnames in class <none>
/opt/local/jenkins/jenkins.war
/opt/local/jenkins
/opt <shared pathname not removed>
## Updating system information.

Removal of <jenkins> was successful.