Build RPM to just install files
when you list files in %files
section these files are expected to reside within %{buildroot} directory. As Fedora documentation says since Fedora 10 buildroot can't be redefined in the spec, so yes, you have to create a required filesystem hierarchy within %buildroot, copy there your font files and then mention them in %files
:
...
%install
mkdir -p %{buildroot}/usr/share/fonts
cp /path/to/existing/MyFont.ttf %buildroot/usr/share/fonts/
...
%files
%defattr(0644, root,root)
/usr/share/fonts/*
your distribution probably has handy macros for standard font files locations, their proper registation in the system upon installation of the rpm etc, but most of these macros are vendor-specific. Also, you should copy your font files into SOURCES/ subdirectory and mention them in Source:
(Source<N>:
) tag in the rpm spec (just an example, a number can be any):
Name: myfonts
Summary: my fonts package
...
Source5: MyFont.ttf
...
Then you may use something like this in the %install
section:
cp %{SOURCE5} %buildroot/usr/share/fonts/
instead of a full path to the MyFont.ttf.
Update: You're right about missing dependencies: this is not artifacts (files, directories etc) on the filesystem, this is records in the RPM db (in /var/lib/rpm). So to solve the problem you have to work with that DB.
So if you have unsatisifed dependencies in the generated RPM package you have two options:
- if you simply wish to have a convenient way to distribute few files w/o tight integration with standard system facilities (see below), then you may simply turn off all
rpm
automatic dependency calculations. UseAutoReqProv: no
to completely disable all that stuff. - However you may need to build a package with a better integration with the rest of the OS. For example, fonts may need a registration within appropriate system facilities, e.g.
fontconfig
. Unfortunately, different Linux rpm distributions have slightly different, eh-hm, customs regarding that. Actually you have to check how this process is organized in your distribution in already existing font packages. You may take a suitable source rpm package (check http://rpmfind.net or http://rpm.pbone.net RPM search engines), extract its .spec-file and study how%prein
,%postin
,%preun
and%postun
section of the spec are organized. Obviously, font packages usually carry -fonts- in their name :)
Afterall, you may display dependencies and provides of an uninstalled rpm package with rpm --query --requires --package </path/to/file.rpm>
and rpm --query --provides --package </path/to/file.rpm>
. Installed packages' deps are shown with rpm --query --requires <rpm_name>
and so on.
As an answer for your edited question, the following might be the answer you seek:
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}/
cp -r ./* %buildroot/
%clean
%files
/*
Here we consider every file in the BUILD directory to be a part of the package. This is done by placing /*
under %files
.
Hope this addresses your question correctly.