diff --git a/lib/vanagon/platform.rb b/lib/vanagon/platform.rb index 0010df31..8c704036 100644 --- a/lib/vanagon/platform.rb +++ b/lib/vanagon/platform.rb @@ -380,6 +380,13 @@ def is_fedora? return !!@name.match(/^fedora-.*$/) end + # Utility matcher to determine is the platform is a amazon linux variety + # + # @return [true, false] true if it is a amazon linux variety, false otherwise + def is_amazon? + return !!@name.match(/^amazon-.*$/) + end + # Utility matcher to determine is the platform is a debian variety # # @return [true, false] true if it is a debian variety, false otherwise diff --git a/resources/rpm/project.spec.erb b/resources/rpm/project.spec.erb index 90263ec1..ceb1e77c 100644 --- a/resources/rpm/project.spec.erb +++ b/resources/rpm/project.spec.erb @@ -81,7 +81,7 @@ Requires: <%= requires.requirement %><%= requires.version ? " #{requires.versio # did not specify a dependency on these. # In the future, we will supress pre/post scripts completely if there's nothing # specified by the project or the components. -<%- if @platform.is_fedora? || (@platform.is_el? && @platform.os_version.to_i >= 9) -%> +<%- if @platform.is_fedora? || @platform.is_amazon? || (@platform.is_el? && @platform.os_version.to_i >= 9) -%> Requires(pre): /usr/bin/mkdir Requires(pre): /usr/bin/touch Requires(post): /usr/bin/mkdir