Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogen.sh as part for :configure #16

Closed
asergeyev opened this issue Apr 25, 2012 · 5 comments
Closed

Autogen.sh as part for :configure #16

asergeyev opened this issue Apr 25, 2012 · 5 comments

Comments

@asergeyev
Copy link

What if there would be small addition to :configure action that would run autogen.sh if configure does not exists? Would be nice to have something like that. IMO it should be part of configure but you might consider separate action for that.

@bryanwb
Copy link
Owner

bryanwb commented May 6, 2012

asergeyev, I am not familiar w/ autogen.sh. Can you point me to some examples of applications that use it? I could experiment w/ it.

@asergeyev
Copy link
Author

autogen is the script that generages "configure" For example if you're using zeromq out of the development tree, not from officially released tarball https://github.com/zeromq/zeromq2-x, you need to run autogen first.

@bryanwb
Copy link
Owner

bryanwb commented May 7, 2012

so u want to use ark to install zeromq? i'm down for that

@asergeyev
Copy link
Author

Not necessarily. I have more software than just zeromq that need to run that script before configure. Right now I did action_autogen in my clone of ark but IMO it could be something like this:

--- a/libraries/provider_ark.rb
+++ b/libraries/provider_ark.rb
@@ -58,10 +58,26 @@ class Chef
         action_link_paths
       end
 
-      def action_configure
+      def action_autogen
         set_paths
         action_download
         action_unpack
+        b = Chef::Resource::Script::Bash.new("autogen.sh to generate configure", run_context)
+        b.cwd new_resource.path
+        b.environment  new_resource.environment
+        b.code "./autogen.sh"
+        b.not_if{ ::File.exists?(::File.join(new_resource.path, 'configure')) }
+        b.run_action(:run)
+      end
+
+      def action_configure
+        if ::File.exists?(::File.join(new_resource.path, 'configure'))
+          action_autogen
+        else
+          set_paths
+          action_download
+          action_unpack
+        end
         b = Chef::Resource::Script::Bash.new("configure with autoconf", run_context)
         b.cwd new_resource.path
         b.new_resource.environment

@bryanwb
Copy link
Owner

bryanwb commented May 23, 2012

support added v0.0.10

@asergeyev, tks for your help!

@bryanwb bryanwb closed this as completed May 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants