title: Build RPM to just install files
body: <p>I need to build a RPM, with the sole purpose of installing a few fonts. I have read several tutorials about that, however everyone seems to suggests something different and I haven't been able to find something like a very basic setup to do that.</p>
  
  <p>Is it possible to just reference the files within the <code>%files</code> section of the spec? I tried however, RMP always tries to find the files within the <code>tmp</code> directory. Do I need to add a specific build step that copies everything I need to the <code>tmp</code> directory?</p>
  
  <p>Should these files go into the <code>SOURCE</code> or the <code>BUILD</code> directory when building the RPM? I have been finding a lot of different information on that. Some suggest to build a tarball that contains the files and place that under the <code>SOURCE</code> directory, however that seems kind of wrong, as font files are not actual source files to me.</p>
  
  <p>Ideally, I would like to just put all the font files within the BUILD folder under a directory structure like <code>./usr/share/fonts/</code> and then reference that within the <code>%file</code> section of the SPEC and let <code>rpm</code> do its magic. Probably I am missing or misunderstanding something here.</p>
  
  <p>Does the <code>%files</code> section always expect to find the source files within the <code>tmp</code> directory, or is there something wrong with my setup? I have created <code>~/.rpmmacros</code> which contains</p>
  
  <pre><code>%_topdir             /Users/user/rpm
  </code></pre>
  
  <p>which is the root build directory and contains the BUILD, RPMS, SOURCES, SPECS and tmp directories.</p>
  
  <p>I would be glad if someone could provide which are the least required items in the spec file to get that to work cleanly.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Following user3159253's suggestions, I am using the following spec file: </p>
  
  <pre><code>Name: test
  Version: 1.0.0
  Release: 1
  Copyright: Copyright info
  Group: Applications/System
  BuildArch: noarch
  
  %description
  Brief description of software package.
  
  %prep
  
  %build
  
  %install
  mkdir -p %{buildroot}/usr/share/fonts
  cp ./usr/share/fonts/* %buildroot/usr/share/fonts/
  
  %clean
  
  %files
  /usr/share/fonts/*
  </code></pre>
  
  <p>I copied the fonts into the BUILD/usr/share/fonts/ directory. If I query the rpm for a list of files, all fonts are there. However, when I install the rpm, it complains about </p>
  
  <pre><code>/usr/share/fonts is needed by test-1.0.0-1.noarch
  </code></pre>
  
  <p>However, it doesn't matter if this directory exists or not, so I guess <code>rpm</code> is complaining that this resource is not listed in its database. </p>
  
  <p>I have been able to fix this by changing the <code>%file</code> section to:</p>
  
  <pre><code>/usr/
  /usr/share/
  /usr/share/fonts/
  /usr/share/fonts/*
  </code></pre>
  
  <p>However, I doubt that this is such a good idea. Is there a better way to fix this?</p>