Once upon a time, Mark wrote :
> I'm just playing with gnuboy (game boy emulator) as its fairly simple
> and small.
> I'm having a few problems with the %docs macro.
> After reading thru maximum rpm and the rpm docs, I'm still stuck on one
> thing, in the source for gnuboy there is a directory called docs, that
> contains, well the docs.
>
> I'm not sure what to pass to the %docs macro?
> I originally tried:
> %doc CHANGES  CONFIG  CREDITS  FAQ  HACKING  LIBERTY  README.old
>
> and it moans about missing files, would I have to put a few lines in the
> %build macro, just before configure to move the docs out of that
> directory and into the build root?
>
> ie: mv docs/* ../
Actually, I've already rebuild gnuboy, I just had forgotten to commit the
spec file, which is now done :
http://freshrpms.net/builds/gnuboy/gnuboy.spec
Basically, %doc is used to put files in %docdir (default to
/usr/share/docs/%{name}-%{version}/ and the listed files with relative
paths (i.e. that don't start with a "/") are relative to the %{builddir}
(the uncompressed source usually). So either you can choose to have a
"docs" directory inside %{_docdir} by putting :
%doc docs
(or, totally equivalent, the latter just reminding it's a directory)
%doc docs/
Or you can put all files that are in docs/ directly in %{_docdir} :
%doc docs/*
Try both, poke around, and you should catch the difference if it's not
already clear for you.
You can also mark any file from the %{buildroot} as documentation (will be
listed when using "-qd" to query the package's docs) by using %doc with
absolute filenames, for example :
%doc %{_datadir}/foo-game/manual
(this is /usr/share/foo-game/manual, an absolute file)
Also, for the packager's convenience, all files in /usr/share/man (aka
%{_mandir}) are automatically tagged as %doc.
> Also one more thing, whats the best way to work out the dependencies?
> as for example with gnuboy, all hte docs and the website says is it
> needs SDL.
>
> Do I set a Requires: SDL >= 1.2 (as my system uses SDL-1.2.4-5) or just
> put Requires: SDL.
Build the package once and see if it checks for a specific version, or read
the installation notes. Often you'll see "checking for SDL >= 1.2.0" for
example when running configure, then it's best to also make the package
depend on that version.
> One more quick question, I'm used to compiling source code no problem
> (cannot program, but stumble through), whats the best way for finding
> out what RPMS are needed for the Requires & BuildRequires macros?
> apart from read all the docs and websites info.
Well, read the docs indeed :-) You can also compile the package once
without those fields and see what the configure script is checking for
(basically, the libs and versions you'll need to add to the BuildRequires:)
then once the package is built, query the automatic dependencies that rpm
put into it. You'll see for instance if the binaries/libs from the package
need SDL, gtk+  etc. Then add those "Requires:" and rebuild a final version
of the package.
Often you can omit some dependencies, for example if a program is checking
for glib, gtk+, gdk-pixbuf and gnome libraries when being compiled,
BuildRequires: gnome-libs-devel
Requires: gnome-libs
will be enough since they already depend on the "lower level" libs that are
glib, gtk+ and gdk-pixbuf.
> Once again sorry to bother you with this, but I figured you were the
> best one to ask.
Well, this is typically the type of information interesting to share with
others, so I'll copy this answer to the rpm-list hoping some people will
appreciate :-)
> p.s freshrpms rocks .. creep..creep!
Thanks ;-)
Matthias
--
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Red Hat Linux release 7.3 (Valhalla) running Linux kernel 2.4.18-5
Load : 0.29 0.20 0.32, AC on-line, battery charging: 100% (8:29)
_______________________________________________
RPM-List mailing list <RPM-List@freshrpms.net>
http://lists.freshrpms.net/mailman/listinfo/rpm-list