Skip to content
Browse files

enable setting BASEDIR for Solaris packages, via --prefix

  • Loading branch information...
1 parent 45d8a43 commit 22f1205631ed65e28f61203eb8eccd0034522e88 @dpeters dpeters committed Dec 9, 2011
Showing with 7 additions and 2 deletions.
  1. +4 −0 lib/fpm/package.rb
  2. +2 −1 lib/fpm/target/solaris.rb
  3. +1 −1 templates/solaris.erb
View
4 lib/fpm/package.rb
@@ -66,6 +66,9 @@ class FPM::Package
# Array of configuration files
attr_accessor :config_files
+ # Package path prefix
+ attr_accessor :prefix
+
# target-specific settings
attr_accessor :settings
@@ -118,6 +121,7 @@ def initialize(source, params={})
@conflicts = source[:conflicts] || []
@scripts = source[:scripts]
@config_files = source[:config_files] || []
+ @prefix = source[:prefix] || "/"
# Target-specific settings, mirrors :settings metadata in FPM::Source
@settings = params[:settings] || {}
View
3 lib/fpm/target/solaris.rb
@@ -59,7 +59,8 @@ def build!(params)
prototype.puts("i postinstall") if self.scripts["post-install"]
# TODO(sissel): preinstall/postinstall
- IO.popen("pkgproto data=/").each_line do |line|
+ # strip @prefix, since BASEDIR will set prefix via the pkginfo file
+ IO.popen("pkgproto data/#{@prefix}=").each_line do |line|
type, klass, path, mode, user, group = line.split
# Override stuff in pkgproto
# TODO(sissel): Make this tunable?
View
2 templates/solaris.erb
@@ -1,5 +1,5 @@
CLASSES=none
-BASEDIR=/usr/local
+BASEDIR=<%= prefix %>
TZ=PST
PATH=/sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin
PKG=<%= name %>

0 comments on commit 22f1205

Please sign in to comment.
Something went wrong with that request. Please try again.