Browse Source

Beginnings of pkgng bootstrap and vagrant config for FreeBSD. Too bad it currently won't work on a Windows host.

Douglas Thrift 10 years ago
parent
commit
6cb45a5d52
3 changed files with 19 additions and 4 deletions
  1. 5 2
      Vagrantfile
  2. 3 1
      metadata.rb
  3. 11 1
      recipes/default.rb

+ 5 - 2
Vagrantfile

@@ -9,11 +9,11 @@ Vagrant.configure("2") do |config|
   config.vm.hostname = "pkgng-berkshelf"
 
   # Every Vagrant virtual environment requires a box to build off of.
-  config.vm.box = "Berkshelf-CentOS-6.3-x86_64-minimal"
+  config.vm.box = "freebsd-9.1-amd64"
 
   # The url from where the 'config.vm.box' box will be fetched if it
   # doesn't already exist on the user's system.
-  config.vm.box_url = "https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box"
+  config.vm.box_url = "https://dl.dropboxusercontent.com/u/25355402/freebsd-9.1-amd64.box"
 
   # Assign this VM to a host-only network IP, allowing you to access it
   # via the IP. Host-only networks can talk to the host machine as well as
@@ -36,6 +36,7 @@ Vagrant.configure("2") do |config|
   # the path on the guest to mount the folder. And the optional third
   # argument is a set of non-required options.
   # config.vm.synced_folder "../data", "/vagrant_data"
+  config.vm.synced_folder ".", "/vagrant", nfs: true
 
   # Provider-specific configuration so you can fine-tune various
   # backing providers for Vagrant. These expose provider-specific options.
@@ -82,5 +83,7 @@ Vagrant.configure("2") do |config|
     chef.run_list = [
         "recipe[pkgng::default]"
     ]
+
+    chef.nfs = true
   end
 end

+ 3 - 1
metadata.rb

@@ -6,4 +6,6 @@ description      'Installs/Configures pkgng'
 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
 version          '0.1.0'
 
-supports 'freebsd'
+supports 'freebsd', '>= 8.4'
+
+depends 'conf'

+ 11 - 1
recipes/default.rb

@@ -17,7 +17,17 @@
 # limitations under the License.
 #
 
-# TODO: bootstrap pkgng
+if ::File.executable? '/usr/sbin/pkg'
+  execute '/usr/sbin/pkg' do
+    environment 'ASSUME_ALWAYS_YES' => '1'
+    not_if 'TMPDIR=/dev/null ASSUME_ALWAYS_YES=1 PACKAGESITE=file:///nonexistent pkg info pkg'
+  end
+else
+  package 'pkg' do
+    source 'ports'
+    not_if 'TMPDIR=/dev/null ASSUME_ALWAYS_YES=1 PACKAGESITE=file:///nonexistent pkg info pkg'
+  end
+end
 
 ruby_block 'set pkgng provider' do
   block do