Skip to content

Commit

Permalink
Merge pull request #567 from bakins/smartos
Browse files Browse the repository at this point in the history
Smartos pkgsrc initial rough support
  • Loading branch information
jordansissel committed Oct 29, 2013
2 parents 35ecac0 + ba1bbea commit aa32814
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Vagrantfile
Expand Up @@ -20,4 +20,10 @@ Vagrant.configure("2") do |config|
puppet.manifests_path = "test"
puppet.manifest_file = "vagrant.pp"
end

config.vm.define :smartos do |smartos|
smartos.vm.box = "smartos-base1310-64-virtualbox-20130806.box"
smartos.vm.box_url = "http://dlc-int.openindiana.org/aszeszo/vagrant/smartos-base1310-64-virtualbox-20130806.box"
end

end
1 change: 1 addition & 0 deletions lib/fpm.rb
Expand Up @@ -14,3 +14,4 @@
require "fpm/package/python"
require "fpm/package/osxpkg"
require "fpm/package/solaris"
require "fpm/package/pkgin"
35 changes: 35 additions & 0 deletions lib/fpm/package/pkgin.rb
@@ -0,0 +1,35 @@
class FPM::Package::Pkgin < FPM::Package

def output(output_path)
output_check(output_path)

File.write(build_path("build-info"), `pkg_info -X pkg_install | egrep '^(MACHINE_ARCH|OPSYS|OS_VERSION|PKGTOOLS_VERSION)'`)

cwd = ::Dir.pwd
::Dir.chdir(staging_path)

files = []
Find.find(".") do |path|
stat = File.lstat(path)
next unless stat.symlink? or stat.file?
files << path
end
::Dir.chdir(cwd)

File.write(build_path("packlist"), files.sort.join("\n"))

File.write(build_path("comment"), self.description + "\n")

File.write(build_path("description"), self.description + "\n")

args = [ "-B", build_path("build-info"), "-c", build_path("comment"), "-d", build_path("description"), "-f", build_path("packlist"), "-I", "/opt/local", "-p", staging_path, "-U", "#{cwd}/#{name}-#{self.version}-#{iteration}.tgz" ]
safesystem("pkg_create", *args)

end

def iteration
return @iteration ? @iteration : 1
end

end

0 comments on commit aa32814

Please sign in to comment.