anchor.diff:  %files
   %defattr(-,root,root,-)
   <%# Output config files and then regular files. -%>
  -<%= @config_files.collect { |c| '%config ' + c }.join("\n") %>
  -<%= paths.join("\n") %>
  +<%= @config_files.collect { |c| '%config ' + c }.join("\n") -%>
  +<%# list only files, not directories? %>
  +<%= files.reject { |f| File.directory?(File.join(staging_path, f)) }.collect { |f| "/#{f}" }.join("\n") %>
   
   %changelog
  
positive.code: AutoReqProv: no
  
  Group: <%= category %>
  <%#
  TODO: [Jay] rpms require a license
  let's detect it intelligently
  -%>
  License: <%= license %>
  Vendor: <%= vendor %>
  URL: <%= url or "http://nourlgiven.example.com/" %>
  <% if !maintainer.empty? -%>
  Packager: <%= maintainer %>
  <% end -%>
  Source0:  %{_sourcedir}/data.tar.gz
  BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  
  <% if !dependencies.empty? -%>
  <%
    properdeps =  dependencies.collect { |d| fix_dependency(d) }
  -%>Requires: <%= properdeps.join(", ") %>
  <% end -%>
  <% provides.each do |prov| -%>
  Provides: <%= prov %>
  
negative.code: # noop
  
  %install
  <% files.each do |path| -%>
  <%   source = File.join(staging_path, path) -%>
  <%   # Copy to the build_path/BUILD/ to make rpmbuild happy -%>
  <%   target = File.join(build_path, "BUILD", path) -%>
  <%   dir = File.dirname(target) %>
  mkdir -p "<%= dir %>"
  if [ -f "<%= source %>" ] ; then
    cp "<%= source %>" "<%= target %>"
  elif [ -d "<%= source %>" ] ; then
    mkdir "<%= target %>"
  fi
  <% end %>
  
  %clean
  # noop
  
  <% if scripts["pre-install"] -%>
  %pre
  