```diff
diff --git a/templates/rpm.erb b/templates/rpm.erb
index f89aaf5..d15a788 100644
--- a/templates/rpm.erb
+++ b/templates/rpm.erb
@@ -27,8 +27,8 @@ AutoReqProv: no
 # Seems specifying BuildRoot is required on older rpmbuild (like on CentOS 5)
 # fpm passes '--define buildroot ...' on the commandline, so just reuse that.
 BuildRoot: %buildroot
+<% if !prefix.nil? and !prefix.empty? and prefix != "/" %>
 # Add prefix, must not end with /
-<% if !prefix.nil? and !prefix.empty? %>
 Prefix: <%= prefix.gsub(/\/$/, '') %>
 <% end -%>
```

Test pass if I do the above; same effect as your code but I think it's a bit more explicit? Unless not having a prefix makes a package not relocatable. I will test.