Need freebsd_port resource
freebsd_port_options drops in options but then doesn't run (cd /usr/ports/#{port_path} && make install clean clean-depends)
The package resource has a freebsd::port provider. You can use the port_options to add additional options you cannot add with package. this functionality should be added into the freebsd::port provider. We will look into it
Anybody can explain something? Where the freebsd::port provider is defined? I found this http://www.rubydoc.info/github/opscode/chef/Chef/Provider/Package/Freebsd/Port and I see a lot of code is similar to what is inside this cookbook and in some places it is much better written. But there is no documentation, no examples on the internet, so I don't know if it is possible to install a FreeBSD port by Chef itself. I can add a port provider here, the make install/deinstall code is not difficult to implement, but should I do it or it is better to contribute to Chef documentation? Implementing the same features in different classes is a violation of DRY principle.
I tried this using my fork but Chef installed packages, not ports:
freebsd_port_options 'lang/php56-extensions' do options bcmath: true, bz2: true end freebsd_package 'lang/php56-extensions' do provider Chef::Provider::Package::Freebsd::Port end
Options were set correctly but bcmath and bz2 were not installed, also it finished very fast, means no compilation happened. But if I manually run make install clean it starts to fetch the source and so on, everything correct.